4 ms·
All this "event sourcing" stuff is fun to watch. I've been using essentially this paradigm in production for years. The difference is that I use a simple cust
by amluto 9y ago
All this "event sourcing" stuff is fun to watch. I've been using essentially this paradigm in production for years. The difference is that I use a simple custom append-only database for it. The consumer side can read, parse, and handle well over 1M events per second on a single core. Take that, Postgres. If the code wasn't such a mess, I'd open source it.
I'm a bit mystified as to why it's called event sourcing, though. Everything sources events. The difference is that this data model has everything consuming events instead of consuming state.
- _jal 9y agoNot what I do anymore so it isn't a surprise, but yeah, I was unaware this got a fancy name. In the late 90s, I built almost exactly what's described in article for a dot.com for a bulk mail delivery manager. Seemed like the obvious thing to do.
- scotu 9y agoalong the lines I know geteventstore.com and kafka are used for event sourcing as "append only" db, but anyway, it would be cool if you opensourced your system :) even if it's a mess
- sandGorgon 9y ago> If the code wasn't such a mess, I'd open source it. Those are always the best kind. Real, live, messy, production code. You should open source it. We will learn something
- Terr_ 9y ago> I'm a bit mystified as to why it's called event sourcing, though. Everything sources events. That's a bit like saying Historians know everything, since every known fact is in the past and therefore history :P I think the point is that the events are kept and can continue to be used as the primary source of truth, rather than used and discarded.
- fweespeech 9y agoI'm not sure but the term is pretty old. https://martinfowler.com/eaaDev/EventSourcing.html https://martinfowler.com/eaaDev/EventSourcing.html This is an article I have from 10+ years ago and its still roughly the same way I do it now. I've never needed to scale it beyond something like Postgres or Redis.
- fnord123 9y agoIsn't Event Sourcing the same as anything using a Write Ahead Log (WAL)? i.e. it's been around for decades.
- karmajunkie 9y agoNo, a WAL is an implementation detail of a database—you could only consider that to be ES if you're building a database. ES refers to the primacy of domain-related events as the source of truth about your application state. Your application consumes event from individual streams (events belong to one or more streams—usually one) and changes state with each event. You can think of it as a functional data pattern.
- fnord123 9y ago>you could only consider that to be ES if you're building a database. I poke around in the guts of databases, so that's what I meant. The WAL is ES in the context of databases. So I guess ES is the generalization/abstraction(?).
- tomnipotent 9y agoProbably more appropriate to think of ES as relying on a WAL for managing an ordered event stream. When getting the current state of a business object e.g. "SELECT * FROM table WHERE pk=313", you would replay the event log to get current state and discard it when you're done. Mutation is only done by adding an event to the stream. It's not uncommon to see RDBMS's still used to improve read performance (but not as a source of truth, just a cache with SQL).
- thinkMOAR 9y agoI sort of missed this in the bit, volume numbers and query times.