Kacper Noniewicz
← Projects

Public / Go / AGPL-3.0

Korpus

The single write boundary for my event-driven systems. Korpus validates every event against a JSON Schema before it touches the database, then persists the canonical record to Postgres.

View on GitHub →

What it does

  • Loads schemas from disk, generates tables and prepared statements automatically
  • Validates every incoming event before writing anything
  • Retries writes when child records arrive before their parents (FK-aware ordering)
  • Serves health, schema inspection, and entity query endpoints over HTTP
  • Consumes and publishes events through Redis Pub/Sub

Why I built it

Every service I ran was duplicating the same work: validating payloads, mapping them to tables, handling upserts, retrying when dependencies weren't ready yet. Korpus puts all of that in one place. You define schemas, publish events, and let Korpus deal with the durable write path.

How it works

Producer → Redis Pub/Sub → Korpus → Schema validation → Postgres

Schemas live alongside the services that own them. Korpus discovers them on startup, builds the database layer from the definitions, and keeps contracts explicit. If a payload doesn't match, it gets rejected before anything is written.

Stack

GoPostgresRedisJSON Schema

Status

I run Korpus in production for my personal infrastructure. It's stable and does what I need. Open-sourced under AGPL-3.0, with a commercial license available for proprietary use.