metacore Start a pilot

Developers · Interfaces

Subscribe to every change, at your own pace.

A domain keeps its events in one order, each for 30 days: one event for each changed record. A subscriber follows one domain in one environment, and receives the events that its grants cover.

A subscriberHow
StartsWith no cursor, at the latest event, or at the oldest one kept.
ResumesEach event comes with a cursor. Send one back to receive the events after it.
Catches upThe stream says when you have every event.
ReconnectsA stream ends after one minute. Open it again with your cursor.
Reads its writesEach event comes with a position. A read that sends it sees at least the state that the event describes.
Falls behindA cursor older than the events kept is refused. Read the records again.

The contract of a subscriber

A change of restricted fields alone reaches only the subscribers who may read one of them.

Stream

One call, and a cursor.

Events are notifications. The stored data stays the source of truth, so a subscriber that falls behind reads the records again.

The cursor joins two streams

A stream ends after one minute. Your subscriber keeps the last event’s cursor, and the next stream starts after it.

The streamWhat it guarantees
The callEventService.Subscribe, a server stream.
DeliveryAt least once, and in order for each record.
RetentionEach event is kept for 30 days.
AccessA subscriber receives the events that its grants cover.
Restricted fieldsA change of restricted fields alone reaches only the subscribers who may read one of them.
RenamesA subscriber that names an entity or a field by a former name still gets it under that name.

What a subscriber can rely on

A trigger of the schema starts a handler or a source on an event too, inside the domain.

Event

An event names a record. It carries no value.

An event tells that something happened to one record at one scope value. Whoever receives it reads the record to learn what it holds.

An event ofWhen it comes
A changeA run published. One event for each record and scope value where it changed a fact.
A rollbackEach change of the runs that it took back comes once more, marked as taken back.
A handlerYour handler emitted an event that the schema declares.
An erasureThe record is gone from the domain. Whoever kept a copy outside removes it.
A start or an endA period of a dated layer started or ended. Nothing publishes then.

What gives an event

An event of an entity that the live schema declares no more is not delivered.

FieldWhat it holds
idA UUIDv7. An event that comes twice comes with the same one.
entity keyThe record that the event names.
levelThe scope value where the facts changed.
run_idThe run that changed the record.
taken_backTrue for a change that a rollback took back.
erasedTrue once the record is gone.

Some of an event’s fields

An erasure also names the files that it dropped, so a copy outside forgets them too.

Live view

Watch the stream while you debug.

The back office follows the stream as a subscriber does, and opens it again with its cursor every minute. It shows what a subscriber or a trigger receives.

A domain’s events, as they come

Each event leads to its record and to its run. The last one tells that a rollback took a change back.

See also

Build your domain.

Declare its schema, and take it to production, self-hosted or in a managed region.

Briefing