Smart grid software interconnects multiple Engineering disciplines (power systems, communication, software and hardware technology, instrumentation, big data etc.). The software architecture is an evolving concept in smart grid systems in which systematic architecture development is a challenging process. The architecture has to realize the complex legacy power grid systems and cope up with current Information and Communication Technologies (ICT). The distributed generation in smart grid environment expects the software architecture to be distributed and to enable local control. Smart grid architecture should also be modular, flexible and adaptable to technology upgrades. In this paper, the authors have made a comprehensive review on architecture for smart grids. An in depth analysis of layered and agent based architectures is presented and compared under various domains.