System Architecture: The Beginning

RP
5 min readMay 15, 2021

--

This blog post is the first part of the system architecture series. Before we start, let me clarify that I am not a system design/architecture. I am also learning along while writing this series.

Introduction

Building out the base is the most crucial step in the software development process. Think like you are building a house. You need the base strong to support the whole house. Software projects are similar to building the house.You need a solid base so there are few hiccups down the road.

Before we dive deep let’s get an overview of the software development process

An Overview of the Software Development Process

The first step of the software development process is Requirement Gathering & Analysis. This is the step where developers and software managers gather business requirements.

The next step in the process is to write down the features needed to be build and also figuring out the corner cases which might be problematic to build.

The third step is now to write down a high-level design document. And after all the information gathering and figuring out the features needed to be built, It’s time for everyone’s favourite part of the process where you pick the tech stack to build out those features.

The most basic thing in the system architecture is the concept of tiers

Different Tiers in System Architecture

Let’s start with the most obvious question

What is a Tier?

You can think of tier as a layer.

There are different numbers of tier or layer depending on the requirement of your software.

Single Tier Applications

A single-tier application is an application where the front-end, back-end and the database all reside in one place.

Typical examples are PC Games, any editing software like PhotoShop etc. You can argue that PhotoShop and other tools nowadays have become cloud based but here we are talking about older versions. Your local application you are trying to build on the localhost might also be considered as single-tier application.

So now you now what is a single-tier application let’s now discuss it’s pros and cons.

Advantage of Single Tier Applications

The main upside of such applications is they are fast and there is no lag in the communication between three components of the application.

The data also remains in the user’s machine which ensures the highest level of security (If your laptop/PC is not hacked 😀)

Disadvantage of Single Tier Applications

The biggest con of single tier application is that the company/business has no control over the application. They cannot provide the user with additional features in the future until user connect to there server manually.

The code of such applications is vulnerable to the risk of reverse engineering which can be risk to company’s authenticity.

Two Tier Applications

A two-tier application has two layers, a client and a server. The client would have user-interface and business logic in one machine. And the server woSingle Responsibility Principleuld usually contain database.

Advantage and Disadvantage of Two-Tier Applications

There is a risk of getting the business logic stolen in such so not all applications use this approach. To-do list or some sort of productivity app is an example of app which might uses such architecture. Because it wouldn’t matter if the code is stolen. But the upside of such application is fewer network calls which reduces latency.

The server will be called only when user finished some tasks and want to persist that change.

It purely depends on the company’s requirement to pick such application. If you move business logic to a dedicated server it makes it a three tier application which we are going to see next.

Three Tier Applications

As mentioned above in three tier applications user interface, business logic and database are all on different layers. And only user interface is exposed to users.

Examples of such architecture are all the simple website from blog to news website.

In such applications business has control over the logic but separating the interface, logic and database increases the latency.

No let’s discuss about our final tier application

N Tier Applications

N-tier applications have more than three components.

Example of such applications are all the social media applications, all the large scale application like Uber, Airbnb etc.

N Tier Applications are also called distributed applications.

Now you might be thinking what components are there other than interface, logic and database?

Here is the list of those components

  • Cache
  • Message Queues
  • Load Balancers
  • Search Servers for search the massive database
  • Servers to process massive amounts of data

We will cover everything in upcoming posts. So Stay tuned.

You might be wondering why so many layers?

N tier applications follow two software design principles that are Single Responsibility Principle and the Separation of Concern.

Single Responsibility Principle

Single Responsibility Principle simply means giving one responsibility to the component and let it execute that task with perfection. The responsibility could be processing data, caching the data etc.

This approach gives us a lot of flexibility and makes managing the service easier.

Let say a database server does down it won’t affect whole application, only the parts which require database will be affected.

We can separate the teams and code bases for each component making things cleaner.

Separation of Concern

Separation of concerns kind of means the same thing. Be concern about your work and stop worrying about others.

Keeping the components separate makes them reusable. This approach makes scaling the application easier in the future.

Final Note

I have mentioned to think tiers as layer but don’t confuse with the term layers of the application. Application layer typically means interface layer, business layer, service layer or the data layer. Whereas tier is a physical separation. Application Layers represent the organization of the code.

Conclusion

System designing is one of the most important part of the software development process.

There are different tiers of application:

  • Single Tier
  • Two Tier
  • Three Tier
  • N Tier

N Tier Applications follow two main software design principles

  • Single Responsibility Principle
  • Separation of Concerns.

--

--