3 ms·
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
by sprobertson 10y ago
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
- 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.