The Wonders of Software Architecture Patterns
A bird’s eye view at three popular patterns
Back when I was writing my first “Hello world!” program I assumed all software was just written in one big file. But quickly I realized this ain’t the case and a lot of it is broken down into small components that talk to each other.
When there are so many of these components it usually turns into a big mess of “dunno what is doing what and who is talking to who”. But fear not as this is where software architecture patterns come into play!
These well-defined patterns offer a template of sorts to organize your software and the different types of patterns offer different strengths and weaknesses depending on your use case. Now I am going to explain some of the most common patterns we all see in software development.
Layered Architecture
This is the oldest architecture pattern on this list and surprisingly is still the most common architecture pattern you see applications using and unfortunately not for a good reason. This pattern dates back to the 90s and was perfectly suitable for it’s time.
It involves a layered/tiered-based structure where each layer/tier handles a specific task and passes along the task to the next one until the required process is completed.
This pattern works well when you are building simple web applications but as your software gets more complex this pattern falls apart pretty quick and fails to meet a lot of requirements of modern software.
It’s also a gateway for software to end up like a monolith which if not fixed can introduce scaling, deploying and performance issues.
Microservice Architecture
If you’ve worked in the software development field for a while, you have probably heard about this architecture pattern by now — and it’s famous for a good reason!
The microservices architecture allows a large application to be broken down into small services that are isolated and call on each other to complete a process. These micro services are independent and have their own responsibilities. You might have already noticed that the microservices architecture helps break down large applications or monoliths, and is the usual route companies take when trying to get rid of their monolith software and make it more modern.
The microservices pattern is better in almost every way than the layered pattern as it makes an application easy to deploy, test, and perform better, the part where it might lack is the ease of development as coding all these services introduces a bit more complexity.
Event-driven Architecture
This is another popular pattern and its secret is that it promises to make an application highly decoupled and scalable by allowing its components to send and receive events asynchronously. This pattern works well across applications of all sizes which shows the importance of decoupling in any application.
In this pattern, there is usually an event channel or bus that transports all the events which are being sent by the various components of the application and the channel or bus is used to receive these events asynchronously. The event-driven pattern has higher scalability than the microservice pattern but lacks in ease of testing.
Well, we have now come to the end of my first blog. There is so much more to software architecture patterns and if you would like to learn more here is a good starter article.