Brief Explanation about Client-Server Software Architecture Pattern, and Example
Software Architecture
Software architecture is a blueprint of an software application. Software architecture has a pattern that we can use to build an app. Software architecture pattern is general solution for common problem that happened in app development. There are 10 common software architecture that usually use by the developer :
- Layered pattern
- Client-Server pattern
- Master-Slave pattern
- Pipe-Filter pattern
- Broker pattern
- Peer-to-peer pattern
- Event-bus pattern
- Model-view-controller pattern
- Blackboard pattern
- Interpreter pattern
Client-Server Pattern
Nowadays, the most common architecture that we use to make an app is Client-Server Architecture. Client-Server architecture is an architecture which split the app into two decoupled parts, Client and Server.
Client app is used to handle the interaction between user and server. Usually client app are mobile app or web app. This app will run in user environment.
Server app is used to handle the business logic of our app. This app will handle all the requests that Client make. This app will run in isolated environment to keep the performance and the cost, because this server app always listening to the client requests all day so it needs a special environment to do it. Usually server handled many clients at the same time.
All of the interaction between Client and Server use Half Duplex TCP Connections to make a reliable connection between them.
Client-Server Communication
Usually, the communication between Client and Server is resolved by using REST (Representational State Transfer). The client will make requests to the server and server will be respond with JSON file. This JSON file contains dynamic data that regenerated by the server. Because REST has no specific contract that they use to communicate so the JSON respond may change sometimes. You can use SOAP (Simple Object Access Protocol) or RPC (Remote Procedure Call) if you want to use more strict communication contract.
Benefits & Disadvantages
An architectural pattern is a general, reusable solution to a commonly occurring problem in software architecture within a given context. Architectural patterns are similar to software design pattern but have a broader scope. Because the architecture splits our app into two parts, so we can develop each app independently and have more controls in each app that we create. We can scale Client Server or Main Server independently depend on the requirement. Each developer team can use their own language to built the app.
Until now, i don’t found any disadvantages in this architecture.
Implementation in My Project
Currently, me and my team do a project from our course, in this project, we develop a web app that use Client-Server architecture. The Client App using ReactJS and the Server App using Django. To communicate we use REST because it’s easier to implement rather than SOAP and also it’s common toAn architectural pattern is a general, reusable solution to a commonly occurring problem in software architecture within a given context. Architectural patterns are similar to software design pattern but have a broader scope. other developers. Besides that, in the Client we use reverse proxy to avoid CORS (Cross Origin Resource Sharing).
Each Client and Server is encapsulated using Docker Container. We use containerization because we want to make sure the Client and Server works well in each deployment environment.
Brief Explanation about Docker
Docker is a tool to make creation and deployment of an application more easier using containers. Containers allow us to make a complete package of our application, it will contain the libraries and the dependencies of our application. By creating the container, we can assured that our app can running in any kind of Linux machine so we don’t have to think about deployment in the server, as long as the server using Linux OS, the container will be easily deployed.
Maybe that’s all from me, hopefully this article give good information to you.