Banking Readiness
CrateStack ships a coherent set of primitives that regulated workloads ask for out of the box. The set is opt-in — adding@@audit to a model, or wrapping
the router in IdempotencyLayer, costs nothing for services that don’t need
the guarantees.
What’s In
The current banking-grade slice covers:- duplicate-execution protection via
IdempotencyLayerbacked bySqlxIdempotencyStore(Postgres) orRedisIdempotencyStore(Redis) - optimistic concurrency via
@version+If-Match/ETaground-tripping - transactional audit log via
@@audit+cratestack_audit+ pluggableAuditSink - explicit transaction isolation via
run_in_isolated_tx+@isolation - per-principal rate limiting via
RateLimitLayer+InMemoryRateLimitStore - soft-delete via
@@soft_delete - forward-only migrations via
Migration+apply_pendingwith checksum drift detection - runtime validators (
@length,@range,@email,@regex,@uri,@iso4217) with PII-safe error messages - Decimal scalar with selectable backend (
rust_decimalorbigdecimal) - FIPS-validated TLS provider via the
crypto-aws-lc-rsworkspace feature
What’s Not
The track stops short of:- zero-downtime migration generation from schema diffs
- cluster-wide rate limiting (the shipped store is in-memory; the trait is pluggable)
- cluster-wide idempotency replication (the chosen store — Postgres primary or Redis primary — is the single source of truth; multi-region active-active needs a coordinated store plugged into the trait)
- signed audit chains / immutable WORM storage
- field-level read masking or write blocking — model-level only
- an HSM-backed signing or key-management abstraction
Adoption Order
Banks typically adopt these in the order risk dictates. A realistic path:- start with
@@auditon every mutating model — gets you the forensic trail before anything else - add
@versionto balances, ledger entries, transfers — protects against lost updates - wrap mutating routes with
IdempotencyLayer— protects against duplicate execution under client retries - switch transfer/settlement procedures to
@isolation("serializable")— closes the read-write skew window - add
RateLimitLayerper principal — caps abuse without code changes per route - switch hard delete to
@@soft_deletewhere retention rules require it - enable the FIPS provider when production keys move into a validated module
Read Next
- Idempotency for the duplicate-execution guarantee
- Optimistic locking for
@version+ ETag flow - Audit log for
@@auditand the transactional outbox - Transaction isolation for
run_in_isolated_txand the retry policy - Rate limiting for the per-principal token bucket
- Soft delete for
@@soft_deletesemantics - Migrations for the forward-only runner
- Validators for
@length,@range,@email,@regex,@uri,@iso4217 - Field attributes for
@readonly,@server_only,@pii,@sensitive,@version - Scalars for the Decimal backend selection
- Crypto for the FIPS provider toggle