Open erwinvaneyk opened 7 years ago
Curious if Kafka was ever considered. Seems like it would fit the bill.
5. Switch to a different database or message bus. There is no perfect solution on the market yet that contains all the required properties of the event store (fast, lightweight, persistent, reliable, scalable).
@saidimu it is indeed one of the options we looked at. However, Kafka is on the other side spectrum, containing a lot of overhead and features that are not needed for a simple, internal data store. For the main requirements of it needing to be fast and lightweight NATS seems preferable to Kafka. We are working with the NATS team to resolve some of the issues (in their codebase or this one)
That said, this is one of the parts that still needs to be improved a lot. The interface used to communicate with the data store is deliberately as simple as possible to allow for easy implementation of another data store. So, if preferred, it could be an option to add a Kafka backend as well.
The currently implemented event store was written with a limited knowledge of NATS streaming, abusing some of the features.
Currently the naieve setup consists of the following subject structure
workflow.<id>
: each subchannel contains one workflow.invocation.<id>
: each subchannel contains the activities of one workflow invocation._activity
: NATS streaming doesn't support wildcard subscriptions as of the moment of writing (see https://github.com/nats-io/nats-streaming-server/issues/340 for progress on the feature). In order to replicate the behavior of a wildcard subscription this channel is used to publish notifications of when something happens in one of the various workflow/invocation subchannels. The event store implementation has one 'metasubscriptions' on this channel that creates new subscribers when new subjects appear.Issues with this setup:
Possible solutions:
Currently, for the prototype, this is a low priority issue, as for small usage (<1000 invocations) it works just fine. Nothing is persisted yet, as fission-nats.yml deployment is still using in-memory, and can be cleared by simply restarting that deployment. So, until the prototype is advanced enough that it becomes clear what is needed from the event store, the current implementation is okay.