Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Is possible to have a MicroServices Architecture sharing the same database?

 
Greenhorn
Posts: 5
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I have several services (I called them microServices) sharing the same database, Can say that I have a microService Architecture?
 
Author
Posts: 25
5
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
IMHO, the primary principle of microservices is that they should be independently deployable. That is I can make a change to a single service, and deploy that into production consistently, without having to change anything else.

When multiple services share the same data (Which is they read & write to the same schema), you have introduced a coupling point that makes independent deployability a real headache. Although this form of database integration is common, it is one of the biggest problems with 'traditional' SOA, and I strongly advocate against using this approach.
 
Bartender
Posts: 1318
39
IBM DB2 Netbeans IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jose's question raises an interesting point, IMO. OK, using same database introduce coupling, but would not be enough to separate each service using same database instance and keep data separated by assigning to each microservice a specific schema?
 
Sam Newman
Author
Posts: 25
5
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Claude, that is OK in my book. Obviously you have a potential single point of failure in the DB instance itself, but if each schema for each service is isolated from each other, you do get the de-coupling we're looking for! Just make sure people aren't doing sneaky cross-schema magic :-)
 
This is my favorite show. And this is my favorite tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic