Client-Server Architecture

Overall Topic

1. What is client and server architecture

2. What is scaling ( Horizontal Scaling, Vertical Scaling )

3. Pros and cons

4. Migrate client-server architecture to Cloud.

Client/server architecture is a producer/consumer computing architecture where the server acts as the producer and the client as a consumer. The server houses and provides high-end, computing-intensive services to the client on demand. These services can include application access, storage, file sharing, printer access, and/or direct access to the server’s raw computing power.

Client/server architecture works when the client computer sends a resource or process request to the server over the network connection, which is then processed and delivered to the client. A server computer can manage several clients simultaneously, whereas one client can be connected to several servers at a time, each providing a different set of services. In its simplest form, the internet is also based on client/server architecture where web servers serve many simultaneous users with website data.

From Techopedia

Client & Server Architecture Diagram v0.1

Applicable Problem

  • The client-server architecture is a useful application it separation the client and the server into two parts. It helps our system have high interoperability.

In the 2000s

In the 2000s our server must handle everything from User Interface / Business Logic / Storage.

Today

Now we separation user interface and business logic to 2 parts — the client holds the logics process for user interface and server handle for business logic.

This architecture help we can improve performance in scalability and this pattern also helps we easy to break functionality into another part and with client-server architecture design we can do it with most applicable.

So back to our story… the system works well in the years. One day amount large users use the system and the system can not handle with amount large data.

Note: Greenstone ~ 1 Milion users. (づ。◕‿‿◕。)づ

Before
After

What is Scalability

Scalability is the property of a system to handle a growing amount of work by adding resources to the system.

From Wiki

We have 2 kinds of scalability are Horizontal Scaling and Vertical Scaling.

Horizontal scaling means that you scale by adding more machines into your pool of resources whereas Vertical scaling means that you scale by adding more power (CPU, RAM, Hardisk) to an existing machine.

Vertical Scaling

So now our server we have a lot of requests to handle and we must deal with problems “Out of memory or full-disk” and vertical scaling is good for our now.

Now we can handle amount requests from 100 up to 10K users.

What happens when we have more than 100K, 1 million, even up to 10 million users use application. ( Dev in the 2000s )

Developer: Beep beep Boss our server has only one free slot RAM. now we only handle about 10K users, we need more RAM to handle for 1 Milion users.

Boss: Make an order to “Corsair Company” make a RAM (~ 160GB) for our company now

Corsair Company: … Price about $x million and delivery day: 01.01. 2030 ¯\_(ツ)_/¯

Developer: Boss let me try with another solution, we need more than one server now.

Note: Max Slot Ram in PC in the article is 2

Horizontal Scaling

The current system only handles about 100K Users. We need more servers than one to handle for a lot of users will come in this summer.

With horizontal scaling, we have two ways to work on this item.

  1. The first way we don’t need to care about the business of our system. We will buy a new machine and use it.
So our diagram will be updated as below
Client & Server Architecture Diagram v0.2

In this architecture, we need to break the application into two kinds of service.

  • Main service (Core service): Handle router and web host, management logic, configuration..etc
  • Business service (App Service): Handle business logic for application ( Ex. Statistics and report, handle the big process of application )

2. The second way we need to find out what wrong with our system. Where is leads to the death of the system?

Example: Our system we have 10 business logic however only one 2/10 business makes the system can not work with amount large users. We can break 2 business logic to the new machines.

So our diagram will be updated as below
Client & Server Architecture Diagram v0.3

In this architecture, we need to break the application into multi-part (services)

Example: Our application has 2 functionality (Report and Business ****) always work with high workload ( Consume more memory, threads, hard disk …) we will break this functionality to another service.

Main service (Core service): handle all functionality of our system and the user need to report the Core service will call Statistics and Analysis service processing — When it done the Core service only received data and send back to the client.

Developer: Boss we are successful. ̿̿ ̿̿ ̿̿ ̿’̿’\̵͇̿̿\з= ( ▀ ͜͞ʖ▀) =ε/̵͇̿̿/’̿’̿ ̿̿ ̿̿ ̿̿ . I bring to my team now and they are most powerful in the world. We can handle anything now boss.

