Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build a streamlined development environment for micro-services

I was thinking about the micro services architecture and wondering if folks have a good best practice for development environments.

My working assumption is that each micro service will live in it's own git repository for isolation and ease of deployment. I'm also assuming that each developer will create a fork of any repo that they are working on.

The issue I'm considering arises where you are working on an issue that involves multiple micro-services. For example, there is a defect that impacts one micro service and how it appropriately consumes another micro-service.

Assuming n projects are involved in the defect, you would have to check out n git repositories and configure them to work together. If they each have a Vagratefile and Dockerfile, you end up running n VMs. Ideally you'd only have 1 Vagrant VM and each serivce would just be a new Docker instance in that same VM.

A master repo/project with git sub modules could work. The problem with that is if we create a generic master repo/project then the sub module will point to the upstream not the fork for the developer.

I'm currently thinking that a master project that had some configs, vagrant and fig might do the trick. I'm currently considering two methods of implementing this approach.

  1. Provide a config with some defaults i.e. project_1 should be located at ../project_id, etc
  2. Provide a script that will create submodules based on the user's github account, this would create the remote for the user's fork as well as the remote for the upstream project.

Has anybody else solved this problem or have a good workflow?

like image 337
Douglas Ferguson Avatar asked Jan 11 '15 19:01

Douglas Ferguson


People also ask

What are the 3 C's of microservices?

When you are ready to start adopting a microservices architecture and the associated development and deployment best practices, you'll want to follow the three C's of microservices: componentize, collaborate, and connect.

In what ways can microservices make developers more efficient?

Because the microservice component is simply another component on the network, developers can use the language or framework best suited for the required functionality. This approach can significantly reduce the amount of code to write and make it dramatically simpler to maintain.


1 Answers

I decided to go with fig.

If a microservice depends on another microservice fig will reference this service using ../

This assumes that all services are checked out as siblings. This can also easily be accomplished using git sub trees.

My dev_ops repro contains my Vagrant file for boot2docker, etc.

like image 118
Douglas Ferguson Avatar answered Oct 10 '22 16:10

Douglas Ferguson