Repository navigation
Technology Database Generated APIs
mavrovde edited this page Nov 1, 2026
·
1 revision
Part of the Technology Evaluation. These tools generate an API directly from a database schema, promising "no custom code". This page explains why none of them is the primary design, and where some may still be useful later.
The API must provide:
- priority tiers, admission control and load shedding;
- RFC 9457 problem responses;
- the licence gate with per-row post-checks and verbatim attribution;
- a curated, domain-shaped OpenAPI 3.1 document;
- no unbounded filters on time-series data.
A generated API mirrors the database and lets callers filter and sort freely. That is exactly what the Domain Model rules out.
| Option | Verdict | Reason |
|---|---|---|
| PostgREST | Rejected as primary; viable later for internal or bulk reads | storage-shaped API, generic filters, no tiers or RFC 9457 |
| pg_featureserv | Rejected as the API; viable later as an OGC endpoint | geo-only, no keys, gate or attribution model |
| pg_tileserv | Rejected (out of scope) | vector tiles, not a data API |
| Hasura | Rejected | GraphQL is not the product; heavy |
| Supabase (self-hosted) | Rejected | a whole platform that expects to own the database |
| PostGraphile | Rejected | GraphQL, same unbounded-query risk |
- What it is. A server that turns a PostgreSQL schema of tables, views and functions into REST, with roles taken from a JWT and filtering through query parameters.
- Strengths. Almost no code; a licence gate could be expressed as grants per plan role; a role-level statement timeout is enforced on the server.
- Weaknesses. Its OpenAPI output mirrors the database and appears to be Swagger 2.0; generic filters and ordering on time-series data invite sequential scans; no priority tiers or shedding; no RFC 9457; attribution would have to be baked into every view; it exposes the shape of storage. It also needs a key-to-JWT front.
- Risk. Expensive filter combinations against a shared database.
- Licence. MIT.
- Verdict: Rejected as the primary option. Possibly useful later as an internal or bulk read path behind strict views.
- What it is. An OGC API – Features server over PostGIS that emits GeoJSON and describes itself with OpenAPI.
- Strengths. Standards-based and light.
- Weaknesses. Geo collections only; no keys, tiers, licence gate or attribution model.
- Licence. Apache-2.0.
- Verdict: Rejected as the API. Possibly a later OGC endpoint for GIS customers, behind the API's own authentication.
- A vector-tile server for PostGIS. Useful for maps, not for a REST data API.
- Licence. Apache-2.0. Verdict: Rejected for this project (out of scope); noted for map work.
- A GraphQL engine with REST wrappers; its newer major version is a different, commercially oriented architecture.
- Heavy, needs a metadata database, and GraphQL is not the product.
- Verdict: Rejected.
- A bundle of PostgreSQL, PostgREST, auth, realtime, storage, a gateway and a studio: many containers.
- It assumes it owns the database; ViaFrei already has one.
- Licence. Apache-2.0. Verdict: Rejected.
- A GraphQL server generated from a PostgreSQL schema.
- GraphQL rather than REST, with the same unbounded-query risk.
- Licence. MIT. Verdict: Rejected.
- PostgREST 13 release: https://supabase.com/blog/postgrest-13-release
- PostgREST OpenAPI output: https://postgrest.org/en/v12/references/api/openapi.html
- pg_featureserv: https://access.crunchydata.com/documentation/pg_featureserv/latest/usage/api
- pg_tileserv: https://access.crunchydata.com/documentation/pg_tileserv/latest/
- Hasura: https://hasura.io/docs/
- Supabase self-hosting: https://supabase.com/docs/guides/self-hosting
- PostGraphile: https://postgraphile.org/
ViaFrei API: a public, keyed, read-only REST API to live German mobility data. Design phase; nothing on these pages is a measurement of a running service. Data on viafrei.de and in every API answer is attributed to its publishers under their licences.
About
Design
- Domain Model
- API Design
- Architecture Overview
- Security and Access Keys
- Rate Limits and Priority
- Performance and Caching
- Configuration
- Observability
Data Model
Technical specification
-
Technical Specification
- Interface
- Scope, Conventions and References
- Protocol
- Common Envelope
- Resource Model
- Endpoints, Places
- Endpoints, Roads
- Endpoints, Energy and Parking
- Endpoints, Public Transport and Accessibility
- Endpoints, Weather Risk, Driving Rules and Composed Features
- Service Endpoints
- Errors
- Authentication and Authorisation
- Rate Limiting, Quotas and Priority
- Data Licensing and Attribution
- Compatibility and Versioning
- OpenAPI Skeleton
- Quality
- Delivery and operations
- Interface
Testing
- Testing Strategy
- Testing and Quality (design summary)
Engineering
Technology choice
- Technology Evaluation
- Architecture: Go
- Architecture: Rust
- Architecture: TypeScript
- Stack Comparison
- Benchmark Plan
Reference