Skip to main content

Schema Patterns: Money, Audit, Multi-tenancy

Learning objectives
  • Store and compute money without rounding bugs, across currencies with different minor units
  • Design audit, history and temporal tables that satisfy auditors and support "as of" queries
  • Weigh soft delete against archiving and domain states
  • Implement idempotency-key and outbox tables that work inside a single transaction
  • Choose a multi-tenancy model (shared schema with RLS, schema per tenant, database per tenant) for a SaaS commerce or banking platform
  • Decide between JSONB and columns, enum types and lookup tables, UUID and bigint keys

TL;DR​

  • Money: integer minor units (bigint) or exact NUMERIC, always with a currency column. Never float/double. Minor units vary by currency (VND and JPY 0, USD 2, KWD 3).
  • Audit: append-only history written in the same transaction as the change (trigger or application), capturing who, when, what, and why. Ledgers are audit trails by construction.
  • Soft delete (deleted_at) is cheap to add and expensive to live with: every query, unique constraint and FK must account for it, and it is not erasure under data-protection law.
  • Idempotency table: UNIQUE (scope, idempotency_key) plus stored response; insert first, then do the work, in one transaction.
  • Outbox table: write the event in the same transaction as the state change; a relay or CDC publishes it.
  • Multi-tenancy: shared schema + tenant_id + row-level security scales to many small tenants; database per tenant gives the strongest isolation for few large or regulated tenants.
  • Keys: bigint identity is compact and fast; UUIDv7 gives global uniqueness with time ordering. Avoid random UUIDv4 as a clustered primary key.

Why it matters​

These patterns are where bank and e-commerce systems differ from generic CRUD apps. A float rounding error of 0.01 repeated over millions of transactions becomes a reconciliation break. A missing audit trail fails a regulator's inspection. A retried payment request without an idempotency record charges a customer twice. A multi-tenant query missing WHERE tenant_id = ? leaks one merchant's orders to another, which is a security incident, not a bug. Each pattern below is cheap to get right on day one and expensive to retrofit.

Core concepts​

Money​

Why not float. Binary floating point cannot represent 0.1 exactly; 0.1 + 0.2 is 0.30000000000000004. Sums, comparisons and rounding drift. Money must be exact.

Two correct representations:

RepresentationExampleStrengthsWeaknesses
Integer minor unitsamount_minor bigint = 1999 for USD 19.99, 150000 for VND 150,000Fast, exact, trivially portable across languages (int64 in Go)Must know each currency's exponent; sub-minor precision (FX rates, interest accrual) needs another type
Exact decimalamount numeric(19,4)Human-readable, supports sub-minor precisionSlower arithmetic; application needs a decimal library; easy to mix scales

Rules that hold for both:

  • Always store the currency next to the amount (char(3) ISO 4217 code, FK to a currency table holding minor_units). An amount without a currency is meaningless.
  • Know the exponent per currency: VND and JPY have 0 minor units, USD and EUR 2, KWD and BHD 3. Do not hard-code "divide by 100".
  • Round explicitly and once, at a defined step, with a defined mode (half-even, "banker's rounding", is common for financial calculations; card schemes and tax authorities may mandate specific rules).
  • Allocate remainders when splitting: 100,000 VND split three ways is 33,334 + 33,333 + 33,333, not three times 33,333.33.
  • FX: store the original amount and currency, the converted amount and currency, the rate (as numeric with enough precision), and the rate source and timestamp.
  • Signs: either store signed amounts (debit negative) or unsigned amounts with a direction column, but pick one and add a CHECK.
CREATE TABLE payment (
id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
amount_minor bigint NOT NULL CHECK (amount_minor > 0),
currency char(3) NOT NULL REFERENCES currency (code),
-- FX snapshot when the charge currency differs from settlement currency
settle_amount_minor bigint,
settle_currency char(3) REFERENCES currency (code),
fx_rate numeric(20, 10),
fx_rate_at timestamptz,
CHECK ((settle_currency IS NULL) = (fx_rate IS NULL))
);

In Go, keep int64 minor units in domain types, or use a decimal library (for example github.com/shopspring/decimal or github.com/cockroachdb/apd) when you need sub-minor precision. Never float64, including in JSON: serialize amounts as integers or strings.

Audit, history and temporal data​

Three different needs often get conflated:

  1. Audit trail: who changed what, when, from which channel, and why. Required by regulators and for incident forensics.
  2. History / versioning: previous states of an entity ("what was this customer's address in March?").
  3. Temporal validity: facts valid over a period ("this price is valid from Nov 28 to Dec 1", "this interest rate applies from next month"). Valid time and recorded time can differ (bitemporal data: "as of last Monday, what did we believe the rate for March was?").

Options:

ApproachHowFits
Append-only domain tablesLedger entries, order events, status transitions are inserted, never updatedMoney movements, state machines: the history is the data
Trigger-based audit tableAFTER INSERT OR UPDATE OR DELETE trigger writes old/new row as JSONB to audit_logCatch-all coverage, including manual fixes
Application audit eventsService writes audit_event with actor, reason, request id in the same transactionBusiness context (who and why) that triggers cannot see
History table per entitycustomer_history with valid_from, valid_toPoint-in-time queries on mutable master data
Range-typed validitytstzrange column + exclusion constraintPrices, rates, limits, contracts
System-versioned tablesSQL:2011 feature in SQL Server, MariaDB, Oracle (via Flashback), Db2Not native in Postgres or MySQL; use triggers or extensions

A pragmatic Postgres audit trigger:

CREATE TABLE audit_log (
id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
table_name text NOT NULL,
row_pk text NOT NULL,
op char(1) NOT NULL CHECK (op IN ('I', 'U', 'D')),
old_row jsonb,
new_row jsonb,
actor text NOT NULL DEFAULT coalesce(nullif(current_setting('app.actor', true), ''), current_user),
txid bigint NOT NULL DEFAULT txid_current(),
at timestamptz NOT NULL DEFAULT now()
);

CREATE FUNCTION audit_row() RETURNS trigger LANGUAGE plpgsql AS $$
BEGIN
INSERT INTO audit_log (table_name, row_pk, op, old_row, new_row)
VALUES (TG_TABLE_NAME,
coalesce(NEW.id, OLD.id)::text,
left(TG_OP, 1),
CASE WHEN TG_OP <> 'INSERT' THEN to_jsonb(OLD) END,
CASE WHEN TG_OP <> 'DELETE' THEN to_jsonb(NEW) END);
RETURN NULL;
END $$;

CREATE TRIGGER customer_audit AFTER INSERT OR UPDATE OR DELETE ON customer
FOR EACH ROW EXECUTE FUNCTION audit_row();

The application sets SET LOCAL app.actor = 'agent:1234' at the start of each transaction so the trigger records the human or service responsible. Make audit tables append-only by privileges: REVOKE UPDATE, DELETE ON audit_log FROM app_role. For tamper evidence, some banks chain hashes of consecutive audit rows or ship them to WORM storage. Audit data often contains personal data, so it falls under retention and erasure rules too (see Compliance).

Soft delete​

deleted_at timestamptz NULL lets you "undelete" and keeps references intact. The costs accumulate:

  • Every query must add WHERE deleted_at IS NULL; one forgotten filter shows deleted products in search or lets a deleted card be charged.
  • Unique constraints must become partial (UNIQUE … WHERE deleted_at IS NULL) or a customer cannot re-register with the same email.
  • Foreign keys still point at "deleted" rows, so the database no longer enforces "no orders for deleted products".
  • Tables and indexes keep growing with dead business data.
  • It is not deletion. A GDPR or local data-protection erasure request requires actually removing or anonymizing personal data.

Better alternatives in many cases: a domain status with meaning (account.status = 'CLOSED', product.status = 'DISCONTINUED'), which is what the business usually means; or archive on delete (move the row to customer_archive in the same transaction) when you need recovery or audit but not live references.

Idempotency key table​

Clients retry. Networks time out after the server committed. A payment API must make "same request twice" produce one effect (see Idempotency & Exactly-Once).

CREATE TABLE idempotency_key (
merchant_id bigint NOT NULL,
idem_key text NOT NULL,
request_hash bytea NOT NULL,
status text NOT NULL CHECK (status IN ('IN_PROGRESS', 'COMPLETED')),
response_code int,
response_body jsonb,
resource_id bigint,
created_at timestamptz NOT NULL DEFAULT now(),
PRIMARY KEY (merchant_id, idem_key)
);

Design notes:

  • Scope the key (per merchant or per customer) so clients cannot collide with each other.
  • Store a hash of the request to detect a reused key with a different body.
  • Same transaction as the business write whenever the work is local: then "key recorded" and "payment created" commit atomically, other transactions never observe IN_PROGRESS, and a concurrent duplicate blocks on the key's unique index until the first transaction commits or rolls back.
  • When the work involves an external call (card network), you cannot hold the transaction open: commit IN_PROGRESS first, call out with the same idempotency key downstream, then record the result; a recovery job resolves stale IN_PROGRESS rows by querying the downstream.
  • Retention: keep keys at least as long as clients may retry (often 24 hours to several days), then purge by partition or batch delete.

Outbox table​

Publishing an event to Kafka after committing to the database is a dual write: a crash in between loses the event or publishes one for a rolled-back change. The outbox writes the event in the same transaction as the state change:

CREATE TABLE outbox (
id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
aggregate_type text NOT NULL, -- 'payment'
aggregate_id text NOT NULL, -- partition key downstream
event_type text NOT NULL, -- 'PaymentCaptured'
payload jsonb NOT NULL,
headers jsonb NOT NULL DEFAULT '{}',
created_at timestamptz NOT NULL DEFAULT now(),
published_at timestamptz
);
CREATE INDEX outbox_unpublished_idx ON outbox (id) WHERE published_at IS NULL;

A relay polls with FOR UPDATE SKIP LOCKED (see Locking & Concurrency Control), or a CDC tool such as Debezium reads inserts from the WAL and you never update the row at all. Delivery is at-least-once; consumers deduplicate by event id. Full treatment in Transactional Outbox & CDC.

Multi-tenancy​

A marketplace platform hosting thousands of merchants, or a banking-as-a-service provider hosting dozens of partner banks, must isolate tenants' data.

ModelIsolationOperationsScales toChoose when
Shared schema + tenant_id (+ RLS)Logical; one bug or missing policy leaks dataOne schema to migrate, one pool, efficientHundreds of thousands of small tenantsSaaS marketplaces, many small merchants
Schema per tenantNamespace separation; same server resourcesN migrations; catalog bloat with thousands of schemas; pool per schema or search_path jugglingHundreds to low thousandsModerate tenant counts wanting easy per-tenant export/drop
Database per tenantStrong; separate backups, encryption keys, regions, maintenance windowsFleet management, N migrations, cost; cross-tenant analytics needs a pipelineTens to hundredsRegulated tenants (partner banks), data residency, very large tenants, noisy neighbors

Many platforms are hybrid: shared schema for the long tail, dedicated databases for the largest or regulated tenants, with a tenant directory deciding where each lives.

Shared schema done right in Postgres:

CREATE TABLE orders (
tenant_id bigint NOT NULL,
id bigint GENERATED ALWAYS AS IDENTITY,
customer_id bigint NOT NULL,
total_minor bigint NOT NULL,
PRIMARY KEY (tenant_id, id)
);
CREATE INDEX orders_tenant_customer_idx ON orders (tenant_id, customer_id);

ALTER TABLE orders ENABLE ROW LEVEL SECURITY;
ALTER TABLE orders FORCE ROW LEVEL SECURITY; -- apply to the table owner too

CREATE POLICY tenant_isolation ON orders
USING (tenant_id = current_setting('app.tenant_id')::bigint)
WITH CHECK (tenant_id = current_setting('app.tenant_id')::bigint);

The application runs as a role without BYPASSRLS and sets the tenant per transaction:

func WithTenant(ctx context.Context, pool *pgxpool.Pool, tenantID int64, fn func(pgx.Tx) error) error {
return pgx.BeginFunc(ctx, pool, func(tx pgx.Tx) error {
// set_config(..., true) is transaction-local, safe with PgBouncer transaction pooling.
if _, err := tx.Exec(ctx, `SELECT set_config('app.tenant_id', $1, true)`,
strconv.FormatInt(tenantID, 10)); err != nil {
return err
}
return fn(tx)
})
}

Key details: tenant_id leads every primary key and index (it is in every query and becomes the natural shard key later, see Partitioning & Sharding in Practice); superusers and roles with BYPASSRLS ignore policies, so never run the app as one; RLS predicates are added to every query, so test their performance; with current_setting('app.tenant_id') unset, the cast fails and queries error out, which is the safe failure mode. MySQL has no RLS; enforce tenant_id in a data-access layer and test for it, or use views with a session variable.

