Repository navigation
Technology Languages and Frameworks
Part of the Technology Evaluation. One section per option. Memory figures are estimates from public sources and general experience, not measurements of ours.
Current position: three candidates have full designs: Go (huma v2 on chi, pgx v5), Rust (axum, utoipa, tokio-postgres) and TypeScript (Fastify 5, zod v4, pg). Go and Rust are the owner's preferred candidates. The three are compared on Stack Comparison, which recommends Go; a benchmark decides.
| Option | Language | Verdict | One-line reason |
|---|---|---|---|
| huma v2 + chi + pgx v5 | Go | Recommended candidate | native server-side cancel, OpenAPI 3.1 and RFC 9457 from types, small footprint |
| axum + utoipa + tokio-postgres | Rust | Alternative candidate | smallest footprint and strongest compile-time guarantees; explicit cancellation and slower iteration |
Fastify 5 + zod v4 + pg
|
TypeScript | Third candidate | fastest delivery and one schema for types, validation and OpenAPI; single event loop, larger memory, hand-built server-side cancel |
| Hono | TypeScript | Viable | portable, typed; smaller server middleware set |
| NestJS | TypeScript | Rejected | heavy for an API of this size |
| Express 5 | TypeScript/JS | Rejected | no schema-driven typing |
| Echo, Gin | Go | Rejected | OpenAPI by comments, not OpenAPI 3.1 from types |
| actix-web | Rust | Rejected | its own runtime model; axum fits the tower ecosystem better |
| Spring Boot | Java/Kotlin | Rejected | memory |
| Quarkus | Java/Kotlin | Rejected | a JVM toolchain with no gain over Go |
| Ktor | Kotlin | Rejected | immature OpenAPI, small ecosystem |
| FastAPI | Python | Rejected | weaker typing, memory per worker |
| Django REST framework | Python | Rejected | ORM-centred, synchronous |
| ASP.NET Core minimal APIs | C# | Rejected | technically strong; toolchain fit only |
| Phoenix | Elixir | Rejected | dynamic typing, niche |
| Bun, Deno | runtimes | Rejected for now | different runtime from the rest of the platform; young |
-
What it is. huma generates OpenAPI 3.1 and JSON Schema from Go types and sits on a router; chi is a lightweight,
net/http-compatible router. - Fit. A very large throughput margin. pgx v5 sends a real PostgreSQL cancel request when the request context ends, which matches the 2 second rule exactly.
- Memory. Estimated 15–50 MB resident; one static binary in a small distroless image.
-
Strengths. The deadline flows through handler and driver; sqlc generates typed code from SQL checked against the contract; RFC 9457 errors are built into huma;
x/time/rateprovides a token bucket. - Weaknesses. A second language beside the platform; verbose error handling.
- Risks. huma is maintained by a small team. Mitigation: it emits standard OpenAPI and handlers are plain functions, so a move to another generator is mechanical.
- Licence. MIT (huma, chi), BSD-3 (Go).
- Verdict: Recommended candidate. Details: Architecture: Go.
- What it is. A tokio-based framework from the tokio team, built on tower middleware.
- Fit. Maximum headroom.
- Memory. Estimated 5–40 MB resident.
- Strengths. Lowest memory and latency; OpenAPI 3.1 through utoipa; the tower ecosystem for timeouts and limits; no null and no data races at compile time; exhaustive enums suit total mapping tables.
- Weaknesses. Cancellation through tokio-postgres or sqlx is explicit and documented as racy: dropping a future does not stop the server-side query, so a cancel token and the statement timeout are needed. Slower compiles. Longer compile-and-fix cycles for AI agents.
- Risks. Build times; a narrower maintainer pool for some supporting crates.
- Licence. MIT (axum).
- Verdict: Alternative candidate. Its main strength, raw throughput, is the one the API needs least; its compile-time guarantees are its real argument. Details: Architecture: Rust.
- An actor-heritage framework and a perennial leader in throughput benchmarks.
- Same trade-offs as axum, but outside the tower ecosystem that the Rust design relies on.
- Licence. MIT or Apache-2.0. Verdict: Rejected in favour of axum.
- What it is. A schema-driven Node framework with a plugin system and type providers.
- Fit. Ample throughput; the database is the limit. Same runtime as the ViaFrei platform.
- Memory. Estimated 80–130 MB resident.
- Strengths. Code-first OpenAPI 3.1 via a zod type provider; mature hooks for keys, limits and admission; plugins for ETag, compression, rate limiting and event-loop pressure; reuse of the platform's tooling.
-
Weaknesses. A single event loop, so heavy JSON must stay in the database. The node-postgres driver documents its query timeout as a client-side timeout, so real server-side cancellation needs
SET LOCAL statement_timeoutplus an explicit cancel. - Licence. MIT. Verdict: Third candidate. It scored highest on reuse in the first evaluation; without the reuse weight it ranks third on Stack Comparison. Details: Architecture: TypeScript.
- A small Web-Standards framework running on Node, Bun, Deno and edge runtimes; OpenAPI 3.1 via a zod integration.
- Portable and cleanly typed, but a smaller server-side middleware set and an extra translation layer on Node.
- Licence. MIT. Verdict: Viable, second among the TypeScript options; Fastify's first-party production plugins decide for Fastify (see Architecture: TypeScript).
- An opinionated, Angular-style framework with dependency injection and decorators.
- Estimated 120–200 MB resident; decorator-driven OpenAPI duplicates types; more code per endpoint; its abstractions hide SQL and deadline control.
- Licence. MIT. Verdict: Rejected: it costs more than it gives for an API of about twenty endpoints.
- Ubiquitous and familiar, but no schema-driven validation or serialisation; OpenAPI only through add-ons that drift from the code.
- Licence. MIT. Verdict: Rejected.
- Popular, mature, batteries included.
- OpenAPI relies on comment annotations (swaggo), which produce older OpenAPI versions and drift from the types. OpenAPI 3.1 from types is a requirement.
- Licence. MIT. Verdict: Rejected in favour of huma (which can also run on Gin through an adapter if ever needed).
- A huge ecosystem, first-class JDBC cancellation.
- On the JVM, estimated 250–500 MB resident; native images are smaller but slow and memory-hungry to build.
- Licence. Apache-2.0. Verdict: Rejected on memory footprint.
- Container-first, build-time dependency injection, the best footprint on the JVM when compiled natively.
- Native builds take minutes and a lot of memory; adds a JVM toolchain without beating Go's footprint.
- Licence. Apache-2.0. Verdict: Rejected.
- Concise, coroutine-based, with structured cancellation.
- Less mature OpenAPI generation; PostgreSQL access needs extra glue; JVM memory.
- Licence. Apache-2.0. Verdict: Rejected.
- The best OpenAPI-from-types experience; asyncpg is fast; agents know it well.
- The interpreter lock means one process per core, which multiplies memory; typing is optional rather than enforced.
- Licence. MIT. Verdict: Rejected.
- ORM-centred, a poor fit for view-only SQL, PostGIS JSON and deadline control; synchronous by default.
- Licence. BSD-3. Verdict: Rejected.
- Among the fastest stacks; built-in partitioned rate limiting; cancellation tokens throughout; strong typing; built-in OpenAPI.
- A separate toolchain with nothing shared.
- Licence. MIT. Verdict: Rejected on toolchain fit only. Technically one of the strongest options.
- Excellent concurrency and fault isolation.
- Dynamic typing; OpenAPI only through a third-party library; a niche skill set.
- Licence. MIT / Apache-2.0. Verdict: Rejected.
- Bun: fast start-up and HTTP, a built-in PostgreSQL client. Deno: native TypeScript and a permission sandbox.
- Both would differ from the platform's runtime, and both are younger, with compatibility edge cases.
- Licence. MIT. Verdict: Rejected for now.
- huma: https://huma.rocks, https://pkg.go.dev/github.com/danielgtaylor/huma/v2
- chi: https://pkg.go.dev/github.com/go-chi/chi/v5
- pgx context cancellation: https://pkg.go.dev/github.com/jackc/pgx/v5/pgconn
- axum: https://docs.rs/axum; utoipa: https://github.com/juhaku/utoipa
- tokio-postgres cancel token: https://docs.rs/tokio-postgres
- Fastify: https://fastify.dev/docs/latest/; zod type provider: https://npmjs.com/package/fastify-type-provider-zod
- Hono: https://hono.dev/docs/
- node-postgres client options: https://node-postgres.com/apis/client
- NestJS: https://docs.nestjs.com/; Express: https://expressjs.com/
- Echo: https://echo.labstack.com/; Gin: https://gin-gonic.com/; swaggo: https://github.com/swaggo/swag
- actix-web: https://actix.rs/; TechEmpower: https://www.techempower.com/blog/tag/tfb/
- Spring Boot: https://spring.io/projects/spring-boot; Quarkus: https://quarkus.io/; Ktor: https://ktor.io/docs/
- Java framework start-up benchmark: https://gillius.org/blog/2025/10/java-25-framework-startup.html
- FastAPI: https://fastapi.tiangolo.com/; Django REST framework: https://www.django-rest-framework.org/
- ASP.NET Core rate limiting: https://learn.microsoft.com/en-us/aspnet/core/performance/rate-limit
- Phoenix: https://www.phoenixframework.org/; Bun: https://bun.sh/docs; Deno: https://docs.deno.com/
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