To be more specific, you can add that layer of indirection in your database. Have a schema called something like "api", and only let it contain views/functions/procedures that reference one or more "real" schemas underneath. Point PostgREST at that. Now you can change your data model without breaking your API contract, and can do so transactionally which is a benefit you don't get with other indirection layers.
This is a good approach even when you do have a traditional API middleware layer, but why have more than one?
Biggest downside is many folks are SQL-shy so the middleware devs may not want to or may not be able to transition in this way.
This is a good approach even when you do have a traditional API middleware layer, but why have more than one?
Biggest downside is many folks are SQL-shy so the middleware devs may not want to or may not be able to transition in this way.