An Overview of Software Architecture — MVC, Micro-services, Client-Server, P2P, ECB, Layered/Tiered, API

Hanwen Zhang
6 min readAug 5, 2023

The software architecture of a system represents the design decisions related to overall system structure and behavior. The design goals should be set as the guidelines for design. Nonfunctional requirements usually help define design goals.

MVC: Model, View, Controller

  • The Model, the application object.
  • The View, the screen presentation.
  • The Controller, the way the user interface reacts to user input.

General MVC Flow

  1. Request received at the Browser => View sends requests to Controller
  2. Browser communicates with Controller which involves making decisions routing to appropriate action in a controller
  3. Controller action either renders a view or communicates with the Model (data/database-related)
  4. Model communicates with the database and sends back information to the Controller
  5. Controller decides when it is ready to return the result to the Browser = Controller renders on the View

Purpose of MVC

Building user interfaces for applications with structures of how the code should be organized and how the different parts of an application are separated for proper readability and debugging, which is designed to not repeat yourself.

MVC in Ruby-on-Rails

  • Model (ActiveRecord): the data and the database, the structure of data, the format, and the constraints with which it is stored
  • View (ActionView): the user interface, what is presented to the user, and what the user sees
  • Controller (ActionController): request-response handler, controls the requests of the user and then generates an appropriate response to the viewer

Java Spring Boot Architecture

Spring Boot consists of different layers and classes to process the data and logic in your backend. The four layers and their use are as follows:

Presentation/display layer: The presentation layer is responsible for interpreting JSON parameters as objects. This layer is the upper layer that is also responsible for handling authentication and HTTP requests. After accomplishing JSON translation and authentication, we will now move to the business layer.

Business layer: The business layer, as the name suggests, handles all the business logic in the application. It is composed of service classes that perform authorization and additional validation.

Persistence layer: The persistence layer is mainly responsible for storage logic that converts objects from and to database rows to insert data.

Database layer: The database layer performs Create, Read, Update, and Delete (CRUD) operations. The layer can consist of multiple databases.

Micro-services Architecture

Building many different small independent services that each do a single task and do one thing well instead of having one singular, large computing network with one code base that couples all together.

The purpose is to split large applications into much smaller pieces that exist independently of each other and break that work into more manageable, efficient batches.

For example, one server for the chat server, one for caching, one do node.js only, one do Golang for concurrent tasks, and one for the message board.

Layered Architecture

In the layered architecture, the system is divided into layers, with each layer providing a related set of services to the upper layers. Each layer does not know the upper layers and only depends on services provided by the lower layers.

There are two types of layered architectures:

  • Closed Layered Architecture (strict): each layer can only call operations from the adjacent lower layer.
  • Open Layered Architecture (relaxed): each layer can call operations from any layer below.

Tiered Architecture

The tiered architecture separates an application into multiple interconnected layers or tiers, each responsible for specific functionality, each layer into different nodes also enhances the security and performance. The number of tiers can vary, but a common division includes three tiers:

  • Presentation — user interface (UI) or client tier, is the topmost layer
  • Application — business logic or middle tier, serves as an intermediary between the presentation and data tiers
  • Data — data access or storage tier, responsible for managing and storing data

Shared Component Architecture

React is an example of using shared component architecture, React is a library for building composable user interfaces, which isn’t an MVC framework. Instead of building the same things over and over again in different places, React develops components independently, distributes each individually, and collaborates over components to build multiple projects and applications.

Client-Server Architecture

A clear distinction between clients and servers. Servers are centralized and provide services or resources to multiple clients. Clients request and use these services.

  • Server: The server hosts resources, services, or data that clients need. It waits for client requests, processes them, and provides the requested information.
  • Client: Clients are end-user devices or applications that initiate requests for services or data from the server.

P2P Architecture

P2P architecture operates in a more decentralized manner, where all nodes (peers) can act as both clients and servers, sharing resources directly with one another, all connected devices are peers. Peers communicate directly with one another, and can both request and provide resources or services to other peers.

Differences between client-server and P2P architecture

  • The servers in the client-server systems can be the bottleneck. causing the performance issues. In P2P, each peer is both a client and a server.
  • It is more challenging to ensure the security of all peers in P2P systems than the servers in the client-server systems.

The ECB Pattern

The entity-control-boundary (ECB), entity-boundary-control (EBC), or boundary-control-entity (BCE) is an architectural pattern used in use-case-driven object-oriented programming that structures the classes composing high-level object-oriented source code according to their responsibilities in the use-case realization.

  • Entity: the persistent data and logic
  • Control: the control tasks (actions)
  • Boundary: the interfaces

--

--

Hanwen Zhang

Full-Stack Software Engineer at a Healthcare Tech Company | Document My Coding Journey | Improve My Knowledge | Share Coding Concepts in a Simple Way