Discover more from Architecture Weekly
Architecture Weekly #152 - 6th November 2023
Welcome to the new week!
Doctors Hate Her! Discover the Simple Trick to Lose Weight Overnight!
We've seen such headlines too much, aye? I noticed that we're unfortunately repeating such communication also in the Event-Driven Architecture.
I'm calling this issue the Clickbait Event.
Too often, we publish events with just the id of the record and force subscribers to query our data.
That creates a hell of a lot of issues, like coupling, chattiness, and reduced resiliency. I went through that in more detail in a recent article. As always, showing solutions and considerations when this anti-pattern can be a fair tradeoff.
The event-driven approach is asynchronous; that’s what we hear when starting with the events. But what does that even mean? And why does that matter?
It’s surprisingly hard to answer that. As always, with single-word terms, we have as many answers as people. Sam Newman went patiently on this topic, looking from different angles, e.g. communication, blocking vs non-blocking, messaging etc. I saw this talk live, and I highly recommend it.
If you’re also looking for a general introduction to Event-Driven Architecture, check out Jonas Bonér. He did a great job explaining the logical reasoning behind it instead of focusing on technical details. And this approach is also close to how I see it.
The wide-angle lens is one of my favourite tools in the software designer toolbox. The ability to zoom In and zoom out is essential in crunching the design. That gives us the possibility to start with the big picture and make an on-point evaluation of our ideas.
That's also the reason why I like tools like C4, EventStorming, etc. As they embrace that we cannot look at our software from the same place (even from the Ivory Tower, sorry).
I'm getting questions from time to time: "how to start with X/Y/Z?". Best by doing.
I accidentally found an intriguing Miro board with a self-paced workshop that can get you started and your friends with the C4 model. Nice work from IcePanel!
Sidenote, Miro and IcePanel are great for collaboration, but IMHO are not the greatest tools for keeping the model as static docs. My recommendation is to put the outcome of the workshop in the repository using tools like Mermaid, PlanUML, and Scrutcturizer and make it a source of truth near the code that we document.
Cloudflare started as a content delivery network services provider that helps you to reduce DDoS attacks. Now, they’re advancing extremely fast on making their tooling a commodity and building a cloud platform. They started with Cloudworkers, a simple serverless model running on the edge (in the CDN servers). Now, it has expanded into advanced services, still being lightweight. It’s impressive how fast they iterate, providing simple but innovative tooling.
Now, they provided a new thing: Hyperdrive. A distributed connection pool and caching for databases.
First, it maintains a set of regional database connection pools across Cloudflare’s network, so a Cloudflare Worker avoids making a fresh connection to a database on every request. Instead, the Worker can establish a connection to Hyperdrive (fast!), with Hyperdrive maintaining a pool of ready-to-go connections back to the database. Since a database can be anywhere from 30ms to (often) 300ms away over a single round-trip (let alone the seven or more you need for a new connection), having a pool of available connections dramatically reduces the latency issue that short-lived connections would otherwise suffer.
Second, it understands the difference between read (non-mutating) and write (mutating) queries and transactions, and can automatically cache your most popular read queries: which represent over 80% of most queries made to databases in typical web applications.
Read more in:
I wouldn’t say that’d always work as a global tool, but for their serverless model, it’s a great addition. As their application layer is always ephemeral, it’s fair to move the 2nd caching level outside of the runtime environment. It’s worth keeping an eye on how it evolves.
Cloudflare is also one of the proponents of the WebAssembly. I’m also. I think that’s a potential technology that can get us the common runtime environment for multiple languages. I like that it has a much better security model than containers. I think that we’re pretty close (networking and garbage collection proposals) to making it a full mainstream environment.
If you’re curious about the current state, read a decent summary:
Being an engineering manager requires a holistic view of software delivery. The first thing is to notice that it’s a sociotechnical system in which technology has to go hand-in-hand with human relations. What’s more, we need to understand our product goal. Then, somehow, manage to juggle (too often) contrary priorities and translate them to our teams.
Being a manager is about enabling others to make an impact. Sometimes, that requires defining strategy, sometimes executing product roadmap, and sometimes coaching members. That’s challenging. Also rewarding but challenging.
Check those resources to help you get a better picture of multiple things you need to take into account:
Check also other links!
p.s. I invite you to join the paid version of Architecture Weekly. It already contains the exclusive Discord channel for subscribers (and my GitHub sponsors), monthly webinars, etc. It is a vibrant space for knowledge sharing. Don’t wait to be a part of it!
p.s.2. Ukraine is still under brutal Russian invasion. A lot of Ukrainian people are hurt, without shelter and need help. You can help in various ways, for instance, directly helping refugees, spreading awareness, and putting pressure on your local government or companies. You can also support Ukraine by donating, e.g. to the Ukraine humanitarian organisation, Ambulances for Ukraine or Red Cross.