News for hackers. Stuff that matters.

Ask HN: How are you solving the microservices data problem?

I've seen suggestions to use a database/datasource per microservice, even if data is duplicated in those various locations. I'm interested in hearing what people who use many microservices in production are doing to solve this problem. MDM? A database microservice? Cron?
( 7 comments | 4 points | on HN )
Re:Ask HN: How are you solving the microservices data problem? by usgroup on Saturday February 18, 2017 @02:37AM (#13673967)
Well the dream is orthogonality. It's not uncommon to have a data store like Cassandra setup with each data access micro service having its own key space. Other micro services then use the data access micro services in order to retain the single point of responsibility.

So what used to be 4 lines of code with a shared SQL db now requires at least 2 services which have to have corellation Id based logging to give you a fighting chance of working out what goes wrong, centralised log store, separate containers, monitoring, configured orchestration for the containers and some sort of communication between them ... what's not to love?

Re:Ask HN: How are you solving the microservices data problem? by sprobertson on Friday February 17, 2017 @03:22PM (#13671382)
I don't use a database per service, rather a single database service which others can query. Sometimes there might be some caching layer in another service, or if the data source is unique enough (eg elasticsearch) it gets its own service.

PS I'm apparently a buffoon and use microservices for even the most trivial side project

Re:Ask HN: How are you solving the microservices data problem? by johnnycarcin on Friday February 17, 2017 @06:00PM (#13672461)
I was talking with a group yesterday and that idea came up (or something similar). The idea was to have a data microservice for writes and then let the various microservices do reads from their specific db. This data microservice would handle writing data out across the various data sources so nobody else had to know about it, they just knew to send writes to that service. Is that sort of what you are doing?
Re:Ask HN: How are you solving the microservices data problem? by sprobertson on Saturday February 18, 2017 @02:30AM (#13673954)
Even simpler, just one service for both reads and writes. It acts as a CRUD API for the whole system. Other services are for more distinct functions like sending notifications, interacting with an API, or running some specific process.
Re:Ask HN: How are you solving the microservices data problem? by itamarst on Friday February 17, 2017 @07:26AM (#13667749)
If you're a single developer you shouldn't be using microservices, which is an easy way to solve the problem: microservices are only useful for large organizations.

What specifically is the problem you're trying to solve?

Re:Ask HN: How are you solving the microservices data problem? by johnnycarcin on Friday February 17, 2017 @09:01AM (#13668274)
No specific problem, I just run into a lot of customers who are trying to solve the problem. I can parrot back everything from the books and the Netflix tech blog but I'm interested to hear what non-Netflix people are actually doing. Really more of just a learning question versus "I have an immediate problem to solve".
Re:Ask HN: How are you solving the microservices data problem? by improvemewrong on Friday February 17, 2017 @07:48PM (#13672989)
Microservices can be used to logically separate different parts of the program. It also means that the same service could be used for different projects. I don't see why a single developer shouldn't use them