Microgrids are a suitable, reliable and clean solution to integrate distributed generation into the mains grid. Microgrids can present both AC and DC distribution lines. The type of distribution conditions the performance of distribution line and implies different features, advantages and disadvantages in each case. This paper analyses, in detail, all this parameters for AC and DC microgrids in order to identify and describe the available alternatives for building and configuring a microgrid. Elements and issues involved in the implementation and development, such as protections, power converters, economic analysis, and availability are discussed and described. This analysis constitutes a tool for selecting a suitable configuration of a microgrid adapted to the needs in each situation. In addition, the paper provides a picture of the current situation of microgrids, and identifies and proposes future research lines.