DEV Community

Cover image for What is Microservice?
@educostadev
@educostadev

Posted on • Originally published at educosta.dev on

1

What is Microservice?

Microservice is an architecture style where you create or deposed a system into components. Despite the name, does not mean that the service has to be small in size. The most important thing is that each service has the following characteristics:

Single-responsibility

Each microservice should have only one responsibility, also known as bounded domain context.

Lightweight

Microservices have to be lightweight. This allows for smaller memory consumption and fast startup times.

Stateless

Not all microservices are stateless. But this is an important characteristic. As there is no state to be backed up on shutdown or activated on startup, they scale better and start faster.

Reactive

This is applicable for microservices with concurrent loads or longer response times. Using the Asynchronous communication model allows the optimal use of the resources. This results in better availability.

Externalized configuration

Externalizes the configurations in a config server. So it can be maintained per environment.

Resilient

Services should handle exceptions arising and not crash. Runtime errors, technical issues, lost of connectivity, wrong input values can and so on.

Observability

Microservices should report their usage. Statistics, the number of times they are accessed, their average response time, and so on through the HTTP API.

Versioned

Microservices may need to support versions for different clients until all clients migrate to higher versions.

Independent deployment

Each of the microservices should be deployable, without compromising the integrity of the application. It tested and deployed independently.

Bounded

A service should access the resources from its bounded context. It should not access the resources of other modules through databases. If a service needs data from others context it should do so through an internal API or service layer.

Question mark In your opinion, what other important characteristic a Microservice must have ?

The post What is Microservice? appeared first on Be Cloud Native. If you have any doubts or questions feel free to drop a comment here or reach me out on Twitter @educostadev.

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay