{"id":4397,"date":"2015-01-22T08:44:30","date_gmt":"2015-01-22T10:44:30","guid":{"rendered":"http:\/\/blog.plataformatec.com.br\/?p=4397"},"modified":"2015-06-01T12:23:20","modified_gmt":"2015-06-01T15:23:20","slug":"organizing-microservices-in-a-single-git-repository","status":"publish","type":"post","link":"https:\/\/blog.plataformatec.com.br\/2015\/01\/organizing-microservices-in-a-single-git-repository\/","title":{"rendered":"Organizing microservices in a single git repository"},"content":{"rendered":"

Microservices has gained popularity recently and some projects I’ve worked on had followed this approach. Basically, it’s an approach of software architecture that allows breaking monolithic applications into smaller decoupled, business-oriented and isolated deployable applications.<\/p>\n

Each microservice normally is hosted in its own git repository, since it has very defined business boundaries and the code must be isolated from other microservices to ensure decoupling and deploy independance.<\/p>\n

It may work greatly if you organize a team by each microservice. So, if a team is responsible for a given microservice and won’t work on other microservices, this organization may be good enough.<\/p>\n

During project developments, we at Plataformatec understood that it is not so productive to focus on specific parts of a feature. Instead, we design and develop features by perceiving it as a whole, as it would be perceived by the end user. We don’t work with application specialists, we work with generalists and a lot of communication through pull requests.<\/p>\n

So the best fit for the way we work, as our experience has shown us, is to put all the microservices and the clients that consume them into a single git repository. It may sound weird or semantically wrong for some, but after all, those microservices are small parts of a whole, something bigger, that is called software ecosystem<\/a>. Since they share or exchange information among them, they’re somehow connected to each other.<\/p>\n

This pragmatic approach is not exclusively ours, many people out there apply it. Two very nice examples are Facebook<\/a> and Google<\/a>. Of course their codebase is far larger than a normal application. They’re an exception. Google’s codebase, for instance, keeps really low level information like operating system configurations.<\/p>\n

Using a single repository has proven to be a very good practice for us, because we can keep track of relevant pull requests easier; we can refactor, create and test new features throughout all the microservices faster; and test its integration without leaving the current context. Also, project gardening is way simpler: upgrading Ruby, Rails version, gem updates, using shared paths as gems, tests and deploy all of them can be automated and run across all microservices.<\/p>\n

Have you worked with a single or multiple repositories? Please share your thoughts about it in the comments below!<\/p>\n

\n\"Subscribe<\/a>\n<\/div>\n","protected":false},"excerpt":{"rendered":"

Microservices has gained popularity recently and some projects I’ve worked on had followed this approach. Basically, it’s an approach of software architecture that allows breaking monolithic applications into smaller decoupled, business-oriented and isolated deployable applications. Each microservice normally is hosted in its own git repository, since it has very defined business boundaries and the code … \u00bb<\/a><\/p>\n","protected":false},"author":28,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[1],"tags":[232,147,233],"aioseo_notices":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/posts\/4397"}],"collection":[{"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/users\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/comments?post=4397"}],"version-history":[{"count":9,"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/posts\/4397\/revisions"}],"predecessor-version":[{"id":4712,"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/posts\/4397\/revisions\/4712"}],"wp:attachment":[{"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/media?parent=4397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/categories?post=4397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/tags?post=4397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}