← Previous lessonFree lesson 2 of 3 · lesson 2 of 48Next lesson →

Unlock all 48 lessons of Microservices using Java, Spring & DockerFull course ₹40,000 · paid

Price & syllabus
Free lesson · 13 min · no payment

Two-Tier, Three-Tier, SOA, Event-Driven and Microservices Compared

A free lesson from Skill-Lync's Microservices using Java, Spring & Docker course, on Grow by Skill-Lync · Last updated 16 Nov 2026 · Session: “Week 1 Session 1 Part 2”

What will you learn in this free Microservices using Java, Spring & Docker lesson?

The instructor continues the architecture survey with two-tier and three-tier designs, service-oriented architecture with a service bus, and event-driven systems such as stock or live-score apps. The lesson then describes decoupled microservices, each with its own API and database, behind an API gateway.

  • Two-tier and three-tier architectures
  • SOA, service bus and event-driven architecture
  • Independent services with separate databases
  • Role of the API gateway

What comes after lesson 2?

The next free lesson is lesson 3, “Comparing Architectures and Introducing Microservices Fundamentals” (20 min). Later in Skill-Lync's Microservices using Java, Spring & Docker course (paid): lesson 4, Week 1 Session 3; lesson 5, Week 1 Session 4; lesson 6, Week 2 Session 1. The full course has 48 lessons (18 h 7 min of video); see the course overview or its price and syllabus.

Lesson transcript

Machine transcript of the lesson audio (lightly cleaned). Technical terms may contain errors; the video is the reference.

So everything is going to be kind of managed centrally over here. So any security-related code or configuration that you do for UI, API, and data access is going to be kind of common and deployed to a single server. So kind of the management of your code and also the cross-cutting functions become easy in terms of like another tightly coupled architecture like monolithic architecture. Similarly, similar to monolithic architecture, we also have something called as NTR architecture. So what is our NTR architecture is? Let's just understand from the name itself, NTR architecture, right?

So what does our NTR architecture mean? So basically what we do in our NTR architecture is, we just break our application into logical layers and physical layers, okay? So for example, let's take a simple example. So assume that, you know, I have an application and, you know, I'll just take two common examples. So in industry, usually we have either two-tier architecture or three-tier architecture. So if you take a two-tier architecture, normally what happens is, you have this UI or the front-end part of the web application part of your code, okay?

So that is one module. And there will be a server module or the API module, which is kind of going to handle all your business logic and other transformation and server-related aspects. Both of these is going to be kind of bundled together in a server and there will be another layer, which is the database layer, which will be kind of talking to this application. So both of these would be kind of like, you know, deployed to server as a single module and your database would be sitting in a different server and these are both of these are going to talk to each other.

Why? This is also a monolithic application. As you can see, like, you know, we are tightly bundling the UI and API together along with the database, right? So this is kind of like, you know, a two-tier architecture, which is part of a entire architecture setup, right? Similarly, for a three-tier architecture, what happens is, we have three layers. So one is UI. We will be deploying UI to the UI web server. We will have the API or the web services, which will be deployed to the web service, the API server.

And finally, we will have the database, which will be deployed to the database server, right? So since we have three different layer over here, one is called the presentation layer, the second is called the application layer, the third is called the data layer, right? So if you just go back and like, you know, summarize what we learned earlier, how the application works. So we said, right, an application will have a UI, it will have a API or the web services and also it will have database.

So this three-tier just tries to logically split our application to these three logical layers, okay? And similarly, you can also have other entire architecture as well. So if you want, like based on your setup, if you think that, you know, no, I need a four-tier architecture, where maybe I will also split this application into two-part. One could be my core app and the second could be like, you know, any third-party integration, so on and so forth. So all these are kind of various approaches on how you can tackle entire architecture.

So again, in the entire architecture, in terms of management of your code, it becomes slightly difficult because like, you know, you have now multiple layers of the code to manage. But however, in the long term, in terms of management of your code or maintenance of your code, this becomes easy because you kind of now have separate layers operating from separate servers. So kind of the maintenance of the code becomes easy down the line. So the next architecture, which we are going to discuss is the loosely coupled architecture.

