4 ms·
I've used a MySQL table `event_store` with fields `uuid`, `playhead`, `payload` and `recorded_on`; works fine.
by stabbles 8y ago
I've used a MySQL table `event_store` with fields `uuid`, `playhead`, `payload` and `recorded_on`; works fine.
- root_axis 8y agoHow did you manage horizontal scaling with this approach?
- timClicks 8y agoYou could shard based on uuid, so that each shard has its set of objects that it manages. The easiest way would be to cast uuid as a 64bit unsigned int, then mod by the number of shards. If the number of shards is dynamic, then use consistent hashing.
- manigandham 8y agoIf you need total system order then that will always be your bottleneck, although you can make it very fast by scoping it to just a sequence number generator and doing the actual work in separate processes. Otherwise, most event sourcing uses different "streams" of events for different application functions, so you can shard by stream in whatever way works for you.
- remontoire 8y agoGood to know. Was thinking of this for myself in a simple usecase.