CREATE TABLE event_store (id BIGSERIAL PRIMARY KEY, aggregate_id UUID NOT NULL...INSERT INTO event_store(aggregate_id,aggregate_type,event_type,event_data,vers...CREATE MATERIALIZED VIEW balance_projection AS SELECT aggregate_id AS account_...CREATE FUNCTION append_event(p_agg UUID, p_type TEXT, p_data JSONB, p_expected...CREATE TABLE event_snapshots (aggregate_id UUID PRIMARY KEY, snapshot_data JSO...SELECT * FROM event_store WHERE aggregate_id=? ORDER BY version;Meridian Ledger's traditional mutable-state banking database cannot produce a reliable audit trail, cannot replay history, and struggles with concurrent balance updates. You must migrate to a full event sourcing model: an immutable append-only event store, materialised views as read projections, a snapshot strategy for performance, and an idempotent command handler to prevent duplicate events. This is a design-heavy lab requiring deep understanding of CQRS and eventual consistency.
-- comment or REPORT statement