So, What's the Best Software Architecture? 🤔
Hi there 👋
At the beginning of my career, my knowledge of software architecture was quite limited. I had no idea about most complex software architectures. It was limited to MVC/MVT architecture from tools such as Django.
However, in my first year, I had the chance to work on a real-time-oriented product, a food delivery service. That pushed me to learn more about complex architecture because it was quite challenging, and I had to work on many parts of the project.
Briefly, we were building a notification system based on Websockets in Python so riders, restaurants, and consumers could exchange information in real time. Instead of working on software architecture only at a coding level, I was introduced to it on an infrastructure level. We had to set up real-time databases, ensure latency was as low as possible, and much more.
Over the years, this led me to experiment with new ideas to learn more about other software architectures. How are they used? Why are they used? What are the pros and cons? What is the best architecture?
Strange Things I Have Noticed
The first thing I noticed is that software architectures are mostly divided into two categories: synchronous architectures and asynchronous architectures. Depending on the needs of your project, you will have to choose an architecture that fits one of these categories. Actually, you can mix both.
The second thing I noticed is that there are many bad habits regarding software architecture. A lot of companies unnecessarily over-engineer or naively under-engineer.
Two years ago, I interviewed for a company that had an interesting project they had been trying to launch for two years. To be honest, I should have stopped the interview right there. However, the project was intended to scale internationally at a certain point, and I loved the idea of leading this expansion. I hadn’t done this before, so it was definitely exciting. However, there was a big red flag. 🚩
Me: Tell me more about your architecture.
The CTO: Well, we have nine microservices right now...
Oh, please! What do you mean you have nine microservices but no official launch? Having more microservices than users is crazy to me. That was a big red flag, and I said no.
I have had this experience quite a few times when I found myself discussing projects with startups that hadn’t written a single line of code yet but were already implementing complex software architecture without even an MVP. There is no need for that.
Now, I’m not saying over-engineering or under-engineering are inherently bad. They’re not. It depends on how and when you use them. And this brings us to the question we face even today:
What Is the Best Software Architecture?
The answer is short: It depends. It depends on your software goals, requirements, users, and business needs.
How to Choose an Architecture
Before discussing an architecture, you should discuss the problem and understand it. You should understand how the business and the users interact with the software. Most importantly, you should focus on the data.
The data. The data. And the data.
By understanding how data is created, read, and updated, you can gain deep insights into what you are trying to solve by building the software. This understanding will allow you to choose or craft the correct architecture for your system. 💡
There are many resources to get started with software architecture, such as online courses, articles, and books. Still, my favorite has been Fundamentals of Software Architecture by Mark Richards and Neal Ford. (This is not a promotion, by the way!)
It’s a book that introduces the basics of software architecture, presents different architectures, and discusses them in depth. Software architecture is a vast domain, but the book does a great job of getting you halfway there if you want to learn more. The rest of the journey involves diving deeply into specific architectures, implementing them, and scaling them. 📚
I’m currently writing an article that serves as an introduction to software architecture—a 4,000-word guide to understanding the basics and exploring the most commonly used architectures. This guide will also include links to excellent resources to continue learning.