A micro-services friendly architecture
The 3-tier architecture has survived for a long time. However, modern applications require increased scalability and availability. To support ever increasing demands for scale and availability new architectures have emerged. One of the emergent architectures is the 3-layer architecture.
3-layer architecture is a micro-services friendly n-tier architecture where tiers are grouped into layers. The layered groups of tiers are vitally important as they delineate both software functionality and engineering departments.
In a 3-tier application functionality is divided into 3-tiers:
Importantly, the Client tier maps to a department with three teams of front-end developers :
In 3-tier architecture, front-end developers do not run any server-side code.
Data flows in sequence from Client to Server to Database, and back again.
There are some major weaknesses with 3-tier architecture. UI development moves slowly as client-side developers have to stop and ask the server-side developers to build the required APIs and data access queries. Server-side developers are distracted from important platform work while they update server-side code to support client-side development.
Importantly, 3-tier architecture lends itself to the creation of monolithic server-side applications.
There are 3 layers in a 3-layer architecture. Each layer defines a department.
Further, each layer has multiple tiers. For example, the UI/UX layer has the client tier and a REST API tier.
Before diving into the details, let’s begin by highlighting some major differences between 3-tier and 3-layer architecture. In a 3-layer architecture:
Take a look at the data flow arrows in the diagram at the top of this post. In a 3-tier architecture data flows from Client to Server to Database and back again. However, in a 3-layer architecture data flows in multiple directions:
Why have multiple data flows? For direct data access, the UI/UX API can directly query the Data Services API without going through an intermediary. For complex algorithms the UI/UX API can access a Platform Services API which is home to algorithms. Internally, the Platform Services API may query data from the Data Services API.
Beyond APIs, the Platform Services team also develops libraries and APIs that are used by the UI/UX team and the Data Services team.
Platform Services develops and manages the overall platform that helps accelerate development for UI/UX and Data Services. A few of the utilities and libraries that Platform Services develops are:
Platform Services is often the magic behind rapid development of new applications. This magic is thanks to the myriad of production ready components that new projects can leverage to reduce the amount of new development work.
The UI/UX department is often divided into the following teams:
Platform Services can be broken into service specific teams as required. For example, a company that requires advanced algorithms can create a specialized team to develop services that expose a simplified interface to advanced algorithms and business logic.
Data Services can be broken into specialized teams that focus on one or more storage technologies. For example, a team could focus on relational databases while another focuses on Hadoop related technologies.
A “full stack” developer should be put into the context of which layer. A full stack UI/UX developer can write both client-side and server-side code. A full stack Data Services developer can write advanced queries and a REST API.
We have not yet seen an engineer who can work at production quality in all three clients (web, iOS, Android), on UI/UX APIs, on Platform Services APIs, and across the myriad of databases in use in Data Services (relational, document, wide column, etc). So, “full stack” does not really span the full stack.
3-layer architecture is an emergent architecture that provides a number of strong benefits. 3-layer architecture, or a variation, is seeing increased adoption across web properties in Silicon Valley.
3-layer architecture allows for increasingly rapid development as both UI/UX and Data Services engineers can leverage common infrastructure created by Platform Services. This architecture also decouples the various teams which enables each team to focus on its core strengths.
The use of REST APIs as a standard across layers is a perfect foundation for micro-services. Further, the use of REST APIs allows Data Services to provide a simplified interface for a myriad of storage technologies.
Overall, 3-layer architecture provides a strong technical approach as well as a means for organizing engineering teams.
We specialize in helping professional developers, like you, expand your skill set. Our courses are focused on enabling you to learn everything necessary to use a new technology in a live, production application.
All courses are made with love in
Palo Alto, CA.
Subscribe to our newsletter