Architecture Weekly #184 - 17th June 2024
Welcome to the new week!
“Just put the load balancer in front of it and call it a day”. But is it really that simple? Was it ever “just do XYZ?“. I was preparing a new workshop recently. I wanted to show how to run Marten Async Daemon with multiple instances - essentially, I wanted to expand the general explanation from my previous article on scaling out Marten.
And of course, the 5-minute task of work appeared to be a bit longer. As I’m writing this blog, not to forget what I learned, so here it is: guidance on how to configure load balancing of ASP.NET Web Api using Nginx and Docker Compose.
(Suprisingly?) there are a few quirks around setting up IPs, ports and forwarding to make NGinx work with ASP.NET and Swagger.
In the end, once you know it, then this looks not so hard and kinda makes sense, but yeah, once you know it. Before that, it’s never “just do XYZ”.
Nowadays, we’re spammed by AI-generated visualisation from wannabe influencers. Personally, if I see such a post, it’s an instant unfollow from me. That’s a sign that I won’t get honest content from the person. Probably, that’s not a great rule, but it works well enough for me.
Yet, visualisations are a great way to teach, and I respect the effort put into them. A great example of how to do it right, making it also interactive and engaging through gamification, is what Sam Rose did in his recent article:
He showed the basic concepts around queuing, such as FIFO, LIFO, and Priority Queues, and allowed you to play with them with simple games. It's a must-see. The only thing that I’m missing there is an explanation of competing consumers, but it's still great stuff.
Check also an article by Holly Cummins where she explains how to draw when you can’t draw. Drawing graphics and pictures is one of the best notetaking methods, and it’s an extremely useful and underrated non-programming skill.
One of the most recurring themes in my conversations with my clients is the aim to use a serverless model. Actually, for them, being serverless is not the end goal. The goal is to have a pay-as-you-go model and make elastic decisions about scaling your systems.
It’s about the optionality. They want to start small and gather fast feedback from the users. They don’t want to pay for services when they’re not using them. Plus, in case they succeed, they will be able to scale immediately. Of course, the challenge is that serverless usually costs more if you have steady traffic. And quick spikes to invalidated business model can collapse the product. Still, that’s already happening.
Many popular tools are built traditionally, and they’re not always easy to scale out and use for serverless payloads. That includes tools like Kafka. Confluent is investing heavily in Kora, its cloud-native engine. And it already has competition from tools like Warp Stream. It’s an interesting practice to take the validated tooling and replace its internals. That’s not always faster to do, but already cuts you some product validation time. That’s what Warp Stream did, rewriting Kafka on top of AWS S3 using Go. Check out the story in the recent Developer Voices episode.
I’m also considering how much Emmett's storage would be possible. The biggest challenge here is the concurrency. For queueing, it’s fine to “just” push new messages to the storage, while for the event store, you need to handle more granular concurrency. S3 and likes don’t have any concurrency handling, pushing you to use some other storage as a middle-man for optimistic concurrency checks. Warp Stream uses DynamoDB for that. Plus, the blob storage is cheap if you query and update bigger data rather than consistently. Still, there are intriguing challenges and approaches that we should use in other tooling.
Still, there’s always an option to use PostgreSQL for everything, as Mike Freedman is glossing:
Some tools like Neon are already using PostgreSQL on top of S3 storage.
Fun times!
Let’s move on with some news about the Gen AI world we’re living in. You know that I’m sceptical about that, but some news is worth covering, like…
Sauron and Saruman OpenAI signed a deal with Oracle to add more horsepower to their Azure servers.
Now, the question is, what does that actually mean? OpenAI was recently a Microsoft puppy. Do they try to move some lower-priority work there (like the privacy-related projects)? OpenAI is working on the Microsoft Big Boxes preparing Chat GPT 5 and is eating the computational powers; maybe they need more or are just trying to bump the negotiation position with Microsoft? It's hard to tell at the moment; we’ll keep an eye on that.
Apple finally released their AI.
Of course, they claim that everything will be privacy-first; we’ll get an AI-based generation of Emojis. Really. We’ll also get Siri with a new brain. In the end, it looks meh, but Apple, with its user-focus capabilities, shouldn’t be ignored here.
Apple wants to train their models on the paid service content:
Users got mad, as they learned about it through the “regular privacy terms update” to the Adobe Creative Cloud. It’s a service that stores data for tools like Photoshop, etc. Paid service. We paid with our privacy for free services like Facebook, Instagram, etc. Now, we’re paying for paid services with our privacy. Yikes.
Slack shared how they modernised their codebase with GenAI, which is one of the promises of those coding tooling. They migrated their test engine for the React front end from Enzyme to the React Testing Library.
An interesting quote is here:
We streamlined the conversion process with on-demand runs, delivering results in just 2-5 minutes, as well as with CI nightly jobs that handled hundreds of files without overloading our infrastructure. The files converted in each nightly run were categorized based on their conversion status—fully converted, partially converted with 50-99% of test cases passed, partially converted with 20-49% of test cases passed, or partially converted with less than 20% of test cases passed—which allowed developers to easily identify and use the most effectively converted files.
The bold is mine. Yes, even with a pretty well-thought-through and planned process, just 20% of tests passed. Of course, the question is if it’s a small or big number. I’d also like to see how much time was spent analysing whether tests are still correct or not, as well as the time for preparation. That’d give real data if the work to make this happen wouldn’t be faster if it were done by some code fixes and manual work. Definitely, we’re not yet there where GenAI can migrate our codebase. And I doubt that we will be precisely at this point ever.
Charity Majors wrote that Gen AI won’t build engineering team:
And I agree with that, but it’s funny that this is posted on StackOverflow that just made a marriage with OpenAI.
Check also other links!
Cheers
Oskar
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.
Architecture
Sam Rose - Queueing. An interactive study of queueing strategies
📺 William Brander - Top 5 techniques for building the worst microservice system ever
📺 Developer Voices - Reimplementing Apache Kafka with Golang and S3
Amarachi Iheanacho - Data journey through the Internet - The OSI model approach
Databases
Percona - PostgreSQL 17: Two Small Improvements That Will Have a Major Impact
TimescaleDB - Fireside chat with AmazingCTO: Why use PostgreSQL for Everything?!
JavaScript
AI
Azure
Elixir
Java
.NET
Oskar Dudycz - Setting up NGINX load balancer for .NET WebApi
David Fowler - Replacing WebApplicationFactory dependencies in Aspire integration tests
Rust
Management
Industry
Oracle - OpenAI Selects Oracle Cloud Infrastructure to Extend Microsoft Azure AI Platform
Android Authority - Adobe wants to use your work to train its AI, and everyone is mad at it