title: Sharing code and schema between microservices
body: <p>If you go for a <strong>microservices architecture</strong> in your organization, they can share configuration via <a href="http://zookeeper.apache.org/">zookeeper</a> or its equivalent. However, how should the various services share a common db schema? common constants? and common utilities?</p>
  
  <p>One way would be to place all the microservices in the same code repository, but that would contradict the decoupling that comes with microservices...</p>
  
  <p>Another way would be to have each microservice be completely independent, however that would cause code duplication and data duplication in the separate databases each microservice would have to hold.</p>
  
  <p>Yet another way would be to implement functional microservices with no context\state, but that's usually not realistic and would push the architecture to having a central hub that maintains the context\state and a lot of traffic from\to it.</p>
  
  <p><strong>What would be a scalable, efficient practical and hopefully beautiful way to share code and schema between microservices?</strong> </p>