The only thing constant in the universe is the change and this applies to everything, even the Software Engineering.
Software engineering not to be confused with programming/coding is a subset of computer science, where we focus on creating scalable, performant, and secure applications for the Web, Mobile, Desktop, Games, Space shuttles, or anything where the binary code runs.
Creating something like Facebook, Instagram, Gmail, Slack, Zoom, DOTA2, takes heavy engineering, they are the product of constant evolution overcoming the challenges they have faced over time.
Even though no product can be perfectly created in one instance, we can always solution the architecture or design the system upfront to have a broader picture to start with. Earlier brainstorming may result in fewer headaches later, but it is never guaranteed.
What is System Design in Software Engineering?
System design is a concept in software engineers where the software is architectured considering the product specifications.
The product specifications will mention what problem we are trying to solve, who the user base that will be using it, where the users will be located, and how these users will access the software i.e. through a Mobile app, Desktop app, Web app, etc and many more things.
Once the requirements are clear, the engineering team should discuss each point and decide on the tech stack, the server stack, and the approach they are going to use to create the product.
There are N ways to design a system as we have multiple choices for tools that solve similar problems, What we have to do is look for 2 factors.
Considering the cost while designing a system
Rather than considering the cost at the end, it should be discussed upfront, This helps to decide if you are going to use enterprise services or open-source tools for your system.
Because your product will be affecting the business the company expects its engineers to save the cost as much as possible.
One way to save the cost is to decide on which type of service you will use and how your servers are designed. The second way will be at the application level on how efficiently your code runs, minimizing the need for extra computation and thus ultimately saving the server cost.
Even though performance cannot be traded off with the cost, your approach should be focused on cost optimization.
Deciding the stack while designing a system
From operating systems to programming languages, everything affects the product and its performance. The stacks you choose should meet the requirements of your product.
- Security – No one wants their system/data to be compromised.
- Speed – A fast application on a slow system will always be considerable.
- Platform independence – You code your app once and use it on different platforms.
- Accessible – Should be usable by disabled/abled equally.
- Error Handling – It should be able to handle the error and trace the cause with proper monitoring and logging.
- Extendable – The application should be able to scale.
The whole product can be broken down in different features, and then each of this features can treated as an isolated product and designed independently using different stacks (Micro-Service architecture).
The stack affects the cost, but the priority should be on creating a resilient application even though the cost is increased.
Understanding system design with a real-life example
Let’s better understand the system design with a simple example. Consider you are running a car shop, where you sell a customized car.
The basic configuration of the car is, that it has 4 wheels and has a capacity of 4 people, it runs on gasoline, it has a steering, brake, clutch, and accelerator and it is a two-wheel drive with a 1200cc engine.
This is the basic architecture of your car, now as per the customer requirements you can update it.
Let’s say someone wants a 7-seater luxury car, you gather their requirements and then custom modify the car.
You include those features, increase the dimension of the car, and add space to accommodate extra people. As the car dimension increases, engine power should also increase, thus you replace the engine with a stronger one. With power you want better cruising experience thus you add great suspensions.
You add extra luxuries such as powerful ACs, a music system, leather seats.
Similarly, you also include the safety features, ABS, and air bags, so that in case of any mishaps, the harm can be minimized.
All these increases the cost but meets the demand, thus the cost can be overlooked, and the priority should be meeting the requirement. At the same time, costs should be monitored to increase the profit.
There could be some features that can affect the performance, which require fine-tuning from time to time and regular maintenance.
Conclusion
Design a software system is also similar, you start with a base architecture (on the MVP) and then as the product grows you keep on updating things.
There cannot be a complete replacement of the foundation at any time as it will break the whole working product, rather each big feature can be developed independently and then assembled to create a working product so that it is easier to maintain them, Also as they are independent, they can be replaced without much hustle.
That is why the system should be designed upfront to avoid the cascading failures at the later stage.
Also the system design is broken down in two parts.
- Low level design (LLD) – At the application / code level, deciding the programming stacks, folder and file structure, injections of different services, testing, security, performance, etc.
- High level design (HLD) – At the server level, configurations, backup plans, error and monitoring tools, deployment strategies, availability, reliance, etc.
From the general software engineering perspective, where there is a user-facing application (frontend) and there are services that provide data (backend) to this application, we see majorly two types of system design during the interviews.
- Frontend System Design
- Backend System Design
For now, we will be only looking at the frontend system design, later I will add the support for the backend system design as well.
Learn system design will help you to become better software engineer and also create a great product and use the best practices and principles everyday at the work. Once you have learned the concepts of system design, your perspective towards software engineering will change.