What are Microservices

What are Microservices?

A microservice architecture builds one application as a set of small, independent services. Each service does one business job, runs in its own process, owns its own data, and talks to other services over the network (usually HTTP/JSON or messages).

  • Small and focused: one service = one business capability (products, orders, payments...).
  • Independently deployable: you can release the Order service without touching the Product service.
  • Owns its data: each service has its own database; no other service reads its tables directly.
  • Talks over the network: REST calls, gRPC, or events through Kafka/RabbitMQ.
  • Owned by one team: the team that builds it also runs it ("you build it, you run it").

A Simple Picture

Instead of one big application, ShopEase becomes several small applications. The browser or mobile app talks to them (later through an API Gateway):

React / Android app
                   |
     +-------------+--------------+
     |             |              |
     v             v              v
+---------+  +-----------+  +-----------+
| Product |  |   Order   |  |   User    |
| Service |  |  Service  |  |  Service  |
|  :8081  |  |   :8082   |  |   :8083   |
+----+----+  +-----+-----+  +-----+-----+
     |             |              |
 product_db     order_db       user_db

Key Words You Will Hear

TermMeaning
ServiceA small, independently running application with one business job
InstanceOne running copy of a service; a service can have many instances
API contractThe agreed request/response format a service exposes
Service discoveryHow a service finds the address of another service (medium level)
API GatewayThe single entry point that routes outside requests to services (medium level)
Distributed systemA system whose parts run on different machines and talk over a network

Note: Microservices is an architecture style, not a library. Spring Boot builds each service; Spring Cloud adds the tools that make many services work together.