Top 1.9% dependent packages on proxy.golang.org
Top 2.1% dependent repos on proxy.golang.org
Top 7.8% forks on proxy.golang.org
proxy.golang.org : github.com/luno/reflex
Package reflex provides events (state change notifications) for mutable sql tables. It also supports streaming consumption of these events both directly locally or via gRPC. It therefore aims to provide streams of sql events similar to other database streaming features, like DynamoDB Streams, except that these events do not contain any data, but are merely pointers. Reflex events are pointers to state changes of mutable data. Events are inserted as part of sql transactions that modify the data. This ensures strong data consistency; exactly one event per state change. The EventsTable wraps a event DB table allowing insertion of events. The canonical pattern is to define an EventsTable per mutable data table. Ex. users and user_events, payments and payment_events. Note that event insertion is generally defined on the data layer, not business logic layer. The datum (data entity) referred to and state change performed on it are implied by the event source and type. Ex. An event produced by the "user service" with type "UserCreated", or an event by the "auth service" with type "APIKeyVerified". The EventsTable also provides event streams from a arbitrary point in the past. Reflex also supports exposing these event streams via gRPC. Consumers consume the event stream keeping a cursor of the last event. This ensures at-least-once data consistency. Consumers therefore need to persist their cursor. The CursorsTable wraps a DB table allowing getting and setting of cursors. The canonical pattern is to define one cursor table per service. There are two ways to consume event streams: EventTable + CursorsTable: The consumer logic has local access to both the events and consumers tables. Ex. User service sends an email on UserCreated. gRPC stream + CursorsTable: The consumer logic has access to a local CursorsTable, but requests the event stream from a remote service via gRPC. Ex. The Fraud service consumes PaymentCreated events from the payments service. It has its own DB and CursorsTable.
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/luno/reflex
License: MIT
Latest release: over 1 year ago
First release: over 2 years ago
Namespace: github.com/luno
Dependent packages: 8
Dependent repositories: 6
Stars: 42 on GitHub
Forks: 6 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 21 days ago