Serve
Keep operational state current and ready to use.
Tapstate writes or materializes transformed records, keeps the resulting state current, and makes it available through push and pull mechanisms.
Transform Output
balance
→ 1280
tier
→ premium
last_order_id
→ o-891
Current Operational State
CUSTOMER · c-104
- status
- active
- balance
- 1280
- tier
- premium
- last_order_id
- o-891
- region
- APAC
- renewal
- due
Pull
Read current state when needed
c-104
active · premium
balance 1280
Push
Deliver supported changes
balance: 1280
Maintained State
Each change advances the same current state.
Serve applies accepted changes to the maintained record, so downstream systems can use the latest representation without reconstructing it from event history.
T0 · INITIAL STATE
CUSTOMER · c-104
- status
- active
- balance
- 960
- tier
- standard
T1 · BALANCE
balance
960→1280
T2 · TIER
tier
standard→premium
T3 · RENEWAL
renewal
none→due
NOW
CURRENT STATE
CUSTOMER · c-104
- status
- active
- balance
- 1280
- tier
- premium
- renewal
- due
Push + Pull
One maintained state. Two ways to consume it.
Consumers can read the current representation when needed or receive supported changes as the state advances.
PULL · CURRENT SNAPSHOT
CUSTOMER · c-104
active · premium
balance: 1280
Read current state when needed
SHARED CURRENT STATE
CUSTOMER · c-104
status
active
balance
1280
SUPPORTED CHANGE · 960 → 1280
tier
premium
renewal
due
PUSH · CHANGE DELIVERY
balance: 1280
Declared Delivery
Make delivery behavior part of the pipeline contract.
Declare structured target writes and event-stream delivery alongside the source and transforms that produce them.
version: tapstate/v1
kind: pipeline
id: customer-state
source: commerce-cdc
transforms:
- name: active-only
filter: "record.status == 'active'"
- name: normalize-id
rename:
customer_id: id
sync:
- source: customers
target:
collection: customer_state
options:
write_mode: upsert
ddl: apply
auto_create_table: true
push:
- source: customers
topic: customer-state-changes
format: tapstateDELIVERY CONTRACT
source
customers
target
customer_state
write mode
upsert
schema behavior
apply DDL
Maintain the latest structured record in target storage.
source
customers
topic
customer-state-changes
format
tapstate
Publish supported changes as an event stream.
Current State + History
Current state and history answer different questions.
Serve keeps the latest consumer-facing result ready for operational use. Retain approved history separately when you need audit, replay, or analysis.
WHAT CHANGED OVER TIME
Audit · Replay · Analysis
09:00
balance 960
tier standard
09:18
balance 1280
09:31
tier premium
09:42
renewal due
WHAT IS TRUE NOW
Operational use · Key lookup
CUSTOMER · c-104
Use the maintained current state for operations, and retain history where audit or analysis requires it.
Put maintained state to work.
Write current records to target storage or publish supported changes as an event stream.