I love working on the full stack of technologies involved with developing an application. Itās satisfying to design and implement a feature on the backend and request the data from the frontend application to render out something awesome. Itās very rewarding but it can be a long process to set everything up. Itās often a boilerplate experience and I often find myself doing a lot more devops than development.
This got me looking for alternative ways to setup servers and systems that could alleviate this need to iterate on systems rather than programs. I looked into Serverless most recently and found a pretty low-ops solution to developing applications using on-demand server responses. However, major downsides include:
- No guarantee that every change will be run exactly once (changes must be idempotent)
- Sometimes there are spin-up times required to start an instance (user must wait if they happen to be the first one requesting in a while)
- Limits to duration of request mean that the frontend needs a different way to make long-running queries against the database rather than proxying through an API endpoint
- Difficult to debug systems
These and some smaller concerns kept my search going for an alternative. Recently Iāve stumbled over Event Source Systems and fell in love with how closely its architecture resembles other patterns Iāve recently adopted. Itās a truly exciting concept and one that Iām eager to share with you.
What are Event Source Systems?
Event Source Systems are systems that record and track events in order to change local state in a purely functional way. Recording the same event given the same state should always produce the same following state. At a conceptual level this will remind developers of functional programming using stores in Redux or the Elm Programming Languageās state system.
By tracking system events in a consistent way and storing the state within local memory, this pattern has a number of advantages:
- Systems are initialized by processing the history of every event making it easy to scale out new systems and distributing these systems
- Local memory reads are much faster than reads from another server
- Server rendered applications can render faster
- Time-travel debugging is possible thanks to a complete history of every event that changed state
- Logging is free and can easily cover all important events in the system that could impact state
Project Description
Since Event Source Systems havenāt been promoted to the extent that micro-services and serverless servers have been marketed, Iām not able to work from an existing example. Instead Iāll be developing my own ideas about how to build these systems and sharing my work to iterate upon feedback and evolve my own implementation and understanding.
Iād like to build a widget for my blog that I can use to highlight recent articles, books, movies, and video games that Iāve finished recently. Think Goodreads recently read feed for everything media. I want to be able to render this feed within my About page to highlight what Iām reading. Iād also like to hookup my Twitter so that this system will post a tweet whenever I finish something new.
Iām excited to show what Iāve been working on thus far. In the next post Iāll detail how I chose my technologies to solve this problem and work through the first implementation of an event source system. Itās going to be an exciting ride!
Continue to Part 2