JSONB: when and when not​

Good uses: product attributes that vary by category (a TV's panel type versus a shirt's fabric), raw webhook or provider payloads kept for audit, user preferences, sparse optional metadata.

Avoid JSONB for: anything you join on, constrain, or aggregate regularly; money amounts and statuses; data updated frequently in small parts (Postgres rewrites the whole value, and large values are TOASTed); fields every query filters by.

Patterns: GIN index for containment queries (jsonb_path_ops is smaller and faster for @> only); expression index or generated column to promote a hot field (brand text GENERATED ALWAYS AS (attrs->>'brand') STORED); CHECK (jsonb_typeof(attrs) = 'object') and validation in the application against a schema per category. MySQL has a JSON type with generated-column indexing and multi-valued indexes (8.0.17+).

Enum type vs lookup table vs text with CHECK​

OptionStrengthsWeaknesses
Postgres ENUM type4 bytes, type-safe, orderedAdding values is easy (ALTER TYPE … ADD VALUE), removing is not; renaming possible since Postgres 10
MySQL ENUM columnCompactChanging the list is an ALTER TABLE; sorts by internal index, not by name
Lookup table + FKData-driven, can carry metadata (display name, is_terminal, allowed transitions), joinableOne more table and join
text + CHECK (status IN (…))Readable, easy to change by swapping the constraint (NOT VALID then VALIDATE)No metadata; constraint duplicated if used in many tables

For order and payment states, which carry rules (terminal states, allowed transitions, see Order Management & State Machines), a lookup table or text + CHECK is usually more maintainable than a native enum.

UUID vs bigint keys​

KeySizeOrderingStrengthsWeaknesses
bigint identity / sequence8 bytesMonotonic per databaseSmallest, fastest joins and indexes, human-friendly in support ticketsNeeds the database to generate; enumerable (do not expose as public IDs for sensitive resources); merging databases needs remapping
UUIDv416 bytesRandomGenerate anywhere, no coordination, unguessableRandom inserts across the whole index: page splits, poor cache locality, especially painful as an InnoDB clustered key
UUIDv7 (RFC 9562, 2024)16 bytesTime-ordered (millisecond prefix)Generate anywhere with insert locality close to bigint; sortable by creation timeLeaks creation time; still twice the size of bigint; native uuidv7() only in Postgres 18+ (generate in the app otherwise)
Snowflake-style 64-bit8 bytesTime-orderedCompact, distributed generationNeeds worker-id coordination and clock discipline (see Unique ID Generation)

A common compromise: bigint internal primary key for joins, plus a separate public identifier (UUIDv7 or a random token, unique-indexed) exposed in APIs.

Trade-offs​

DecisionOption AOption BLean towards
Money typebigint minor unitsnumericbigint for amounts; numeric for rates and accruals
AuditTrigger-basedApplication eventsBoth: triggers for coverage, application events for actor and reason
DeleteSoft delete columnStatus or archive tableDomain status or archive; soft delete only with strict query discipline
Event publishingOutbox pollingCDC on outboxPolling to start; CDC at higher volume or many tables
TenancyShared + RLSDatabase per tenantShared for many small tenants; dedicated for regulated or huge ones
Flexible attributesJSONBColumns or EAVJSONB with validation; promote hot fields to columns
Primary keybigintUUIDv7bigint within one database; UUIDv7 when IDs are generated outside it

In practice​

Idempotent payment creation in one transaction:

package payments

import (
"context"
"crypto/sha256"
"encoding/json"
"errors"
"strconv"

"github.com/jackc/pgx/v5"
"github.com/jackc/pgx/v5/pgxpool"
)

var (
ErrKeyReused = errors.New("idempotency key reused with a different request")
ErrInProgress = errors.New("request with this key is still in progress")
)

type CreatePayment struct {
MerchantID int64 `json:"merchant_id"`
AmountMinor int64 `json:"amount_minor"`
Currency string `json:"currency"`
}

type Result struct {
PaymentID int64 `json:"payment_id"`
}

