Microservice Architecture - Introduction

Microservices are smaller segments of an application that run independently of each other and can be deployed in various ways. A serverless microservice is deployed within a serverless architecture.

What is a microservice?

Imagine taking an application, chopping it up into pieces, and running it as a collection of smaller parts instead of one monolithic whole. That’s basically what a microservices architecture is. Each piece of the application is called a ‘microservice,’ and it performs one service only, runs independently of the other parts of the application, operates in its environment, and stores its data. Despite the name, microservices do not have to be small. What makes them ‘micro’ is that they only handle one service and are part of a larger application.

Think of an application constructed of microservices like an American football team, where each player performs a distinct role. Still, the players form a group (the whole application) that collectively accomplishes a goal. Or, think of microservices as the different systems in the human body (circulatory, respiratory, etc.), and the application as the entire body.

From the user’s perspective, an application built with microservices has a single interface and should work like an application designed as one stack. However, behind the scenes, each microservice has its database and runs separately from the rest of the application. In addition, microservices within the same application can be written in different languages and use other libraries.

Microservices are often contrasted against monolithic architecture. Monolithic architecture is the classic way of building an application. A monolithic application is a single stack, with the user interface on top, the business logic in the middle, and the database on the bottom. Usually, a monolithic application is hosted on a specific server or set of servers. One of the downsides of constructing an application this way is that any small change to the application means the entire stack must be updated. Another downside is that if one part of the application breaks, the whole application might fail.
Advantages of microservices

Resilience: Because the application is divided up, one part of the application breaking or crashing does not necessarily affect the rest of the application

Selective scalability: Instead of scaling the entire application, only the microservices that use much can be mounted.

Easier to add or update features: Features can be rolled out or updated one at a time instead of updating the entire application stack

Flexibility for developers: Microservices can be written in different languages, and each has their libraries

Can microservices be part of a serverless architecture?
Microservices can be deployed in various ways; they can be part of a serverless architecture, hosted in containers, developed using PaaS, or, theoretically, used to build a locally hosted application. However, the advantages of building an application out of microservices are perhaps most apparent when the application is hosted in the cloud, using containers, or in a serverless architecture.

What are serverless microservices? How does a serverless microservices architecture work?
Serverless microservices are deployed within a serverless vendor’s infrastructure and only run when the application needs them. Depending on the size of a microservice, it may also be broken up into even smaller functions. To learn more about how serverless computing works, see What is Serverless Computing?

What is the difference between a microservice and a serverless function?
The tech community is still defining this distinction, but typically, a microservice is larger and can do more than a function. A function is a relatively small bit of code that performs only one action in response to an event. Depending on how developers have divided up an application, a microservice may be equivalent to a function (meaning it performs only one action) or multiple functions.

Extending the football metaphor, consider all the duties of a quarterback: throwing passes, handing the ball off to the running back, and so on. If the quarterback is like a microservice within the context of the team (providing the service of ‘quarterbacking’), then each of these smaller activities is a function. However, the line between a microservice and a function can be blurred at times, just as certain players on a football team perform only one action, like the kicker.

Nord VPN
60% off Nord VPN
Coinbase - Getty Images - 1234552839
Coinbase – Crypto Currency – Sign up with this link and get $10 free?! Buy/sell/exchange crypto, and use their ATM card to access your cash easily!
Chase Sapphire Preferred - Travel Points
NordPass - Password Manager - CJ Banner
https://www.dpbolvw.net/click-100604079-15345170
Binance Cryptowallet - Buy/Sell
Binance Blockchain
Amazon - Daily Deals
Amazon’s Daily Deals!
Your favorite restaurants are delivered to your front door! Grubhub!
Game Fly
Game Fly Video Game Rentals!

Please enter CoinGecko Free Api Key to get this plugin works.