3 ms·
> when one db connection has access to every resource So why not use db users to restrict each part to only be able to access the parts it should?
by SahAssar 8y ago
> when one db connection has access to every resource
So why not use db users to restrict each part to only be able to access the parts it should?
- cphoover 8y agoSure that works... I think encapsulation through separate db schemas is generally sufficient. Most people don't start or end up here however. I'm not saying that RDBMS used correctly is a bad thing. I prefer multiple small postgres schemas per "data service" (what I'm calling a service that deals only with data persistence, and updating consumers about changes to data), each schema can correlate to a single resource, or smallest possible domain of the application. These services can publish notifications about updates that can be consumed by consuming downstream services. It's my opinion micro-services, should do one thing and do them well, and the data storage that backs these services should only be concerned with the domain of that single-purpose service. It should be isolated from all other concerns. Having a separate schema for "users" than for "messages" for example. Where to draw those dividing lines is not always easy.