Search This Blog

Sunday, May 14, 2023

Microservice architecture: Design your application from scratch

Microservices architecture is a popular approach to building modern, scalable, and resilient software systems. Here are some common microservices design patterns:

In order to understand the Microservices architecture, you must first understand the following technologies

  1. 6 Microservices design principals. 
  2. Approach to Microservices.
  3. Technologies for Microservices.
  4. Moving forward and maturing Microservices Architecture. 

What is s Service ?

Okay, so let's start off this microservices introduction by first looking at what an actual service is, and we'll do this in the context of a client server architecture example, just to give you a simple example of what a service actually is. So here we have a bunch of typical client applications, applications that we use day in, day out from a website to a native mobile app to your traditional desktop application. 


And most of these types of applications send and receive data over some kind of network, like, for example, over the internet, and this data is normally sent to a backend system, a system which provides functionality and data to these client‑side applications. And this backend system will consist of some kind of service, or multiple services, which basically encapsulate the functionality and data that we need to request. And the beauty of this setup is we can have many clients, client applications, that can request the same functionality and the same data using the same interface on this type of service. 


And this service could be, in the modern sense, a type of an API where you make HTTP calls in order to retrieve data. Just like when you're browsing a website and retrieving data from some kind of backend system, you're making web HTTP calls in order to send instructions and request data and functionality from this type of backend system. 

So in microservices architecture, we feature many of these types of services, which provide data and functionality to many upstream client applications and services, like in this example. 



However, later on, you will see microservice services can actually take slightly different forms in terms of scope and communication style when compared to client server architecture services. And it's worth knowing that historically microservices architecture inherits more from an architectural style called service‑oriented architecture than it actually does from client server style architecture. 

So now that we know what an average service is, in the next section, let's start specifically looking at microservices architecture.

1. Microservices Architecture



Okay, so now that we know what services are, let's see what microservices architecture brings to the table. They Microservices architecture provide services which have an application‑level scope, meaning that they are smaller in size and have a cohesive focus. And they come in multiples with each one providing specific functionality and data to a specific part of your business. And the data itself is encapsulated behind each service. There is no central shared database. Each microservice has its own independent data storage. And one of the huge advantages from these characteristics is that each microservice is independently changeable and independently deployable. You can make a change on one microservice and deploy it without changing anything else. And as you will see later on, because these microservices talk to each other using open communication protocols, each microservice could use a different technology stack. I could have a Java‑based microservice talking to a .NET‑based microservice. And microservices also allow us to have targeted scalability and availability. Where we need performance or reliability, we can create extra instances of that service. 

Microservice architecture: Design your application from scratch

Microservices architecture is a popular approach to building modern, scalable, and resilient software systems. Here are some common microser...