func Create(ctx context.Context, pool *pgxpool.Pool, key string, req CreatePayment) (Result, error) {
body, err := json.Marshal(req)
if err != nil {
return Result{}, err
}
hash := sha256.Sum256(body)

var res Result
err = pgx.BeginFunc(ctx, pool, func(tx pgx.Tx) error {
tag, err := tx.Exec(ctx, `
INSERT INTO idempotency_key (merchant_id, idem_key, request_hash, status)
VALUES ($1, $2, $3, 'IN_PROGRESS')
ON CONFLICT DO NOTHING`, req.MerchantID, key, hash[:])
if err != nil {
return err
}
if tag.RowsAffected() == 0 {
return replay(ctx, tx, req.MerchantID, key, hash[:], &res)
}

if err := tx.QueryRow(ctx, `
INSERT INTO payment (amount_minor, currency) VALUES ($1, $2) RETURNING id`,
req.AmountMinor, req.Currency).Scan(&res.PaymentID); err != nil {
return err
}
if _, err := tx.Exec(ctx, `
INSERT INTO outbox (aggregate_type, aggregate_id, event_type, payload)
VALUES ('payment', $1, 'PaymentCreated', $2)`,
strconv.FormatInt(res.PaymentID, 10), body); err != nil {
return err
}
resp, err := json.Marshal(res)
if err != nil {
return err
}
_, err = tx.Exec(ctx, `
UPDATE idempotency_key
SET status = 'COMPLETED', response_code = 201, response_body = $3, resource_id = $4
WHERE merchant_id = $1 AND idem_key = $2`,
req.MerchantID, key, resp, res.PaymentID)
return err
})
return res, err
}

func replay(ctx context.Context, tx pgx.Tx, merchantID int64, key string, hash []byte, res *Result) error {
var storedHash []byte
var status string
var body []byte
err := tx.QueryRow(ctx, `
SELECT request_hash, status, response_body FROM idempotency_key
WHERE merchant_id = $1 AND idem_key = $2`, merchantID, key).Scan(&storedHash, &status, &body)
if err != nil {
return err
}
switch {
case string(storedHash) != string(hash):
return ErrKeyReused
case status != "COMPLETED":
return ErrInProgress
default:
return json.Unmarshal(body, res)
}
}

Because the key insert and the payment are in one transaction, a concurrent duplicate blocks on the key's unique index until the first commits, then sees the conflict and replays the stored response.

Common pitfalls​

  • float64 amounts in Go structs or JSON. Symptom: totals off by one minor unit; reconciliation breaks that nobody can explain.
  • Hard-coded "÷ 100". Symptom: VND or JPY amounts displayed 100× too small; KWD amounts rounded wrongly.
  • Audit tables the application can update. Auditors will ask who can modify the audit trail; "the app user" is the wrong answer.
  • Soft-delete filter forgotten in one query. Symptom: deleted products appear in search; deleted payment methods get charged.
  • Idempotency key recorded after the side effect. Symptom: duplicates when the process crashes between charging and recording.
  • Outbox rows never cleaned up. Symptom: the outbox table grows to billions of rows and the relay's query slows; partition by day or delete published rows in batches.
  • RLS with the app connecting as table owner or superuser. Symptom: policies silently do nothing; use FORCE ROW LEVEL SECURITY and a dedicated role.
  • SET app.tenant_id (session) behind a transaction pooler. Symptom: one request sees another tenant's data. Use SET LOCAL or set_config(…, true).
  • UUIDv4 primary keys in InnoDB at scale. Symptom: insert throughput degrades as the table outgrows the buffer pool.

Interview angle​

  • Prompts: "How do you store money?", "Design an idempotent payment API", "How do you build a multi-tenant SaaS on Postgres?", "UUID or auto-increment?", "How would you audit changes to customer data?"
  • Strong answers name the pattern, show the table, and explain the failure it prevents: double charge, rounding drift, data leak, unexplained change.
  • Show regulatory awareness: audit immutability, retention periods, erasure versus soft delete, data residency driving database-per-tenant.
  • Follow-ups: "What happens if the client retries while the first request is still running?", "How do you migrate a tenant from shared to dedicated database?", "How do you prove the audit log was not tampered with?"
  • Red flags: floats for money, "we log changes to a file", tenant isolation enforced only in the UI layer, "UUIDs are always better".

Self-check​

1. Why must amounts be stored with a currency, and why is "divide by 100" a bug?

An amount is only meaningful in a currency, and multi-currency systems (cross-border e-commerce, FX wallets) mix them in the same tables. Currencies have different minor-unit exponents: VND and JPY have none, most have two, KWD and BHD have three. Formatting and conversion must read the exponent from a currency table, not assume two decimals.

