Conclusion
In this chapter, we showed how microservices can be used to create modular architectures that are highly scalable and support agile development.By using the database as the core construct for modularization, the schema to define the API, and logical replication in combination with Foreign Data Wrappers to allow for cross-service communication, we can create highly flexible microservices. Logical replication helps us share reference data and create referential integrity in a distributed system. The same technology can then be used to reaggregate all the data into a central source of truth for analytics and AI.Besides scalability and transactional integrity, security is the other must-have. Using the Authentication, Authorization, Auditing (AAA) methodology, we laid out a clear path for how to use PostgreSQL's hierarchical roles that works in conjunction with the built-in privilege system to create a secure environment that implements the principle of least privilege and...