Platform Core

Data standards

How every service stores its data: one Neon project, a schema and database role per service, and the same conventions everywhere. A service's own tables are on its product page.

Designedv1

What a service gets without building it

  • A schema and role per service; a test proves one service cannot read another's schema
  • Migrations that run before a new version serves traffic
  • PGlite for tests, with the same migrations and no network
  • UUIDv7 IDs, timestamptz, money as integer minor units plus currency, owner_id on user-owned tables
  • No foreign key between schemas: another service's record is a plain ID

How to use it

The conventions every table follows

id          uuid primary key,             -- UUIDv7
owner_id    uuid not null,                -- the user, from the access token
amount      integer not null,             -- money in minor units
currency    char(3) not null,             -- ISO 4217
status      text not null check (status in (…)),
created_at  timestamptz not null default now()

This works once the component is built.

Stories

Read the design documents

← All Platform Core components