What if your app had a Git history? | Issue #80


Hi there,

Most apps only store the final result: the current balance, the current inventory, the current status.

But what if you could track every change that led to that result?

That’s exactly what the event sourcing pattern allows you to do. Instead of overwriting state, you store a sequence of immutable events and derive the current state by replaying them. It’s like Git (kinda), but for your domain logic.

In this week’s video, I show you how to implement event sourcing in Python from scratch:

  • We start with a simple string-based inventory system
  • Add caching to avoid replaying events unnecessarily
  • And build projections like “most collected item” or “where items came from”

I also explain how this pattern compares to blockchain and Git, and when it’s the right (or wrong) tool for your project.


Have a great weekend!

Cheers,

Arjan


Do you enjoy my content on YouTube and would you like to dive in deeper?

🚀 Check out my online courses

My courses have helped thousands of developers take the next step in their careers. Check out these courses to help grow your skills and become a senior developer:

👕 Clean code and clean clothes

The ArjanCodes merch store features T-shirts, hoodies, hats, and more for the clean-code-obsessed. Careful though: you'll look dangerously professional while reviewing PRs.

👉 Check out the store here and grab something before your stand-up call starts.

Unsubscribe | Send by ArjanCodes

Wolvenplein 25, Utrecht, UT 3512 CK

The Friday Loop

Every Friday, you'll get a recap of the most important and exciting Python and coding news. The Friday Loop also keeps everyone posted on new ArjanCodes courses and any limited offers coming up.

Read more from The Friday Loop

AI can write code now. But you already knew that :). If you’ve tried using AI seriously, you’ve probably noticed something: the code works (kind of) and then slowly turns into a mess. In this week’s video, I show why prompting alone isn’t enough and why software design is becoming more important, not less, in an AI-driven world. I walk through a real interaction with an AI coding assistant and show how thinking in terms of responsibilities, structure, and system boundaries completely changes...

In a recent video on refactoring complicated business logic, I managed to introduce several subtle errors. Many of you immediately spotted them in the comments. That’s exactly what my first video in 2026 is about. I walk through the mistakes I made, explain why they happened, and show how easy it is to accidentally change behavior when you refactor code. Even with tests in place and decent coverage, assumptions can sneak in, business rules can shift, and logic can quietly break without anyone...

You’ve tested the endpoint. The response looks right. No errors in the terminal. So you’re done, right? Well... not quite. In the last video of this year (time flies!) I start with a tiny FastAPI app that "works", and step by step, I turn it into something that’s actually ready for production (and that's more work than you think). That includes: Proper type usage Input validation and error handling Configuration management Rate limiting to prevent abuse ...and more! All using a real example:...