2. Compare a trigger-based audit log with application-written audit events.

Triggers capture every change regardless of code path (scripts, admin tools, other services) but only know database-level facts: old and new row, database user, time. Application events carry business context (which agent, which customer request, why) but miss changes made outside the application. Banks typically use both, and set a transaction-local actor setting so triggers record the responsible party.

3. List three costs of soft delete and one alternative.

Every query needs a deleted_at IS NULL filter and forgetting it leaks data; unique constraints must be partial; FKs keep pointing at logically deleted rows; tables grow; it does not satisfy erasure requests. Alternatives: a meaningful domain status (CLOSED, DISCONTINUED), or moving rows to an archive table in the same transaction.

4. Walk through what happens when two identical payment requests with the same idempotency key arrive at the same time.

Both try to insert the key row. The first inserts it and proceeds; the second's insert waits on the unique index entry until the first commits. After commit, the second sees a conflict (ON CONFLICT DO NOTHING affects zero rows), reads the stored row, verifies the request hash matches, and returns the stored response. If the first rolls back, the second's insert succeeds and it processes the payment itself.

5. Scenario: a BaaS platform hosts 30 partner banks, two of which require data to stay in their country, and 5,000 small fintechs. Which tenancy model?

Hybrid. The partner banks with residency and isolation requirements get dedicated databases in the required regions (separate keys, backups and maintenance windows). The long tail of fintechs share a schema with tenant_id and RLS. A tenant directory maps each tenant to its database, and tooling runs migrations across the fleet.

6. Why can random UUIDs hurt insert performance, and how does UUIDv7 help?

Random keys land on random leaf pages of the primary-key index, so inserts touch the whole index, causing page splits and requiring the entire index to be cached; in InnoDB the PK is the table itself, so rows scatter too. UUIDv7 starts with a millisecond timestamp, so new keys append near the right edge of the B-tree like a sequence, while staying globally unique without coordination.

7. When would you put data in JSONB rather than columns?

When the attributes vary by record type and are mostly read with the record (product specs per category, provider payloads, preferences), and you rarely join or constrain on them. Fields you filter, join, sum or enforce rules on belong in typed columns; if a JSONB field becomes hot, promote it to a generated column with an index.

🧠 Flashcards0/9 learned · 0 retries

Exercise​

Build an idempotent, auditable, multi-tenant payment table on Postgres 18 (for native uuidv7()).

docker run --name pg-patterns -e POSTGRES_PASSWORD=pg -p 5432:5432 -d postgres:18
docker exec -it pg-patterns psql -U postgres
  1. Create currency, payment (with tenant_id, public_id uuid DEFAULT uuidv7()), idempotency_key, outbox and audit_log with the trigger from this page.
  2. Enable RLS on payment, create a non-superuser role app (CREATE ROLE app; GRANT SELECT, INSERT ON payment TO app;), and verify with SET ROLE app; SELECT set_config('app.tenant_id', '1', false); that tenant 2's rows are invisible and that inserting a row for tenant 2 fails.
  3. Run the idempotent insert flow twice with the same key from two psql sessions concurrently (start both with BEGIN), and confirm one payment, one outbox row, and a replayable response.
  4. Insert 1 million rows keyed by gen_random_uuid() and 1 million keyed by uuidv7() in two tables; compare index sizes (\di+) and insert times.
  5. Write a query that formats amount_minor correctly for VND, USD and KWD using the currency table.

Done when every check passes, and you can explain each design choice to a reviewer.

Further reading​

  • Martin Fowler, Patterns of Enterprise Application Architecture — the Money pattern, optimistic offline lock.
  • Martin Fowler, "Temporal Patterns" and "Bitemporal History" articles on martinfowler.com.
  • Richard T. Snodgrass, Developing Time-Oriented Database Applications in SQL.
  • PostgreSQL documentation, "Row Security Policies": postgresql.org/docs/current/ddl-rowsecurity.html.
  • Stripe engineering blog, "Designing robust and predictable APIs with idempotency" (Brandur Leach).
  • RFC 9562, "Universally Unique IDentifiers (UUIDs)" (2024).
Finished this page?

Do the self-check first. Marking it complete schedules spaced reviews (1, 3, 7, 14, 30… days).