Software architecture is the base of any application. But many people don’t know why it is important. They might think it is a waste of time. But its far from a waste of time. The time you spend on your architecture is x time multiplied saved in the future. I know that without the knowledge what software architecture is. That its also hard to know why this is important.
So what is software architecture? Well it describes all the aspects and decisions that are important to the application. This means we need to take in consideration all of the requirements, external dependencies and the communication between all the components in the system.
It’s important that your software architecture is easy to maintain. Changes should be easy to make. Especially if your application need to last for months or even years. All that time your application will need big and small changes.
Technical debt is the ability to change things. Low technical debt is good, this means there is not much extra cost and time in adding new features. But high technical debt is bad. If it gets out of control you might spend more time fixing bugs then creating new features. A good software architecture allows for the technical debt to stay low. But there is no way to remove it completely.
Every decision you make is technical debt. Deciding what framework to use adds technical debt. This is because you need to spend time and effort working with the framework. Choosing the correct framework with the lowest technical debt is a decision you need to make. Even if you don’t use a framework. Because creating your own framework is also a technical debt. And yes you can guess it, using a database is also technical debt. If you for example choose between MySQL or MariaDB, then you will need to work with the infrastructure of that database.
Then if you start coding you will be creating even more technical debt. Bad decisions when coding might hit you hard in the future. Bad decisions creates high technical debt. This is why its important to have a good software architecture and good guidelines to follow. These guidelines minimizes the bad decisions you as developer can take. Thinking before coding is important to lower the technical debt. Good and clean software that is crafted with love and good decisions has low technical debt. You will not spend much time on bugs. But you will spend many more times on creating features. I think your boss will love this, and your customers will also love it. They get great software that has few bugs and don’t become more expensive over the years.
So to have a good maintainable system you need to keep the technical debt as low as possible. But some technical debt is required to get going.
The code you create should be understandable. You should use logical domain concepts that every developer will understand. Its important that everyone knows what each feature does. That the same concepts to name certain things are used. You should try to work with the domain concepts that the users understand. There is no use in inventing new and fancy concepts where you need to explain developers and users what it means. This will cost you time and money. Mistakes will be made because of bad understanding of some concepts. Code should explain what it does. It should not require documentation to be understandable.
Flexible and scalable
A good software architecture allows for flexibility. It should be flexible to adapt to changes. It should not be hard or costly to change the business logic. We need to able to adapt. Every few years you see new design and UX trends popup. When you have a good architecture then your UI is decoupled and easy to change. So you can keep your application fresh and new. A good software architecture allows you to make it easy to upgrade to newer versions of your used framework or software.
Then scalability is also important. If you create an application which have 100 concurrent users but this later grows to 10000 concurrent users. Then your software architecture should be easy to adapt to scale to this amount of users. If your database is decoupled then you can easily switch to a more high performance database solution. If your UI and business logic is decoupled. Then you can create a more high performance UI.
There shall not be duplicate code! You need to create an architecture that does not allow for duplicate code or features. This also means good communication between developers. A good architecture will make sure no duplicate features or functionality gets created. There are guidelines and procedures to make sure there is no duplication. Every feature is created as a completely decoupled component of your architecture. This means more time is spend creating actual features!
Good architecture equals low maintenance costs and increased efficiency. There is a little more upfront cost and time. But in the long run you will win this time more then double. I hope I provided you with enough information why software architecture is important, and the next time you get an opportunity to create one. You will think about this, and you will make sure you will get the time to work out a good software architecture. I’m also glad to hear about more good reason why software architecture is important. So please let me know in the comments! And remember. Think before you code!