Event Sourcing in Go: From Zero to Production
31–40 of 55 posts
Re: Event Sourcing in Go: From Zero to Production
#32Earlier quoted context omitted.
- Write side is a Postgres INSERT - Read side is a SELECT on a Postgres view
I think you might struggle to "scale the read and write sides independently". It's a real stretch to be describing a postgres view as CQRS
You can scale them independently in that you can control the rate at which your views are read and the batch size of your updates.
The whole big win wirh CQRS is it allows for very efficient batching.
Re: Event Sourcing in Go: From Zero to Production
#33Earlier quoted context omitted.
Yes, I don't know where the misconception that CQRS or Event Sourcing automatically means eventual consistency comes from. We have built, run, evolved, and operated quite a few reasonably sized event sourced systems successfully, and these systems are running to this day without any major incidents. We added eventually consistent projections where performance justified it, fully aware of the implications, but kept mo…
I think people lump CQRS, Event Sourcing, and event-driven into this a single concept and then use those words interchangeably.
On the other hand CQRS + single writer pattern on their owncan be a massive performance win because it allows for efficient batching of views and updates. It's also much simpler to implement than a fullblown event sourcing system.
Re: Event Sourcing in Go: From Zero to Production
#34Earlier quoted context omitted.
No you can't. You can blame the endless amount of people that jump in these threads with hot takes about technologies they neither understand or have experience with. How many event sourced systems have you built? If the answer is 0, I'd have a real hard time understanding how you can even make that judgement. In fact, half of this thread can't even be bothered to look up the definition of CQRS, so the idea that "Sto…
I've not run an event sourcing system in production myself. This thread appears to have stories from several people who have though, and have credible criticisms: https://news.ycombinator.com/item?id=45962656#46014546 https://news.ycombinator.com/item?id=45962656#46013851 https://news.ycombinator.com/item?id=45962656#46014050 What's your response to the common theme that event sourcing systems are difficult to mainta…
In fact, I think most complexity I create or encounter is in response to trying to future-proof stuff I know will change.
I'm in healthcare. And it changes CONSTANTLY. Like, enormous, foundation changes yearly. But that doesn't mean there aren't portions of that domain that could benefit from event sourcing (and have long, established patterns like ADT feeds for instance).
One warning I often see supplied with event sourcing is not to base your entire system around it. Just the parts that make sense.
Blood pressure spiking, high temperature, weight loss, etc are all established concepts that could benefit from event sourcing. But that doesn't mean healthcare doesn't change or that it is a static field per se. There are certainly parts of my system that are CRUD and introducing event-sourcing would just make things complicated (like maintaining a list of pharmacies).
I think what's happening is that a lot of hype around the tech + people not understanding when to apply it is responsbile for what we're seeing, not that it's a bad pattern.
Re: Event Sourcing in Go: From Zero to Production
#35Re: Event Sourcing in Go: From Zero to Production
#36A single `events` table falls apart as the system grows, and untyped JSONB data in `event_data` column just moves the mess into code. Event payloads drift, handlers fill with branching logic, and replaying or migrating old events becomes slow and risky. The pattern promises clarity but eventually turns into a pile of conditionals trying to decode years of inconsistent data.
A simpler and more resilient approach is using the database features already built for this. Stored procedures can record both business data and audit records in a controlled way. CDC provides a clean stream for the tables that actually need downstream consumers. And even carefully designed triggers give you consistent invariants and auditability without maintaining a separate projection system that can lag or break.
Event sourcing works when the domain truly centers on events, but for most systems these database driven tools stay cleaner, cheaper, and far more predictable over time.
Re: Event Sourcing in Go: From Zero to Production
#37I don't think this design in the article works in practice. A single `events` table falls apart as the system grows, and untyped JSONB data in `event_data` column just moves the mess into code. Event payloads drift, handlers fill with branching logic, and replaying or migrating old events becomes slow and risky. The pattern promises clarity but eventually turns into a pile of conditionals trying to decode years of in…
You rarely replay them to reconstruct business state; you just pump them into analytics or enrichment pipelines.
Re: Event Sourcing in Go: From Zero to Production
#38How can you be sure that the data stuffed into JSONB fits a particular schema, and that future changes are backwards compatible with rows added long ago?
Re: Event Sourcing in Go: From Zero to Production
#39Stuffing data into JSONB columns always makes me feel uncomfortable. Not necessarily for performance/efficiency reasons. You also loose the strong schema that SQL gives you, you don't get to use constraints. You might as well use Mongo, no? How can you be sure that the data stuffed into JSONB fits a particular schema, and that future changes are backwards compatible with rows added long ago?
Re: Event Sourcing in Go: From Zero to Production
#40[flagged]
This comment just made it finally click for me why event sourcing sounds so good on paper but rarely seems to work out for real-world projects: it expects a level of correct-design-up-front which isn't realistic for most teams.
It requires a business that is willing to pay the maintenance cost of event sourcing in order to get capabilities needed capabilities (like an audit trail or replayability).