slayyyyer · three-repo reference system

orders-service

A Spring Boot 4 / Java 21 service with REST and GraphQL over the same domain, Flyway migrations, an idempotent write path and a transactional outbox.

What was exercised

Integration, not mocks

Testcontainers starts Postgres 16, Flyway applies the real migrations, and the tests drive the running server over HTTP — including the partial unique index that makes idempotency safe.

One domain, two transports

REST and GraphQL share services and repositories. Errors do not: REST returns RFC 9457 problem details, GraphQL returns typed errors with a code.

Deterministic demo

Seed data uses fixed UUIDs and prices, so the recordings below are reproducible rather than incidental.

Load test

A short k6 run (30s ramp, 10 VUs peak) against the same running process. The point is that the endpoints answer correctly under concurrency, not that the numbers are a benchmark.

Loading k6 summary…

Error model

FailureRESTGraphQL
Unknown customer or product404, type …/not-found, resource and iderror with extensions.code = NOT_FOUND
Invalid body or field400, type …/validation-failed, field map in errorsextensions.code = INVALID_REQUEST
Illegal status transition409, type …/conflictextensions.code = CONFLICT
Retried create with same key200 with the original order and Idempotent-Replay: truereplayed: true on the payload

Design decisions