5 ms·
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?
- itamarst 10y agoIf 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?
- johnnycarcin 10y agoNo 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".
- improvemewrong 10y agoMicroservices 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
- sprobertson 10y agoI 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
- johnnycarcin 10y agoI 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?
- sprobertson 10y agoEven 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.
- usgroup 10y agoWell 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?