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.