Understanding Microservice Architecture: Principles, Characteristics, and Deployment
The article explains microservice architecture as a lightweight, service‑oriented approach where each service performs a single, well‑defined function, runs in its own process with an independent database, can be deployed separately on various platforms, and communicates via HTTP or other lightweight protocols, highlighting its key characteristics and benefits.
Microservices have a single, highly specialized function and expose it through remote APIs. For example, in a warehouse management system a microservice might handle receiving inventory, calculating storage locations, routing items within the warehouse, assigning routes to staff, receiving orders, computing picking routes, and assigning those routes.
Each microservice runs in its own thread, can be deployed independently, and maintains its own dedicated database while still collaborating with other services.
Different microservices may be implemented on various platforms such as .NET, Erlang, or Node.js; as long as they can communicate, typically via HTTP, they function together. Other communication options include message queues, service buses, or binary protocols like Thrift.
Continuing the warehouse example, a "picking‑route assignment" microservice receives a request from another service that has computed the optimal route, searches its database for a suitable route, and returns that route to the calling service.
What is microservice architecture?
Microservice architecture is a lightweight, service‑oriented style where each service focuses on doing one thing well.
Systems built with microservices consist of many coordinated services, each running its own process. Services interact through platform‑agnostic lightweight media such as HTTP, queues, buses, or binary protocols.
When building and maintaining complex server‑side software, microservice architecture has become popular because it offers flexibility, scalability, resilience, and rapid deployment from development to production.
Microservice characteristics
1. Responsible for a single function
2. Independently deployable
3. Consists of one or more processes
4. Owns its data storage
5. Can be maintained by a small team
6. Replaceable
Single responsibility
A microservice should implement exactly one business capability, adhering to the Single Responsibility Principle; it changes only when that capability changes.
Independent deployment
Each microservice can be updated and deployed without affecting other services, enabling low‑risk, rolling deployments and continuous operation of the rest of the system.
One or more processes
A microservice may contain multiple processes, such as an application process and a dedicated database process, to fully implement its functionality.
Own data storage
Each service owns its database, allowing it to choose the most suitable storage technology (SQL, Redis, Elasticsearch, etc.) without exposing the implementation to other services.
Small‑team maintenance
A microservice should be small enough that a team of about five people can maintain it, handling development, scaling, monitoring, and bug fixing.
Replaceable
If a microservice grows too large or becomes difficult to maintain, it should be possible to rewrite it from scratch within a reasonable timeframe without disrupting the overall system.
Art of Distributed System Architecture Design
Introductions to large-scale distributed system architectures; insights and knowledge sharing on large-scale internet system architecture; front-end web architecture overviews; practical tips and experiences with PHP, JavaScript, Erlang, C/C++ and other languages in large-scale internet system development.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.