So what is a loosely coupled architecture is? So an example for that would be SOA or event-driven architecture. So what this means is, here in this architecture, we are not going to kind of tightly bind each of our modules to one another, but rather we are going to have them loosely coupled. So what does the word loosely coupled means is, as much as possible, say I have two modules, right, or two components of my application. I will try to bind them in such a way, they are least dependent on each other, right?

They are not strongly dependent, but they are least dependent. Meaning, if say like, you know, there are 10 things in my application component 1 and there are 10 things in my component 2. If I kind of modify four of these, like, you know, data in my component 1, this is still not going to affect my component 2. Maybe this component 2 only depends on the 6th and the 7th, kind of like, you know, the output of my component 1, which I'm not touching. Okay, so that is kind of an example of a loosely coupled architecture, where two services or two components depend on each other, but they have minimal dependencies.

Okay, an example of this is SOA and event-driven architecture. So what happens in a SOA architecture is, SOA, the full form of SOA or SOA is service-oriented architecture. So I'll just give you a high-level understanding of what is SOA. So this is kind of not, no longer used in industry, all these are kind of outdated now, after the invention of REST APIs. But it's always good to know that, you know, what are the various architectures that are involved. So what happens in a SOA architecture is, there are a few service-consumer.

A consumer is nothing but a person like you and me, or maybe another application as well, which is going to talk with our application. Right? So here, you would have our services. Okay? So services or APIs. So what is that is? So what happens is, you will have a ton of different services, which are kind of exposed. Okay? So just imagine that, you know, you are going to kind of build application for your company. So obviously, in your company, you will have multiple departments. So like, you know, you will have HR, you will have finance, you will have marketing, you will have sales, you will have software development, you will have like, you know, order and purchases, so on and so forth.

So each of this department would have or expose its own services. But what happens is, instead of directly giving them to the consumer, we will have something in between, which is called as a service bus. Okay? So the work of the service bus is to kind of act as an interface between your consumer and the services with which it is trying to interface. Okay? So what is the advantage of service-oriented architecture is, as much as possible, we are trying to reduce the dependencies between the services and also like, you know, the kind of like, you know, dependencies, which it will have with each other.

Okay? So there will be only minimal dependencies. And what happens is, all these kinds of acts on a contract. So what happens is, if a consumer is trying to consume a service, right? So they will have a contract. The consumer will expect, like now, will be sending a request in a particular XML format to the server. And the server will be responding back to the consumer in a particular XML format. So as long as this particular format is not violated, everything here will be working fine.

Okay? So before the advent of REST and microservice architecture, SOA was kind of the de facto enterprise standard, which were used earlier for developing enterprise applications. The next architecture, which we have in this series, like, you know, of loosely coupled is also called as event-driven architecture. So what happens in an event-driven architecture is, this architecture, as the name suggests, it works on events. Okay? So I'll just give you a very high-level example, just to, like, you know, make you understand how it works. Okay? So just assume that, you know, you have an, just take an example of maybe your stock brooking application, right?

Or maybe your live score application. What happens here? So whenever there is a raise in price of the stock or, like, you know, when a batsman hits a ball for some run, made some runs in a ball, it triggers an event in your system. And that event ensures that, you know, the data is getting updated in the database, right? And it, then it gets processed and gets shown on the UI. On a high level, this is what an event-driven architecture is all about. An event, like any external event, will be triggering a series of transformations in your application.

And based on that input, the data will be processed, okay? So here also what happens is, you have different components in place, each doing its own work. So here also, it is kind of loosely coupled, where, like, you know, they are not strictly coupled or tightly bound with each other. Each can be, each of these can be deployed in its own server and have its own interfaces and all. But they all are expected to, like, you know, interact following certain standard. And that is why it is called as loosely coupled, okay?

The last architecture which you're going to discuss is decoupled, okay? This is not really a strict term, because sometimes decoupled and loosely coupled are kind of, like, you know, interchangeably used, okay? So what happens, so what happens, you know, decoupled system is, you can have a bunch of services which are developed, okay? So when I mean services, what I mean? So assume that, you know, you have an application which you're going to write for, say, the HR department of your company, right? Or maybe you're developing an application for your entire company.

