
Episode 116
3factor app - Reliable Eventing
Coding Blocks · Allen Underwood, Michael Outlaw, Joe Zack
September 30, 20192h 3m
Audio is streamed directly from the publisher (traffic.libsyn.com) as published in their RSS feed. Play Podcasts does not host this file. Rights-holders can request removal through the copyright & takedown page.
Show Notes
We discuss the second factor of Hasura's 3factor app, Reliable Eventing, as Allen says he still _surfs_ the Internet (but really, does he?), it's never too late for pizza according to Joe, and Michael wants to un-hear things.
This episode's full show notes can be found at https://www.codingblocks.net/episode116, just in case you're using your podcast player to read this.
Sponsors- Datadog.com/codingblocks – Sign up today for a free 14 day trial and get a free Datadog t-shirt after creating your first dashboard.
- O'Reilly Velocity Conference – Get expert insight on building and maintaining cloud native systems. Use the code BLOCKS during registration to get 20% off of most passes.
- Educative.io – Level up your coding skills, quickly and efficiently. Visit educative.io/codingblocks to get 20% off any course.
What's the first thing you do when picking up a new technology or stack?
Take the survey here: https://www.codingblocks.net/episode116. News- Thank you to everyone that left us a review:
- iTunes: !theBestCoder, guacamoly, Fishslider
- Stitcher: SpottieDog
- We have photographic evidence that we were in the same room with Beej from Complete Developer at Atlanta Code Camp.
- Don't allow for mutable state. Get rid of in memory state manipulation in APIs.
- Persist everything in atomic events.
- The event system should have the following characteristics:
- Atomic – the entire operation must succeed and be isolated from other operations.
- Reliable – events should be delivered to subscribers at least once.
- Primary benefit is simplicity when dealing with recovery. There's no custom business logic because all the event data is available for replayability.
- Due to the nature of persisting the individual event data, you have a built in audit trail, without the need for additional logging.
- Replicating the application is as simple as taking the events and replaying the business logic on top of them.
- Information isn't (instantly) queryable, not taking into account snapshotting.
- CQRS (command query responsibility segregation) helps to answer this particular problem.
- Forcing event sourcing on every part of the system introduces significant complexity where it may not be needed.
- For evolving applications, changing business needs require changes to the event schema and this can become very complex and difficult to maintain.
- Upcasting: converting an event record on the fly to reflect a newer schema. Problem with this is you've now defeated the purpose of immutable events.
- Lazy upcasting is evolving the event records over time, but that means you're now maintaining code that knows how to understand each version of the event records in the system, making it very difficult to maintain.
- Converting the entire set of data any time a schema needs to change. Keeps things in sync but at a potentially large cost of taking the hit to update everything.
- Considerations of event granularity, i.e. how many isolated events are too much and how few are not enough?
- Too many and there won't be enough information attached to the event to be meaningful and useful.
- Too few and you take a major hit on serialization/deserialization and you run the risk of not having any domain value.
- So what's the best granularity? Keep the events closely tied to the DDD intent.
- Fixing bugs in the system may be quite a bit more difficult than a simple update query in a database because events are supposed to be immutable.
- 3factor app (3factor.app)
- 3Factor Canonical App (GitHub)
- Atomic commit (Wikipedia)
- DDD & co., part 2: Semantics over CRUD (thenativeweb.io)
- Event Sourcing (martinFowler.com)
- CQRS (martinFowler.com)
- What they don't tell you about event sourcing (medium.com)
- A Practical Guide to GraphQL: From the Client Perspective (educative.io)
- Use docker system to manage your Docker environment.
- Use docker system df to see the the disk usage.
- Use docker system prune to clean up your environment.
- How To View Clipboard History On Windows 10 (AddictiveTips.com)
- Use docker-compose down -v to also remove the volumes when stopping your containers.
- Intel 660p M.2 2TB NVMe PCIe SSD (Amazon)
- Designing Data-Intensive Applications: The Big Ideas Behind Reliable, Scalable, and Maintainable Systems (Amazon)