PostgreSQL Constructs to Bring it All Together
We have seen how databases, schemas, APIs, FDWs, and logical replication help us build modular and scalable data services, as well as the role of each building block. This section explains how they all play together to create a complete working system.APIs and Interfaces define how the application instances connect with the database, and how different data services – defined as PostgreSQL databases – interface with each other.
- Applications connect to the data services APIs via libpq or any other PostgreSQL access protocol. While application microservices connect to data microservices, there is no implied 1:1 relationship between them. Application instances can scale up and down rapidly, and several instances can share one data service via a connection pooler, such as PgBouncer (see Figure 4.5).
- APIs are defined using PostgreSQL's
schemaswith views, functions, and procedures. - APIs can be versioned, and the PostgreSQL
search...