So each of these services can be a service for that particular department. One can be of HR, one can be of marketing, one can be of, like, you know, sales, so on and so forth. We'll also see how we have to kind of make the services down the line, where we will discuss what are the best practices and how many services we should develop and how each of the service should function, okay? So that is a separate discussion altogether, but for now, just understand that, you know, you can have a ton of different services, and each of this service will have its own infrastructure, meaning it will have its own API service, it will have its own database, okay?

This will have its own API service, it will have its own database, this will have its own service, own API service, and it will have its own database, so on and so forth. So each of these microservices would be deployed as a separate module, either in the same server or in a different server, that is up to the architect who is designing the system. But the logic is, each of these services would be independent of each other, okay? Even the databases are separate. So in this case, what happens is, even if there's a change in one of the services, the rest of the services will not be affected.

And similarly, if we have to upgrade one of these services, say, tomorrow in the HR department, there's a major change, and, you know, we want to kind of add new functionality. This can be done independently, and this can be deployed independently of other services. Whereas if you take the case of monolithic, what happens is, all the three codes are kind of tightly bound to each other. So even if you have to update a small part of one part of the application, then, Application has to be redeployed and updated and all that stuff.

But whereas over here, even one single part of the service can also be updated and independently deployed. So that is the beauty of decoupled architecture. And the prime example for this is microservice architecture, which is the focus of our course. So quickly, just to summarize, like what we have learned so far, we saw that we have tightly bound, tightly coupled architecture, we have loosely coupled architecture, and we have decoupled architecture, right? And we also saw that, you know, in tightly coupled, we saw what is a monolithic architecture, what is a NTR architecture.

In loosely coupled, we saw what is SOA service-oriented architecture and event-driven architecture. And finally, for decoupled architecture, we saw what is a microservice. So if conceptually, I have to just draw a diagram for microservice, how it will be is, so assume that, you know, this is my UI layer or my client who is consuming my application. So always remember that, you know, one more thing is, it is not always necessary that, you know, the API has to talk with UI. It can also be possible that your application can interface with another application as well.

So say, for example, when you book a flight ticket, right? So when you go to any of these sites like MakeMyTrip, ClearTrip, or Booking.com, or any of those sites, what happens is, these sites, right, when you enter their UI and enter the data, it will be going to their API server. But from this API server, internally, it will also make a call to the API server of the particular airlines, right? So say, for example, I'm booking a flight from, say, Delhi to Mumbai. So what happens is, this MakeMyTrip or any of these travel agent website will be making, internally making an API call to, say, Air India or Indigo server and fetching that detail and then showing it back to you, right?

So what I'm trying to say is, so in this case, for the Air India or the Indigo airlines, there is no UI involved here, right? So all it has is, it has a API layer and it has a database layer. And the consumer or the client for this particular system is nothing but your MakeMyTrip API server, right? So this is what I mean that, you know, it can either be a UI or can be another client API as well. So, again, just proceeding with our discussion.

So, if I have to kind of, like, you know, draw a conceptual diagram of my API architecture. So what happens is, there could be a consumer or client, which can be UI or API. It will make a call to my API gateway, okay? And from this gateway, based on the request, which is coming in, it will be routed to one of the microservices, which will have its own database. And all of these are kind of separated from one another. As I said, they are all independently deployed.

So what happens is, even if there is some changes, which I have to make to service one, I can do that independently without touching service two, three or four, okay? And again, there can be some cross-cutting concerns, like, as I said, security and all that stuff. So, which can be kind of managed as a horizontal part, okay? Don't worry, we will be discussing microservices in detail in the oncoming chapters. So, that was pretty much all about microservice for now. So, with that, we have reached to the end of this first part of the session.

Let's meet in the second part now. Thank you.

Want the rest of Microservices using Java, Spring & Docker?

Get the full course syllabus and fees.

The full course is paid (₹40,000). We'll send the syllabus and call you back within one working day.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Full course · paid

Unlock the full Microservices using Java, Spring & Docker course

The remaining 45 lessons, mentor-reviewed projects and a certificate come with the paid course (₹40,000). Leave your details: we'll send the syllabus and fees and call you back.

Get the syllabus and fees

A counsellor calls you back within one working day.

By submitting you agree to our Terms and Privacy Policy.

Grow by Skill-Lync · free lesson

Start watching

Free, no payment. Leave your details once and every free lesson on Grow plays straight away. A Skill-Lync counsellor may call you about the full Microservices using Java, Spring & Docker course.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.