Advantages of Client-Server Architecture:

  • Flexible: The client and server architecture is extremely flexible and can handle different types of clients. The same server can handle a wide variety of clients. So it is a flexible option.
  • Scalability: We can handle the increased power of our system from the client to the server separately beside that we also easy to scale up or scale down our application.
  • Proper Management: All data and storage at the same place, It very powerful with the back-up/recovery/migration feature.
  • Easy Maintenances: Client and server architecture is a distributed model, we can easy to replace, repair, or upgrade the server don’t worry about client remains unaffected.

Disadvantages of Client-Server Architecture:

  • Overloaded Server: When there are frequent simultaneous client requests. Our server severely gets overloaded, forming traffic connections.

Resolve: We need to add Cache Database ( Likely Redis Cache and server can reduce overloading for some scenarios )

  • Bad handle the error and lost data because since it is centralized if a critical server failed, client requests are not accomplished data is lost and downtime is can not be avoided. Therefore, client-server lacks the robustness of a good network.
  • Very expensive to install and manage the network

○ Server machines are much more powerful than standard client machines, which means that they are more expensive

○ Requires hiring employees with networking and infrastructure knowledge, in order to manage the system

Back to our story After one month After the Olympics ended and mount users use our system to go down about 1000 users.

So now my team seems not to much work to do and boss to complain about me about the cost used to design the system and now it seems no value at this time. ( We consider buy all free servers don’t need at this time ) sales of 20% ಥ_ಥ.

How to resolve all problems above?

Migrate the Application to Cloud (AWS)

In this architecture, we are using Route53/ELB to distribute your workload between AWS Regions.

CloudFront helps you to scale and distribute static content via an S3 bucket maintaining your application state so that Auto Scaling can apply horizontal scaling without loss of session data.

We auto-scaling Web Service and App Service Minimum 1 Instance and Maximum 3 Instances, and the instances auto-scaling by configuration ( CPU, Memory….)

Use Amazon Route53 DNS Service and Elastic Load Balancing to route traffic between on-premises and cloud environments to help you scale your cloud environment quickly, whenever required, and reduce it further by applying Amazon auto-scaling and placing a threshold on your traffic using Route 53.

References

https://cs.uwaterloo.ca/~m2nagapp/courses/CS446/1195/Arch_Design_Activity/ClientServer.pdf

https://docs.aws.amazon.com/whitepapers/latest/microservices-on-aws/user-interface.html

https://www.esds.co.in/blog/advantages-and-disadvantages-of-client-application-server/#sthash.Co7sd51K.dpbs

https://sites.google.com/site/clientserverarchitecture/advantages-of-client-server-architecture

https://www.leadingedgetech.co.uk/it-services/it-consultancy-services/cloud-computing/how-is-cloud-computing-different-from-traditional-it-infrastructure/#:~:text=The%20information%20and%20applications%20hosted,resources%2C%20including%20better%20computing%20power.

https://creately.com/diagram/example/ixj8h39o1/Client%20Server%20Architecture

https://www.conceptdraw.com/examples/amazon-client-server-architecture

--

--

--

I love code (▀̿Ĺ̯▀̿ ̿) — Full Stack Software Engineer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to fail in a coding interview which you can crack easily.

HDP Certified Administrator (HDPCA) Series || # 1 Adding a new node to cluster

Creating a IAM User, Creating a User Group,Assigning a Permission to a User, and Setting Up MFA.

AWS: Deployment and Service Models

Exploit Exercises — Protostar — Format String Levels

Visualizing, Designing, and Analyzing the Counting Sort Algorithm.

“Drive Magic” II.

Quake 4 Windows 10 Patch

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Kobee

Kobee

I love code (▀̿Ĺ̯▀̿ ̿) — Full Stack Software Engineer

More from Medium

Architectural Design Patterns: Microservices Architecture

Advancements in Microservices Management

The Architect, The Starter, and The Closer

System Design | What is Scalability?