-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate with Fabric Event Streams #170
Comments
To investigate:
|
A discussion in the (Zalando-internal) FES chat room showed two options: a. no change in FES:
b. minimal changes to Nakadi-producer:
In both cases we'll need to think careful about the roll-out sequence, especially when changing from an existing setup. |
Trying to implement this now (variant (b)). I mostly got the FES part done, and disabling the sending out is also easy (we already got a property for that). The surprisingly difficult part is in the "do a delete after the insert": I guess we could try to use Maybe we can do the INSERT and DELETE immediately in the same statement? WITH ids AS (
INSERT INTO nakadi_producer_eventlog (....)
VALUES (...)
RETURNING id
)
DELETE FROM nakadi_producer_eventlog as el
USING ids
WHERE ids.id = el.id ... if that works (i.e. if this actually inserts and immediately deletes a row, leaving two WAL entry but nothing in the table), this could certainly be batched. |
The idea mentioned above doesn't work – the DELETE doesn't see the effects of the INSERT, so it doesn't delete anything:
(From 7.8.4. Data-Modifying Statements in WITH, emphasis mine.) Here is a list of other options to look at:
|
Background
Fabric Event Streams (FES) is a (Zalando-internal) solution (internal link) for change data capture, which (in its original and most common configuration) reads a postgresql database's write-ahead log (e.g. of an outbox table) and sends the DB changes out as Nakadi events, giving an alternative implementation of the outbox pattern implemented by this library.
FES is configured via a custom K8s resource (with some extensibility allowed via AWS lambdas).
Idea
The idea here is to allow using this library's
EventLogWriter
interface to create the eventlog entries, but then use FES to send them out (skipping the whole scheduler + Nakadi interface).Details:
Benefits
The text was updated successfully, but these errors were encountered: