Microservice
A Microservice is a online software service that is loosely coupled from other online services (with a single responsibility).
- Context:
- It can (typically) be Independent Deployable, Language Independent, Platform Independent, and Technology Independent (from other components).
- It can (often) be referenced in a Microservices-based Architecture.
- It can be based on a Microservices Framework.
- It can range from being a Nanoservice to being a Heavy Microservice.
- It can communicate using lightweight protocols like HTTP/REST or messaging queues like RabbitMQ.
- It can be part of a larger system, interacting with other microservices to perform complex business functions.
- It can enable continuous delivery and deployment, allowing small changes to be released independently.
- It can enhance scalability, allowing individual services to scale based on demand.
- It can facilitate better fault isolation, ensuring that failures in one microservice do not impact others.
- It can be independently developed by small, autonomous teams, improving agility and speed of development.
- ...
- Example(s):
- E-commerce Platforms:
- a Product Catalog Microservice that manages product details and inventory for an online store, allowing for easy updates and independent scaling.
- a Shopping Cart Microservice that handles the user’s cart items, providing a seamless shopping experience and enabling independent scaling during peak traffic.
- an Order Management Microservice that processes orders, tracks shipments, and handles returns, ensuring efficient order handling and fulfillment.
- Media Streaming Services:
- a User Profile Microservice for a streaming service like Netflix, managing user preferences and watch history independently of other services.
- a Recommendation Engine Microservice that provides personalized content suggestions based on user behavior and preferences.
- a Content Delivery Microservice that streams media files to users, optimizing bandwidth and server resources.
- Travel and Hospitality Applications:
- a Booking Management Microservice for an online travel agency, managing hotel reservations, flight bookings, and car rentals.
- a Search and Filtering Microservice that allows users to find and filter travel options based on various criteria.
- a Payment Processing Microservice that securely handles transactions for travel bookings.
- Financial Services and Banking:
- an Account Management Microservice for a bank, managing customer accounts and personal information.
- a Transaction Processing Microservice that handles real-time transaction approvals and fraud detection.
- a Risk Assessment Microservice that evaluates credit risk and compliance for financial products.
- Internet of Things (IoT):
- a Device Management Microservice that registers, monitors, and updates IoT devices.
- a Data Ingestion Microservice that collects and processes data from various sensors and devices in real-time.
- an Analytics Microservice that analyzes IoT data to provide insights and actionable information.
- Social Media Platforms:
- a Post Microservice for a social media platform like Twitter, managing user posts, likes, and comments.
- a Notification Microservice that handles real-time notifications for user interactions.
- a Messaging Microservice that provides direct messaging capabilities between users.
- Gaming and Entertainment:
- a Matchmaking Microservice for an online game, pairing players based on skill level and preferences.
- a Leaderboard Microservice that tracks and displays player rankings and scores.
- a Virtual Currency Microservice that manages in-game purchases and currency.
- Healthcare and Telemedicine:
- a Patient Management Microservice that handles patient records, appointments, and medical history.
- a Telemedicine Microservice that provides video consultations and secure communication between doctors and patients.
- a Health Monitoring Microservice that collects and analyzes health data from wearable devices.
- Capability-Related Microservices:
- an AI Microservice that provides machine learning model inference capabilities, allowing other services to leverage AI for tasks like image recognition, natural language processing, and predictive analytics.
- a Personalization Microservice that tailors content and recommendations based on user behavior and preferences, enhancing user experience.
- a Notification Microservice that sends real-time alerts and updates to users based on specific triggers or events.
- ...
- Amazon's Product Page Buy Button Service; Amazon's Tax Calculator Service.
- …
- E-commerce Platforms:
- Counter-Example(s):
- a Monolithic Service.
- a Data Dump.
- See: Service Mesh, Language-Independent Specification, Application Programming Interface, Service (Systems Architecture), Coupling (Computer Programming), Modularity, Distributed System, Microservices Framework.
References
2020
- (Wikipedia, 2020) ⇒ https://en.wikipedia.org/wiki/microservices#Introduction Retrieved:2020-7-17.
- There is no single definition for microservices. A consensus view has evolved over time in the industry. Some of the defining characteristics that are frequently cited include:
- Services in a microservice architecture (MSA) are often processes that communicate over a network to fulfill a goal using technology-agnostic protocols such as HTTP. * Services in a microservice architecture are independently deployable.[1] * Services are organized around business capabilities. * Services can be implemented using different programming languages, databases, hardware and software environment, depending on what fits best. * Services are small in size, messaging-enabled, bounded by contexts, autonomously developed, independently deployable, decentralized and built and released with automated processes.
- A microservice is not a layer within a monolithic application (example, the web controller, or the backend-for-frontend). Rather it is a self-contained piece of business functionality with clear interfaces, and may, through its own internal components, implement a layered architecture. From a strategy perspective, microservices architecture essentially follows the Unix philosophy of "Do one thing and do it well". Martin Fowler describes a microservices-based architecture as having the following properties: * Lends itself to a continuous delivery software development process. A change to a small part of the application only requires rebuilding and redeploying only one or a small number of services. [2] * Adheres to principles such as fine-grained interfaces (to independently deployable services), business-driven development (e.g. domain-driven design). [3] It is common for microservices architectures to be adopted for cloud-native applications, serverless computing, and applications using lightweight container deployment. According to Fowler, because of the large number (when compared to monolithic application implementations) of services, decentralized continuous delivery and DevOps with holistic service monitoring are necessary to effectively develop, maintain, and operate such applications. A consequence of (and rationale for) following this approach is that the individual microservices can be individually scaled. In the monolithic approach, an application supporting three functions would have to be scaled in its entirety even if only one of these functions had a resource constraint. With microservices, only the microservice supporting the function with resource constraints needs to be scaled out, thus providing resource and cost optimization benefits.
- There is no single definition for microservices. A consensus view has evolved over time in the industry. Some of the defining characteristics that are frequently cited include:
2020
- https://docs.datadoghq.com/tracing/visualization/
- QUOTE: ... Services are the building blocks of modern microservice architectures - broadly a service groups together endpoints, queries, or jobs for the purposes of scaling instances. Some examples:
- A group of URL endpoints may be grouped together under an API service.
- A group of DB queries that are grouped together within one database service.
- A group of periodic jobs configured in the crond service.
- QUOTE: ... Services are the building blocks of modern microservice architectures - broadly a service groups together endpoints, queries, or jobs for the purposes of scaling instances. Some examples:
2018
- (Wikipedia, 2018) ⇒ https://en.wikipedia.org/wiki/Microservices Retrieved:2018-9-27.
- … In a microservices architecture, services are fine-grained and the protocols are lightweight. The benefit of decomposing an application into different smaller services is that it improves modularity and makes the application easier to understand, develop, and test and more resilient to architecture erosion. It parallelizes development by enabling small autonomous teams to develop, deploy and scale their respective services independently. It also allows the architecture of an individual service to emerge through continuous refactoring. Microservices-based architectures enable continuous delivery and deployment.
2017
- https://martinfowler.com/articles/microservice-testing/#definition
- QUOTE: A microservice architecture is the natural consequence of applying the single responsibility principle at the architectural level. This results in a number of benefits over a traditional monolithic architecture such as independent deployability, language, platform and technology independence for different components, distinct axes of scalability and increased architectural flexibility. …
… Microservices are often integrated using REST over HTTP. In this way, business domain concepts are modelled as resources with one or more of these managed by each service. In the most mature RESTful systems, resources are linked using hypermedia controls such that the location of each resource is opaque to consumers of the services. See the Richardson Maturity Model for more details.
Alternative integration mechanisms are sometimes used such as lightweight messaging protocols, publish-subscribe models or alternative transports such as Protobuf or Thrift.
Each microservice may or may not provide some form of user interface.
- QUOTE: A microservice architecture is the natural consequence of applying the single responsibility principle at the architectural level. This results in a number of benefits over a traditional monolithic architecture such as independent deployability, language, platform and technology independence for different components, distinct axes of scalability and increased architectural flexibility. …
2015
- (Newman, 2015) ⇒ Sam Newman. (2015). “Building Microservices." O'Reilly Media, Inc.,
- BOOK OVERVIEW: Distributed systems have become more fine-grained in the past 10 years, shifting from code-heavy monolithic applications to smaller, self-contained microservices. But developing these systems brings its own set of headaches. With lots of examples and practical advice, this book takes a holistic view of the topics that system architects and administrators must consider when building, managing, and evolving microservice architectures.
Microservice technologies are moving quickly. Author Sam Newman provides you with a firm grounding in the concepts while diving into current solutions for modeling, integrating, testing, deploying, and monitoring your own autonomous services. You’ll follow a fictional company throughout the book to learn how building a microservice architecture affects a single domain.
- Discover how microservices allow you to align your system design with your organization’s goals.
- Learn options for integrating a service with the rest of your system.
- Take an incremental approach when splitting monolithic codebases.
- Deploy individual microservices through continuous integration.
- Examine the complexities of testing and monitoring distributed services.
- Manage security with user-to-service and service-to-service models.
- Understand the challenges of scaling microservice architectures
- BOOK OVERVIEW: Distributed systems have become more fine-grained in the past 10 years, shifting from code-heavy monolithic applications to smaller, self-contained microservices. But developing these systems brings its own set of headaches. With lots of examples and practical advice, this book takes a holistic view of the topics that system architects and administrators must consider when building, managing, and evolving microservice architectures.
- ↑ Nadareishvili, I., Mitra, R., McLarty, M., Amundsen, M., Microservice Architecture: Aligning Principles, Practices, and Culture, O’Reilly 2016
- ↑ Designing microservices: Continuous integration Microsoft Retrieved 9 January 2018
- ↑ Josuttis, N. (2007). SOA in Practice. Sebastopol, CA, USA: O'Reilly. .