{"url": "http://microservices.io/patterns/", "titulek": "A pattern language for microservices", "h1": "A pattern language for microservices", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: A pattern language for microservices", "og:url": "http://microservices.io/patterns/"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "A pattern language for microservices", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: A pattern language for microservices"}, "url": "http://microservices.io/patterns/"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "A pattern language for microservices"}, {"uroven": 2, "text": "Architectural style"}, {"uroven": 2, "text": "Service boundaries"}, {"uroven": 2, "text": "Refactoring to services"}, {"uroven": 2, "text": "Service collaboration"}, {"uroven": 2, "text": "Transactional messaging"}, {"uroven": 2, "text": "Testing"}, {"uroven": 2, "text": "Deployment"}, {"uroven": 2, "text": "Cross-cutting concerns"}, {"uroven": 2, "text": "Communication styles"}, {"uroven": 2, "text": "External API"}, {"uroven": 2, "text": "Service discovery"}, {"uroven": 2, "text": "Reliability"}, {"uroven": 2, "text": "Security"}, {"uroven": 2, "text": "Observability"}, {"uroven": 2, "text": "UI design"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# A pattern language for microservices\n\n[pattern](/tags/pattern)\n\n---\n\nThe beginnings of a [pattern language](http://en.wikipedia.org/wiki/Pattern_language) for microservice architectures.\n\n[点击这里,访问本系列文章的中文翻译](cn/index.html)\n\n[Click here for Chinese translation of the patterns](cn/index.html)\n\n[Click here for PDF](../i/MicroservicePatternLanguage.pdf)\n\n## Architectural style\n\nWhich architectural style should you choose for an application?\n\n- [Monolithic architecture](monolithic.html) - architect an application as a single deployable unit\n- [Microservice architecture](microservices.html) - architect an application as a collection of independently deployable, loosely coupled services\n\n## Service boundaries\n\nHow to decompose an application into services?\n\n- [Decompose by business capability](decomposition/decompose-by-business-capability.html) - define services corresponding to business capabilities\n- [Decompose by subdomain](decomposition/decompose-by-subdomain.html) - define services corresponding to DDD subdomains\n- [Self-contained Service](decomposition/self-contained-service.html) - design services to handle synchronous requests without waiting for other services to respond new\n- [Service per team](/patterns/decomposition/service-per-team.html) new\n\n## Refactoring to services\n\n- [Strangler Application](/patterns/refactoring/strangler-application.html)\n- [Anti-corruption layer](/patterns/refactoring/anti-corruption-layer.html)\n\n## Service collaboration\n\nHow to implement operations that span multiple services?\n\n- [Database per Service](data/database-per-service.html) - each service has its own private database\n- [Shared database](data/shared-database.html) - services share a database\n- [Saga](data/saga.html) - use sagas, which a sequences of local transactions, to maintain data consistency across services\n- [Command-side replica](data/command-side-replica.html) - maintain a queryable replica of data in a service that implements a command\n- [API Composition](data/api-composition.html) - implement queries by invoking the services that own the data and performing an in-memory join\n- [CQRS](data/cqrs.html) - implement queries by maintaining one or more materialized views that can be efficiently queried\n- [Domain event](/patterns/data/domain-event.html) - publish an event whenever data changes\n- [Event sourcing](data/event-sourcing.html) - persist aggregates as a sequence of events\n\n## Transactional messaging\n\nHow to send messages as part of a database transaction?\n\n- [Transactional outbox](data/transactional-outbox.html)\n- [Transaction log tailing](data/transaction-log-tailing.html)\n- [Polling publisher](data/polling-publisher.html)\n\n## Testing\n\nHow to test services?\n\n- [Consumer-driven contract test](testing/service-integration-contract-test.html) - a test suite for a service that is written by the developers of another service that consumes it\n- [Consumer-side contract test](testing/service-integration-contract-test.html) - a test suite for a service client (e.g. another service) that verifies that it can communicate with the service\n- [Service component sest](testing/service-component-test.html) - a test suite that tests a service in isolation using test doubles for any services that it invokes\n\n## Deployment\n\nHow to deploy an application’s services?\n\n- [Multiple service instances per host](deployment/multiple-services-per-host.html) - deploy multiple service instances on a single host\n- [Service instance per host](deployment/single-service-per-host.html) - deploy each service instance in its own host\n- [Service instance per VM](deployment/service-per-vm.html) - deploy each service instance in its VM\n- [Service instance per Container](deployment/service-per-container.html) - deploy each service instance in its container\n- [Serverless deployment](/patterns/deployment/serverless-deployment.html) - deploy a service using serverless deployment platform\n- [Service deployment platform](/patterns/deployment/service-deployment-platform.html) - deploy services using a highly automated deployment platform that provides a service abstraction\n\n## Cross-cutting concerns\n\nHow to handle cross cutting concerns?\n\n- [Microservice chassis](/patterns/microservice-chassis.html) - a framework that handles cross-cutting concerns and simplifies the development of services\n- [Externalized configuration](/patterns/externalized-configuration.html) - externalize all configuration such as database location and credentials\n- [Service Template](/patterns/service-template.html) - a template that implements standard cross cutting concerns and is intended to be copied by a developer in order to quickly start developing a new service\n\n## Communication styles\n\nWhich mechanisms do services use to communicate with each other and their external clients?\n\n- [Remote Procedure Invocation](communication-style/rpi.html) - use an RPI-based protocol for inter-service communication\n- [Messaging](communication-style/messaging.html) - use asynchronous messaging for inter-service communication\n- [Domain-specific protocol](communication-style/domain-specific.html) - use a domain-specific protocol\n- [Idempotent Consumer](/patterns/communication-style/idempotent-consumer.html) - ensure that message consumers can cope with being invoked multiple times with the same message\n\n## External API\n\nHow do external clients communicate with the services?\n\n- [API gateway](apigateway.html) - a service that provides each client with unified interface to services\n- [Backend for front-end](apigateway.html) - a separate API gateway for each kind of client\n\n## Service discovery\n\nHow does the client of an RPI-based service discover the network location of a service instance?\n\n- [Client-side discovery](client-side-discovery.html) - client queries a service registry to discover the locations of service instances\n- [Server-side discovery](server-side-discovery.html) - router queries a service registry to discover the locations of service instances\n- [Service registry](service-registry.html) - a database of service instance locations\n- [Self registration](self-registration.html) - service instance registers itself with the service registry\n- [3rd party registration](3rd-party-registration.html) - a 3rd party registers a service instance with the service registry\n\n## Reliability\n\nHow to prevent a network or service failure from cascading to other services?\n\n- [Circuit Breaker](reliability/circuit-breaker.html) - invoke a remote service via a proxy that fails immediately when the failure rate of the remote call exceeds a threshold\n\n## Security\n\nHow to communicate the identity of the requestor to the services that handle the request?\n\n- [Access Token](security/access-token.html) - a token that securely stores information about user that is exchanged between services\n\n## Observability\n\nHow to understand the behavior of an application and troubleshoot problems?\n\n- [Log aggregation](observability/application-logging.html) - aggregate application logs\n- [Application metrics](observability/application-metrics.html) - instrument a service’s code to gather statistics about operations\n- [Audit logging](observability/audit-logging.html) - record user activity in a database\n- [Distributed tracing](observability/distributed-tracing.html) - instrument services with code that assigns each external request an unique identifier that is passed between services.\nRecord information (e.g. start time, end time) about the work (e.g. service requests) performed when handling the external request in a centralized service\n- [Exception tracking](observability/exception-tracking.html) - report all exceptions to a centralized exception tracking service that aggregates and tracks exceptions and notifies developers.\n- [Health check API](observability/health-check-api.html) - service API (e.g. HTTP endpoint) that returns the health of the service and is intended to be pinged, for example, by a monitoring service\n- [Log deployments and changes](/patterns/observability/log-deployments-and-changes.html)\n\n## UI design\n\nHow to implement a UI screen or page that displays data from multiple services?\n\n- [Server-side page fragment composition](ui/server-side-page-fragment-composition.html) - build a webpage on the server by composing HTML fragments generated by multiple, business capability/subdomain-specific web applications\n- [Client-side UI composition](ui/client-side-ui-composition.html) - Build a UI on the client by composing UI fragments rendered by multiple, business capability/subdomain-specific UI components\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 11631, "slov": 1363, "odkazu": 81, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:50", "sha256": "e627c155f35b94b27b44e81d693c359b2fd5d129d56cd3b02f4d3db3f0c74491", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "http://en.wikipedia.org/wiki/Pattern_language", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/2021/08/10/revised-chassis-template.html", "titulek": "Revised patterns - Microservice Chassis and Service Template", "h1": "Revised patterns - Microservice Chassis and Service Template", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Revised patterns - Microservice Chassis and Service Template"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Revised patterns - Microservice Chassis and Service Template\n\n[Contact me](https://chrisrichardson.net/contactus.html) for information about consulting and training at your company.\n\nThe [MEAP for Microservices Patterns 2nd edition](https://microservices.io/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html) is now available\n\n---\n\nI recently updated a couple of related patterns: [Microservice chassis](/patterns/microservice-chassis.html) and [Service Template](/patterns/service-template.html).\n\nI clarified the responsibilities and structure of the chassis framework and the service template; and the relationship between them.\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 3926, "slov": 454, "odkazu": 30, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:10:58", "sha256": "4298646064678d38f6750841c00554b20f0d37e2242b0dd6ab2b8cef187f1382", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://chrisrichardson.net/contactus.html", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/3rd-party-registration.html", "titulek": "Pattern: 3rd Party Registration", "h1": "Pattern: 3rd Party Registration", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: 3rd Party Registration", "og:url": "http://microservices.io/patterns/3rd-party-registration.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/3rd-party-registration.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: 3rd Party Registration", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: 3rd Party Registration"}, "url": "http://microservices.io/patterns/3rd-party-registration.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: 3rd Party Registration"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: 3rd Party Registration\n\n[pattern](/tags/pattern) [inter-service communication](/tags/inter-service communication) [service discovery](/tags/service discovery)\n\n---\n\n## Context\n\nYou have applied either the [Client-side Service Discovery pattern](client-side-discovery.html) or the [Server-side Service Discovery pattern](server-side-discovery.html).\nService instances must be registered with the [service registry](service-registry.html) on startup so that they can be discovered and unregistered on shutdown.\n\n## Problem\n\nHow are service instances registered with and unregistered from the service registry?\n\n## Forces\n\n- Service instances must be registered with the service registry on startup and unregistered on shutdown\n- Service instances that crash must be unregistered from the service registry\n- Service instances that are running but incapable of handling requests must be unregistered from the service registry\n\n## Solution\n\nA 3rd party registrar is responsible for registering and unregistering a service instance with the service registry.\nWhen the service instance starts up, the registrar registers the service instance with the service registry.\nWhen the service instance shuts downs, the registrar unregisters the service instance from the service registry.\n\n## Examples\n\nExamples of the 3rd Party Registration pattern include:\n\n- [Netflix Prana](https://github.com/Netflix/Prana) - a “side car” application that runs along side a non-JVM application and registers the application with Eureka.\n- [AWS Autoscaling Groups](http://aws.amazon.com/autoscaling/) automatically (un)registers EC2 instances with Elastic Load Balancer\n- [Joyent’s Container buddy](https://github.com/joyent/containerbuddy) runs in a Docker container as the parent process for the service and registers it with the registry\n- [Registrator](https://github.com/gliderlabs/registrator) - registers and unregisters Docker containers with various service registries\n- Clustering frameworks such as [Kubernetes](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/services.md) and [Marathon](https://mesosphere.github.io/marathon/docs/service-discovery-load-balancing.html) (un)register service instances with the built-in/implicit registry\n\n## Resulting context\n\nThe benefits of the 3rd Party Registration pattern include:\n\n- The service code is less complex than when using the [Self Registration pattern](self-registration.html) since its not responsible for registering itself\n- The registrar can perform health checks on a service instance and register/unregister the instance based the health check\n\nThere are also some drawbacks:\n\n- The 3rd party registrar might only have superficial knowledge of the state of the service instance, e.g. RUNNING or NOT RUNNING and so might not know whether it can handle requests. However, as mentioned above some registrars such as Netflix Prana perform a health check in order to determine the availability of the service instance.\n- Unless the registrar is part of the infrastructure it’s another component that must be installed, configured and maintained.\nAlso, since it’s a critical system component it needs to be highly available.\n\n- [Service Registry](service-registry.html)\n- [Client Side Discovery](client-side-discovery.html)\n- [Server Side Discovery](server-side-discovery.html)\n- [Self Registration](self-registration.html) is an alternative solution\n\n---\n\n[pattern](/tags/pattern) [inter-service communication](/tags/inter-service communication) [service discovery](/tags/service discovery)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 6766, "slov": 810, "odkazu": 39, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:00", "sha256": "d2d4c93cba1ac77e0c9794e00580d22ef3a4c02481581f96a5553613befd55ed", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://github.com/Netflix/Prana", "http://aws.amazon.com/autoscaling/", "https://github.com/joyent/containerbuddy", "https://github.com/gliderlabs/registrator", "https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/services.md", "https://mesosphere.github.io/marathon/docs/service-discovery-load-balancing.html", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/apigateway.html", "titulek": "Pattern: API Gateway / Backends for Frontends", "h1": "Topics", "popis": "An API gateway acts a single entry point into the application, routing and composing requests to services", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: API Gateway / Backends for Frontends", "og:image": "http://microservices.io/i/apigateway.jpg", "og:url": "http://microservices.io/patterns/apigateway.html", "og:description": "An API gateway acts a single entry point into the application, routing and composing requests to services"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/apigateway.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: API Gateway / Backends for Frontends", "description": "A pattern language for microservices", "primaryImageOfPage": {"@type": "ImageObject", "contentUrl": "http://microservices.io/i/apigateway.jpg", "representativeOfPage": "True"}, "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: API Gateway / Backends for Frontends", "description": "An API gateway acts a single entry point into the application, routing and composing requests to services", "image": {"@type": "ImageObject", "name": "The API gateway pattern", "width": "735", "height": "428", "url": "http://microservices.io/i/apigateway.jpg"}}, "url": "http://microservices.io/patterns/apigateway.html"}, {"@context": "http://schema.org", "@type": "Question", "name": "What is an API gateway?", "acceptedAnswer": {"@type": "Answer", "text": "An API gateway acts a single entry point into the application, routing and composing requests to services"}}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Variation: Backends for frontends"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "Known uses"}, {"uroven": 2, "text": "Example application"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}, {"uroven": 1, "text": "Topics"}, {"uroven": 4, "text": "The patterns"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n[pattern](/tags/pattern) [application api](/tags/application api) [inter-service communication](/tags/inter-service communication) [application architecture](/tags/application architecture)\n\n---\n\n## Context\n\nLet’s imagine you are building an online store that uses the [Microservice architecture pattern](microservices.html) and that you are implementing the product details page.\nYou need to develop multiple versions of the product details user interface:\n\n- HTML5/JavaScript-based UI for desktop and mobile browsers - HTML is generated by a server-side web application\n- Native Android and iPhone clients - these clients interact with the server via REST APIs\n\nIn addition, the online store must expose product details via a REST API for use by 3rd party applications.\n\nA product details UI can display a lot of information about a product.\nFor example, the Amazon.com details page for [POJOs in Action](http://www.amazon.com/POJOs-Action-Developing-Applications-Lightweight/dp/1932394583) displays:\n\n- Basic information about the book such as title, author, price, etc.\n- Your purchase history for the book\n- Availability\n- Buying options\n- Other items that are frequently bought with this book\n- Other items bought by customers who bought this book\n- Customer reviews\n- Sellers ranking\n- …\n\nSince the online store uses the Microservice architecture pattern the product details data is spread over multiple services. For example,\n\n- Product Info Service - basic information about the product such as title, author\n- Pricing Service - product price\n- Order service - purchase history for product\n- Inventory service - product availability\n- Review service - customer reviews\n…\n\nConsequently, the code that displays the product details needs to fetch information from all of these services.\n\n## Problem\n\nHow do the clients of a Microservices-based application access the individual services?\n\n## Forces\n\n- The granularity of APIs provided by microservices is often different than what a client needs. Microservices typically provide fine-grained APIs, which means that clients need to interact with multiple services. For example, as described above, a client needing the details for a product needs to fetch data from numerous services.\n- Different clients need different data. For example, the desktop browser version of a product details page desktop is typically more elaborate then the mobile version.\n- Network performance is different for different types of clients. For example, a mobile network is typically much slower and has much higher latency than a non-mobile network. And, of course, any WAN is much slower than a LAN.\nThis means that a native mobile client uses a network that has very difference performance characteristics than a LAN used by a server-side web application. The server-side web application can make multiple requests to backend services without impacting the user experience where as a mobile client can only make a few.\n- The number of service instances and their locations (host+port) changes dynamically\n- Partitioning into services can change over time and should be hidden from clients\n- Services might use a diverse set of protocols, some of which might not be web friendly\n\n## Solution\n\nImplement an API gateway that is the single entry point for all clients.\nThe API gateway handles requests in one of two ways.\nSome requests are simply proxied/routed to the appropriate service.\nIt handles other requests by fanning out to multiple services.\n\nRather than provide a one-size-fits-all style API, the API gateway can expose a different API for each client. For example, the [Netflix API](http://techblog.netflix.com/2012/07/embracing-differences-inside-netflix.html) gateway runs client-specific adapter code that provides each client with an API that’s best suited to its requirements.\n\nThe API gateway might also implement security, e.g. verify that the client is authorized to perform the request\n\n## Variation: Backends for frontends\n\nA variation of this pattern is the Backends for frontends pattern.\nIt defines a separate API gateway for each kind of client.\n\nIn this example, there are three kinds of clients: web application, mobile application, and external 3rd party application.\nThere are three different API gateways.\nEach one is provides an API for its client.\n\n## Examples\n\n- [Netflix API gateway](http://techblog.netflix.com/2013/01/optimizing-netflix-api.html)\n- A simple [Java/Spring API gateway](https://github.com/cer/event-sourcing-examples/tree/master/java-spring/api-gateway-service) from the [Money Transfer example application](https://github.com/cer/event-sourcing-examples) .\n\n## Resulting context\n\nUsing an API gateway has the following benefits:\n\n- Insulates the clients from how the application is partitioned into microservices\n- Insulates the clients from the problem of determining the locations of service instances\n- Provides the optimal API for each client\n- Reduces the number of requests/roundtrips. For example, the API gateway enables clients to retrieve data from multiple services with a single round-trip. Fewer requests also means less overhead and improves the user experience. An API gateway is essential for mobile applications.\n- Simplifies the client by moving logic for calling multiple services from the client to API gateway\n- Translates from a “standard” public web-friendly API protocol to whatever protocols are used internally\n\nThe API gateway pattern has some drawbacks:\n\n- Increased complexity - the API gateway is yet another moving part that must be developed, deployed and managed\n- Increased response time due to the additional network hop through the API gateway - however, for most applications the cost of an extra roundtrip is insignificant.\n\nIssues:\n\n- How implement the API gateway? An event-driven/reactive approach is best if it must scale to scale to handle high loads. On the JVM, NIO-based libraries such as Netty, Spring Reactor, etc. make sense. NodeJS is another option.\n\n- The [Microservice architecture pattern](microservices.html) creates the need for this pattern.\n- The API gateway must use either the [Client-side Discovery pattern](client-side-discovery.html) or [Server-side Discovery pattern](server-side-discovery.html) to route requests to available service instances.\n- The API Gateway may authenticate the user and pass an [Access Token](security/access-token.html) containing information about the user to the services\n- An API Gateway will use a [Circuit Breaker](reliability/circuit-breaker.html) to invoke services\n- An API gateway often implements the [API Composition pattern](/patterns/data/api-composition.html)\n\n## Known uses\n\n- [Netflix API gateway](http://techblog.netflix.com/2012/07/embracing-differences-inside-netflix.html)\n\n## Example application\n\nSee the API Gateway that part of my Microservices pattern’s [example application](https://github.com/microservice-patterns/ftgo-application).\nIt’s implemented using Spring Cloud Gateway.\n\n---\n\n[pattern](/tags/pattern) [application api](/tags/application api) [inter-service communication](/tags/inter-service communication) [application architecture](/tags/application architecture)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)\n\n# Topics\n\nNote: tagging is work-in-process\n\n[Cynefin](/tags/Cynefin) · \n[DDD](/tags/DDD) · \n[GitOps](/tags/GitOps) · \n[Microservices adoption](/tags/Microservices adoption) · \n[ancient lore](/tags/ancient lore) · \n[anti-patterns](/tags/anti-patterns) · \n[api gateway](/tags/api gateway) · \n[application api](/tags/application api) · \n[application architecture](/tags/application architecture) · \n[architecting](/tags/architecting) · \n[architecture](/tags/architecture) · \n[architecture documentation](/tags/architecture documentation) · \n[assemblage](/tags/assemblage) · \n[automation](/tags/automation) · \n[beer](/tags/beer) · \n[books](/tags/books) · \n[build vs buy](/tags/build vs buy) · \n[containers](/tags/containers) · \n[context engineering](/tags/context engineering) · \n[culture](/tags/culture) · \n[dark energy and dark matter](/tags/dark energy and dark matter) · \n[decision making](/tags/decision making) · \n[deliberative design](/tags/deliberative design) · \n[deployability](/tags/deployability) · \n[deployment](/tags/deployment) · \n[deployment pipeline](/tags/deployment pipeline) · \n[design-time coupling](/tags/design-time coupling) · \n[developer experience](/tags/developer experience) · \n[development](/tags/development) · \n[devops](/tags/devops) · \n[docker](/tags/docker) · \n[eventuate platform](/tags/eventuate platform) · \n[evolvability](/tags/evolvability) · \n[experimentation](/tags/experimentation) · \n[fast flow](/tags/fast flow) · \n[genAI development](/tags/genAI development) · \n[generative AI](/tags/generative AI) · \n[glossary](/tags/glossary) · \n[harness engineering](/tags/harness engineering) · \n[health](/tags/health) · \n[hexagonal architecture](/tags/hexagonal architecture) · \n[idea to code](/tags/idea to code) · \n[implementing commands](/tags/implementing commands) · \n[implementing queries](/tags/implementing queries) · \n[infrastructure as code](/tags/infrastructure as code) · \n[inter-service communication](/tags/inter-service communication) · \n[kubernetes](/tags/kubernetes) · \n[loose coupling](/tags/loose coupling) · \n[manning publications](/tags/manning publications) · \n[microservice](/tags/microservice) · \n[microservice architecture](/tags/microservice architecture) · \n[microservice chassis](/tags/microservice chassis) · \n[microservices adoption](/tags/microservices adoption) · \n[microservices platforms](/tags/microservices platforms) · \n[microservices rules](/tags/microservices rules) · \n[microservicesio updates](/tags/microservicesio updates) · \n[modifiability](/tags/modifiability) · \n[modular monolith](/tags/modular monolith) · \n[multi-architecture docker images](/tags/multi-architecture docker images) · \n[observability](/tags/observability) · \n[pattern](/tags/pattern) · \n[pattern language](/tags/pattern language) · \n[patterns](/tags/patterns) · \n[platform strategy](/tags/platform strategy) · \n[refactoring](/tags/refactoring) · \n[refactoring to microservices](/tags/refactoring to microservices) · \n[resilience](/tags/resilience) · \n[runtime coupling](/tags/runtime coupling) · \n[sagas](/tags/sagas) · \n[scripting](/tags/scripting) · \n[security](/tags/security) · \n[service api](/tags/service api) · \n[service architecture](/tags/service architecture) · \n[service blueprint](/tags/service blueprint) · \n[service collaboration](/tags/service collaboration) · \n[service design](/tags/service design) · \n[service discovery](/tags/service discovery) · \n[service granularity](/tags/service granularity) · \n[service template](/tags/service template) · \n[socio-technical architecture](/tags/socio-technical architecture) · \n[software delivery metrics](/tags/software delivery metrics) · \n[success triangle](/tags/success triangle) · \n[survey](/tags/survey) · \n[tacos](/tags/tacos) · \n[team topologies](/tags/team topologies) · \n[technical debt](/tags/technical debt) · \n[testability](/tags/testability) · \n[testing](/tags/testing) · \n[transaction management](/tags/transaction management) · \n[transactional messaging](/tags/transactional messaging) · \n[uncertainty](/tags/uncertainty) · \n[wardley mapping](/tags/wardley mapping)\n\n**[All content](/tags/index.html)**\n\n---\n\n#### The patterns\n\n[How to apply the patterns](/articles/applying.html)\n\nApplication architecture patterns\n\n- [Monolithic architecture](/patterns/monolithic.html)\n- [Microservice architecture](/patterns/microservices.html)\n\nDecomposition\n\n- [Decompose by business capability](/patterns/decomposition/decompose-by-business-capability.html)\n- [Decompose by subdomain](/patterns/decomposition/decompose-by-subdomain.html)\n- [Self-contained Service](/patterns/decomposition/self-contained-service.html) new\n- [Service per team](/patterns/decomposition/service-per-team.html) new\n\nRefactoring to microservicesnew\n\n- [Strangler Application](/patterns/refactoring/strangler-application.html)\n- [Anti-corruption layer](/patterns/refactoring/anti-corruption-layer.html)\n\nData management\n\n- [Database per Service](/patterns/data/database-per-service.html)\n- [Shared database](/patterns/data/shared-database.html)\n- [Saga](/patterns/data/saga.html)\n- [Command-side replica](/patterns/data/command-side-replica.html)\n- [API Composition](/patterns/data/api-composition.html)\n- [CQRS](/patterns/data/cqrs.html)\n- [Domain event](/patterns/data/domain-event.html)\n- [Event sourcing](/patterns/data/event-sourcing.html)\n\nTransactional messaging\n\n- [Transactional outbox](/patterns/data/transactional-outbox.html)\n- [Transaction log tailing](/patterns/data/transaction-log-tailing.html)\n- [Polling publisher](/patterns/data/polling-publisher.html)\n\nTesting\n\n- [Service Component Test](/patterns/testing/service-component-test.html)\n- [Consumer-driven contract test](/patterns/testing/service-integration-contract-test.html)\n- [Consumer-side contract test](/patterns/testing/consumer-side-contract-test.html)\n\nDeployment patterns\n\n- [Multiple service instances per host](/patterns/deployment/multiple-services-per-host.html)\n- [Service instance per host](/patterns/deployment/single-service-per-host.html)\n- [Service instance per VM](/patterns/deployment/service-per-vm.html)\n- [Service instance per Container](/patterns/deployment/service-per-container.html)\n- [Serverless deployment](/patterns/deployment/serverless-deployment.html)\n- [Service deployment platform](/patterns/deployment/service-deployment-platform.html)\n\nCross cutting concerns\n\n- [Microservice chassis](/patterns/microservice-chassis.html)\n- [Service Template](/patterns/service-template.html)\n- [Externalized configuration](/patterns/externalized-configuration.html)\n\nCommunication style\n\n- [Remote Procedure Invocation](/patterns/communication-style/rpi.html)\n- [Messaging](/patterns/communication-style/messaging.html)\n- [Domain-specific protocol](/patterns/communication-style/domain-specific.html)\n- [Idempotent Consumer](/patterns/communication-style/idempotent-consumer.html)\n\nExternal API\n\n- [API gateway](/patterns/apigateway.html)\n- [Backend for front-end](/patterns/apigateway.html)\n\nService discovery\n\n- [Client-side discovery](/patterns/client-side-discovery.html)\n- [Server-side discovery](/patterns/server-side-discovery.html)\n- [Service registry](/patterns/service-registry.html)\n- [Self registration](/patterns/self-registration.html)\n- [3rd party registration](/patterns/3rd-party-registration.html)\n\nReliability\n\n- [Circuit Breaker](/patterns/reliability/circuit-breaker.html)\n\nSecurity\n\n- [Access Token](/patterns/security/access-token.html)\n\nObservability\n\n- [Log aggregation](/patterns/observability/application-logging.html)\n- [Application metrics](/patterns/observability/application-metrics.html)\n- [Audit logging](/patterns/observability/audit-logging.html)\n- [Distributed tracing](/patterns/observability/distributed-tracing.html)\n- [Exception tracking](/patterns/observability/exception-tracking.html)\n- [Health check API](/patterns/observability/health-check-api.html)\n- [Log deployments and changes](/patterns/observability/log-deployments-and-changes.html)\n\nUI patterns\n\n- [Server-side page fragment composition](/patterns/ui/server-side-page-fragment-composition.html)\n- [Client-side UI composition](/patterns/ui/client-side-ui-composition.html)", "znaku_textu": 18384, "slov": 1955, "odkazu": 183, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:07", "sha256": "3ec9337430c607d6a881386d43835ed779174b6d901f51e1239ee9d5f06b3d72", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "http://www.amazon.com/POJOs-Action-Developing-Applications-Lightweight/dp/1932394583", "http://techblog.netflix.com/2012/07/embracing-differences-inside-netflix.html", "http://techblog.netflix.com/2013/01/optimizing-netflix-api.html", "https://github.com/cer/event-sourcing-examples/tree/master/java-spring/api-gateway-service", "https://github.com/cer/event-sourcing-examples", "https://github.com/microservice-patterns/ftgo-application", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/client-side-discovery.html", "titulek": "Pattern: Client-side service discovery", "h1": "Pattern: Client-side service discovery", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Client-side service discovery", "og:url": "http://microservices.io/patterns/client-side-discovery.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/client-side-discovery.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Client-side service discovery", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Client-side service discovery"}, "url": "http://microservices.io/patterns/client-side-discovery.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Client-side service discovery"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Client-side service discovery\n\n[pattern](/tags/pattern) [inter-service communication](/tags/inter-service communication) [service discovery](/tags/service discovery)\n\n---\n\n## Context\n\nServices typically need to call one another.\nIn a monolithic application, services invoke one another through language-level method or procedure calls.\nIn a traditional distributed system deployment, services run at fixed, well known locations (hosts and ports) and so can easily call one another using HTTP/REST or some RPC mechanism.\nHowever, a modern [microservice-based](microservices.html) application typically runs in a virtualized or containerized environments where the number of instances of a service and their locations changes dynamically.\n\nConsequently, you must implement a mechanism for that enables the clients of service to make requests to a dynamically changing set of ephemeral service instances.\n\n## Problem\n\nHow does the client of a service - the API gateway or another service - discover the location of a service instance?\n\n## Forces\n\n- Each instance of a service exposes a remote API such as HTTP/REST, or Thrift etc. at a particular location (host and port)\n- The number of services instances and their locations changes dynamically.\n- Virtual machines and containers are usually assigned dynamic IP addresses.\n- The number of services instances might vary dynamically. For example, an EC2 Autoscaling Group adjusts the number of instances based on load.\n\n## Solution\n\nWhen making a request to a service, the client obtains the location of a service instance by querying a [Service Registry](service-registry.html), which knows the locations of all service instances.\n\nThe following diagram shows the structure of this pattern.\n\nThis is typically handled by a [Microservice chassis framework](microservice-chassis.html)\n\n## Examples\n\nThe [Microservices Example application](https://github.com/cer/microservices-examples) is an example of an application that uses client-side service discovery.\nIt is written in Scala and uses Spring Boot and Spring Cloud as the [Microservice chassis](microservice-chassis.html).\nThey provide various capabilities including client-side discovery.\n\n`RegistrationServiceProxy` is a component of that application.\nIn order to register a user, it invokes another service using the Spring Framework’s `RestTemplate`:\n\n```\n@Component class RegistrationServiceProxy @Autowired()(restTemplate: RestTemplate) extends RegistrationService { @Value(\"${user_registration_url}\") var userRegistrationUrl: String = _ override def registerUser(emailAddress: String, password: String): Either[RegistrationError, String] = { val response = restTemplate.postForEntity(userRegistrationUrl, RegistrationBackendRequest(emailAddress, password), classOf[RegistrationBackendResponse]) ... } \n```\n\nIt is injected with the RestTemplate and the `user_registration_url`, which specifies the REST endpoint.\n\nWhen the application is deployed `user_registration_url` is set to this URL `http://REGISTRATION-SERVICE/user` - see the `docker-compose.yml` file. `REGISTRATION-SERVICE` is the logical service name that is resolved to a network location using client-side service discovery.\nThe service discovery is implemented using [Netflix OSS](http://netflix.github.io/) components.\nIt provides [Eureka](https://github.com/Netflix/eureka/wiki/Eureka-at-a-glance), which is a [Service Registry](service-registry.html), and [Ribbon](https://github.com/Netflix/ribbon), which is an HTTP client that queries Eureka in order to route HTTP requests to an available service instance.\n\nClient-side service discovery is configured using various Spring Cloud annotations:\n\n```\n@Configuration @EnableEurekaClient @Profile(Array(\"enableEureka\")) class EurekaClientConfiguration { @Bean @LoadBalanced def restTemplate(scalaObjectMapper : ScalaObjectMapper) : RestTemplate = { val restTemplate = new RestTemplate() restTemplate.getMessageConverters foreach { case mc: MappingJackson2HttpMessageConverter => mc.setObjectMapper(scalaObjectMapper) case _ => } restTemplate } \n```\n\nThe `@EnableEurekaClient` annotation enables the Eureka client.\nThe `@LoadBalanced` annotation configures the `RestTemplate` to use Ribbon, which has been configured to use the Eureka client to do service discovery.\nAs a result, the `RestTemplate` will handle requests to the `http://REGISTRATION-SERVICE/user` endpoint by querying Eureka to find the network locations of available service instances.\n\n## Resulting context\n\nClient-side discovery has the following benefits:\n\n- Fewer moving parts and network hops compared to [Server-side Discovery](server-side-discovery.html)\n\nClient-side discovery also has the following drawbacks:\n\n- This pattern couples the client to the [Service Registry](service-registry.html)\n- You need to implement client-side service discovery logic for each programming language/framework used by your application, e.g Java/Scala, JavaScript/NodeJS.\nFor example, [Netflix Prana](https://github.com/Netflix/Prana) provides an HTTP proxy-based approach to service discovery for non-JVM clients.\n\n- [Service Registry](service-registry.html) - an essential part of service discovery\n- [Microservice chassis](microservice-chassis.html) - Client-side service discovery is the responsibility the microservice chassis framework\n- [Server Side Discovery](server-side-discovery.html) is an alternative solution to this problem.\n\n---\n\n[pattern](/tags/pattern) [inter-service communication](/tags/inter-service communication) [service discovery](/tags/service discovery)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 8741, "slov": 1055, "odkazu": 38, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:18", "sha256": "490cf5d0b24a1f72d5932ed5f359803a6d533508e7a8bea7c76a2d8c20f1a23d", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://github.com/cer/microservices-examples", "http://netflix.github.io/", "https://github.com/Netflix/eureka/wiki/Eureka-at-a-glance", "https://github.com/Netflix/ribbon", "https://github.com/Netflix/Prana", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/cn/", "titulek": "A pattern language for microservices", "h1": "微服务的模式语言", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "微服务的模式语言"}, {"uroven": 1, "text": "ć ¸ĺżƒć¨ĄĺźďźˆApplication architecture patterns)"}, {"uroven": 1, "text": "服务拆分(Decomposition)"}, {"uroven": 1, "text": "部署模式(Deployment patterns)"}, {"uroven": 1, "text": "需要关注的边界问题(Cross cutting concerns)"}, {"uroven": 1, "text": "通讯模式(Communication patterns)"}, {"uroven": 2, "text": "éŁŽć ź"}, {"uroven": 2, "text": "外部 API"}, {"uroven": 2, "text": "服务发现"}, {"uroven": 2, "text": "ĺŻé ć€§"}, {"uroven": 1, "text": "数据管理(Data management)"}, {"uroven": 1, "text": "安全(Security)"}, {"uroven": 1, "text": "测试(Testing)"}, {"uroven": 1, "text": "可观测性(Observability)"}, {"uroven": 1, "text": "UI 模式(UI patterns)"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# 微服务的模式语言\n\n咱们开始聊聊微服务架构的[模式语言](https://book.douban.com/subject/1471535/)吧。\n\n> [译注]:模式语言提供了讨论问题的交流术语,它明确了特定场景、特定问题的解决方案和延伸性思考。模式语言主要目的是帮助开发者解决在设计和编程中遇到的共同的问题,即清晰的问题陈述、体现问题的解决方案以及推动解决方案的力量(Forceďź‰çš„ć¸…ć™°čĄ¨čż°ă€‚ĺžŽćœĺŠĄćžśćž„ä˝œä¸şä¸€ä¸ŞçŽ°ĺœ¨ćľčĄŒçš„ćœĺŠĄćžśćž„ďźŒäšŸćœ‰ä¸€ĺĽ—ĺąžäşŽč‡Şĺˇąçš„ć¨Ąĺźă€‚čż™çŻ‡ć–‡çŤ ć˜ŻĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łć¨ĄĺźčŻ­č¨€çš„ä¸€ä¸Şćçş˛ă€‚Chris Richardson 从不同的角度,对相关的模式进行了分类。可以点击链接查看每个模式的详细描述。下图通过虚线框细分了不同的微服务模式。\n\n# ć ¸ĺżƒć¨ĄĺźďźˆApplication architecture patterns)\n\n您为应用程序选择哪一种架构?\n\n- [单体架构(Monolithic architecture)](monolithic.html) - 采用单一部署单元的方式架构应用\n- [微服务架构(Microservices architecture)](microservices.html) - 采用一组松耦合服务的方式架构应用\n\n# 服务拆分(Decomposition)\n\n如何把应用拆分为若干个服务?\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†ďźˆDecompose by business capability)](decomposition/decompose-by-business-capability.html) new - ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ç•ŒĺŽšćœĺŠĄçš„čŒƒĺ›´\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†ďźˆDecompose by subdomain)](decomposition/decompose-by-subdomain.html) new - ć šćŽé˘†ĺŸŸéŠąĺŠ¨čŽžčŽĄä¸­ĺ­ĺŸŸçš„ćŚ‚ĺżľç•ŒĺŽšćœĺŠĄçš„čŒƒĺ›´\n\n# 部署模式(Deployment patterns)\n\n如何部署应用程序的服务?\n\n- [单主机上部署服务的多个实例(Multiple service instances per host)](deployment/multiple-services-per-host.html) - 把服务的多个实例部署在一台主机上\n- [单主机上部署服务的单个实例(Single service instance per host)](deployment/single-service-per-host.html) - 把服务的单一实例部署在它独享的主机上\n- [服务实例与虚拟机一一对应(Service instance per VM)](deployment/service-per-vm.html) - 把服务的单一实例部署在它独享的虚拟机上\n- [服务实例与容器一一对应(Service instance per Container)](deployment/service-per-container.html) - 把服务的单一实例部署在它独享的容器上\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛ďźˆServerless deployment)](/patterns/deployment/serverless-deployment.html) - ä˝żç”¨ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛ĺšłĺ°éƒ¨ç˝˛ćœĺŠĄĺŽžäž‹\n- [服务部署平台(Service deployment platform)](/patterns/deployment/service-deployment-platform.html) new - 使用提供服务抽象能力的高度自动化部署平台部署服务实例\n\n# 需要关注的边界问题(Cross cutting concerns)\n\n如何处理服务实例与外界交互的问题?\n\n- [微服务的基底(Microservice chassis)](/patterns/microservice-chassis.html) - 一个用于服务实例与外界交互和简化服务开发的框架\n- [配置信息外部化(Externalized configuration)](/patterns/externalized-configuration.html) new - 把类似数据库连接、访问密钥等配置信息外部化\n\n# 通讯模式(Communication patterns)\n\n## éŁŽć ź\n\nĺş”čŻĽé€‰ć‹Šć€Žć ˇçš„é€šäżĄćœşĺˆśćĽčż›čĄŒćœĺŠĄé—´é€ščŽŻĺ’Œĺ¤–éƒ¨ĺŽ˘ćˆˇçŤŻé€ščŽŻďźŸ\n\n- [远程过程调用(Remote Procedure Invocation)](communication-style/rpi.html) - 使用基于 RPI 协议的服务间通讯方式\n- [月息Messaging)](communication-style/messaging.html) - 使用异步消息进行服务间通讯\n- [领域独用协议(Domain-specific protocol)](communication-style/domain-specific.html) new - 使用特定领域的通讯协议(如 SIP,等)\n\n## 外部 API\n\n如何处理外部客户端与服务之间的通讯?\n\n- [API 网关(API gateway)](apigateway.html) - 为每一类客户端提供一个访问服务的独特接口\n- [服务前端的后端(Backend for front-end)](apigateway.html) - 为每一类客户端都提供一个独立的 API 网关\n\n## 服务发现\n\n一个基于 RPI 的客户端如何在网络上发现服务实例的位置?\n\n- [客户端服务发现(Client-side discovery)](client-side-discovery.html) - 客户端通过直接查询服务注册表获取服务实例的位置\n- [服务器端服务发现(Server-side discovery)](server-side-discovery.html) - 路由模块通过查询服务注册表获取服务实例的位置\n- [服务注册表(Service registry)](service-registry.html) - 一个记录了服务实例位置的数据\n- [自注册(Self registration)](self-registration.html) - 服务实例自己完成向服务注册表的注册\n- [第三方注册(3rd party registration)](3rd-party-registration.html) - 通过第三方模块来进行服务实例信息到服务注册表的注册过程\n\n## ĺŻé ć€§\n\n如何避免由于服务故障或网络中断所引起的故障蔓延到其他服务?\n\n- [断路器(Circuit Breaker)](reliability/circuit-breaker.html) - 当远端服务返回的故障率超过一定的阀值时,客户端代理(比如 API 网关)对远程服务的调用将立刻返回失败的信息\n\n# 数据管理(Data management)\n\n如何实现数据一致性和查询?\n\n- [每服务数据库(Database per Service)](data/database-per-service.html) - 每个服务都拥有它私有的数据库\n- [共享数据库(Shared database)](data/shared-database.html) - 服务之间共享同一个数据库\n- [事件驱动架构(Event-driven architecture)](data/event-driven-architecture.html) - 使用事件来维护服务间的数据一致性\n- [事件溯源(Event sourcing)](data/event-sourcing.html) - 以一连串事件的方式来持久化聚合\n- [事务日志跟踪(Transaction log tailing)](data/transaction-log-tailing.html) - 跟踪数据库的日志变更并由此对外发布消息\n- [数据库触发器(Database triggers)](data/database-triggers.html) - 使用触发器来捕获对数据的修改\n- [应用程序事件(Application events)](/patterns/cn/data/transactional-outbox.html) - 应用程序从消息队列获取事件并插入数据库中\n- [命令查询职责分离(CQRS)](data/cqrs.html) - 维护一个或者多个重要的数据视图以供高效率的查询\n\n# 安全(Security)\n\nĺŚ‚ä˝•ĺ‘ćœĺŠĄĺŽžäž‹äź é€’čŽżé—ŽĺŽ˘ćˆˇçŤŻçš„čşŤäť˝äżĄćŻďźŸ\n\n- [访问令牌(Access Token)](security/access-token.html) new - ćœĺŠĄĺŽžäž‹é€ščż‡čŽżé—Žäť¤ç‰ŒćĽĺŽ‰ĺ…¨ĺœ°äź é€’ĺŽ˘ćˆˇçŤŻçš„čşŤäť˝äżĄćŻ\n\n# 测试(Testing)\n\n如何更便捷的测试?\n\n- [服务组件测试(Service Component Test)](testing/service-component-test.html)new - a test suite that tests a service in isolation using test doubles for any services that it invokes\n- [服务集成协议测试(Service Integration Contract Test)](testing/service-integration-contract-test.html)new - a test suite for a service that is written by the developers of another service that consumes it\n\n# 可观测性(Observability)\n\n如何掌握一个运行中微服务应用的行为并进行有效的故障排错?\n\n- [应用日志(Log aggregation)](observability/application-logging.html) new - 聚合应用程序产生的日志文件\n- [ĺş”ç”¨ćŒ‡ć ‡ďźˆApplication metrics)](observability/application-metrics.html) new - ĺœ¨äťŁç ä¸­ĺŽžçŽ°ć”śé›†ĺş”ç”¨čżčĽčż‡ç¨‹ä¸­ĺ„çąťćŒ‡ć ‡çš„ĺŠŸčƒ˝\n- [审计日志(Audit logging)](observability/audit-logging.html) new - ćŠŠç”¨ćˆˇčĄŒä¸şčŽ°ĺ˝•ĺœ¨ć•°ćŽĺş“ä¸­äž›ć—ĽĺŽć ¸ćŸĽ\n- [分布式追踪(Distributed tracing)](observability/distributed-tracing.html)new - ĺœ¨ćœĺŠĄäťŁç ä¸­é’ˆĺŻšćŻä¸€ä¸Şĺ¤–éƒ¨čŽżé—ŽďźŒéƒ˝ĺˆ†é…ä¸€ä¸Şĺ”Żä¸€çš„ć ‡čŻ†çŹŚďźŒĺšśĺœ¨čˇ¨ćœĺŠĄčŽżé—Žć—śäź é€’čż™ä¸Şć ‡čŻ†çŹŚäťĽäž›čż˝č¸Şĺˆ†ĺ¸ƒĺźĺź•ĺ‘çš„é—Žé˘˜ă€‚äž‹ĺŚ‚ďźŒĺ˝“é€ščż‡ä¸€ä¸Şé›†ä¸­ĺźćœĺŠĄĺ¤„ç†ĺ¤–éƒ¨čŻˇćą‚ć—śďźŒčŽ°ĺ˝•čŻˇćą‚ćœŹčşŤçš„äżĄćŻäťĽĺŠčŻˇćą‚çš„ĺź€ĺ§‹ĺ’Œçť“ćŸć—śé—´ă€‚\n- [异常追踪(Exception tracking)](observability/exception-tracking.html)new - ćŠŠć‰€ćœ‰ćœĺŠĄç¨‹ĺşäťŁç č§Śĺ‘çš„ĺź‚ĺ¸¸äżĄćŻéƒ˝ćą‡čšĺˆ°é›†ä¸­çš„ĺź‚ĺ¸¸čż˝č¸ŞćœĺŠĄďźŒĺšść šćŽä¸€ĺŽšçš„é€ťčž‘ĺŻšĺź€ĺ‘č€…ćˆ–čżçť´äşşĺ‘˜ĺ‘ĺ‡şé€šçŸĽă€‚\n- [健康检查 APIHealth check API)](observability/health-check-api.html) new - 一个监控服务可调用的 API,通常返回服务健康度信息,或对 ping 等心跳检查请求做出响应。\n\n# UI 模式(UI patterns)\n\n如何将源自多个服务的信息组织在一起生成 UI 界面或 Web 页面?\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťşďźˆServer-side page fragment composition)](ui/server-side-page-fragment-composition.html)new - 在服务器端通过编排由多个业务或领域相关后端服务生成的 HTML 片段来构建前端输出的页面内容\n- [厢戡獯 UI 构建(Client-side UI composition)](ui/client-side-ui-composition.html)new - 在客户端通过编排由多个业务或领域相关 UI 组件生成的 HTML 片段来构建前端输出的页面内容\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 13745, "slov": 615, "odkazu": 99, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:49", "sha256": "b085caa5a75b84621f1819a84444a1bdec3cbf0bc32edb022338faadec2ad6f7", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://book.douban.com/subject/1471535/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/3rd-party-registration.html", "titulek": "3rd Party Registration Pattern", "h1": "模式: 第三方注册", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "模式: 第三方注册"}, {"uroven": 2, "text": "背景"}, {"uroven": 2, "text": "问题"}, {"uroven": 2, "text": "需求"}, {"uroven": 2, "text": "方案"}, {"uroven": 2, "text": "示例"}, {"uroven": 2, "text": "结果"}, {"uroven": 2, "text": "相关模式"}, {"uroven": 2, "text": "致谢"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# 模式: 第三方注册\n\n## 背景\n\n如采用[客户端服务发现模式](client-side-discovery.html)或者[服务器端服务发现模式](client-side-discovery.html),各服务实例必须在启动时注册至服务注册表,从而保证其能够被获取,并在关闭时进行注销。\n\n## 问题\n\n如何在服务注册表内注册和注销服务实例?\n\n## 需求\n\n- 各服务实例必须在启动时被注册至服务注册表,并在关闭时进行注销。\n- 崩溃的服务实例必须从服务注册表中注销。\n- ĺœ¨čżčĄŒä˝†ć— ĺŠ›ĺ¤„ç†čŻˇćą‚çš„ćœĺŠĄĺŽžäž‹ĺż…éĄťäťŽćœĺŠĄćł¨ĺ†ŒčĄ¨ä¸­ćł¨é”€ă€‚\n\n## 方案\n\n由第三方注册机制负责各项服务实例在服务注册表中的注册与注销。当该服务实例启动时,其将服务实例注册至服务注册表。而在服务实例关闭时,其将该服务实例从服务注册表中注销。\n\n## 示例\n\n第三方注册模式的示例包括:\n\n- [Netflix Prana](https://github.com/Netflix/Prana) - 这是一款“边车”类应用,可与非JVM应用共同运行并利用Eureka为该应用注册。\n- [AWS Autoscaling Groups](http://aws.amazon.com/autoscaling/) - 能够自动将EC2实例注册(注销)至Elastic Load Balancer。\n- [Joyent的Container buddy](https://github.com/joyent/containerbuddy) 运行在Docker容器当中,作为服务的父进程并将其注册至注册表。\n- [Registrator](https://github.com/gliderlabs/registrator) - 能够将Docker容器注册至多种服务注册表,或者从其注销。\n- [䝼Kubernetes](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/services.md) 与 [Marathon](https://mesosphere.github.io/marathon/docs/service-discovery-load-balancing.html) 为代表的各类集群框架将服务实例注册至内置/隐式的注册表,或者从其注销。\n\n## 结果\n\n第三方注册模式的优势在于:\n\n- 与 [自注册](self-registration.html) ć¨Ąĺźç›¸ćŻ”ďźŒćœĺŠĄäťŁç ĺ¤ć‚ç¨‹ĺşŚć›´ä˝ŽďźŒĺ› ä¸şĺ…ść— éœ€ĺŽžçŽ°č‡ŞĺŠ¨ćł¨ĺ†Œă€‚\n- ćł¨ĺ†ŒĺˇĽĺ…ˇĺŻĺŻšćœĺŠĄĺŽžäž‹ć‰§čĄŒĺĽĺşˇćŁ€ćŸĽďźŒĺšść šćŽćŁ€ćŸĽçť“ćžœćł¨ĺ†Œćˆ–č€…ćł¨é”€čŻĽĺŽžäž‹ă€‚\n\n但第三方注册模式也存在着以下弊端:\n\n- çŹŹä¸‰ć–šćł¨ĺ†Œć¨ĄĺźĺŻčƒ˝ĺŞäş†č§ŁćœĺŠĄĺŽžäž‹çš„ä¸€äş›čĄ¨ĺą‚çŠść€ďźŒäž‹ĺŚ‚ĺ…ść˜ŻĺŚć­Łĺœ¨čżčĄŒďźŒĺ› ć­¤ ć— ćł•äş†č§Łĺ…ść˜ŻĺŚčƒ˝ĺ¤Ÿĺ¤„ç†čŻˇćą‚ă€‚ä¸čż‡ďźŒäš‹ĺ‰ćĺˆ°çš„Netflix Prana等注册工具能够通过执行健康检查来判断当前服务实例的可用性。\n- é™¤éžčŻĽćł¨ĺ†ŒĺˇĽĺ…ˇĺąžäşŽĺŸşçĄ€čŽžć–˝çš„ä¸€éƒ¨ĺˆ†ďźŒĺŚĺˆ™ćˆ‘äťŹéœ€čŚĺŻšĺ…śčż›čĄŒĺŽ‰čŁ…ă€é…ç˝Žä¸Žçť´ćŠ¤ă€‚ĺŚĺ¤–ďźŒĺ› ä¸şĺŽƒć˜Żĺ…łé”ŽçłťçťŸçť„äťśďźŒĺ› ć­¤éœ€čŚäżčŻĺ…śĺ…ˇćœ‰éŤ˜ĺşŚĺŻç”¨ć€§ă€‚\n\n## 相关模式\n\n- [服务注册表](service-registry.html)\n- [客户端服务发现](client-side-discovery.html)\n- [服务器端服务发现](server-side-discovery.html)\n- [自注册](self-registration.html) 是一个备选方案。\n\n## 致谢\n\nä¸şäş†éżĺ…é‡ĺ¤çżťčŻ‘ďźŒćœŹć–‡ć šćŽä¸­ĺ›˝ć™Žĺ…ƒĺ…Źĺ¸ĺŽ‹ć˝‡ć–‡ĺ…ˆç”Ÿçš„[译文](http://blog.csdn.net/xn_sung/article/details/52336777)整理修订,在此向宋潇文先生表示感谢!\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 8069, "slov": 339, "odkazu": 69, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:10:59", "sha256": "eeb3039f2c078672e1f1ae3e325ffad20759e32d3289f52bd7b8469db722e3ed", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://github.com/Netflix/Prana", "http://aws.amazon.com/autoscaling/", "https://github.com/joyent/containerbuddy", "https://github.com/gliderlabs/registrator", "https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/services.md", "https://mesosphere.github.io/marathon/docs/service-discovery-load-balancing.html", "http://blog.csdn.net/xn_sung/article/details/52336777", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/apigateway.html", "titulek": "API gateway pattern", "h1": "模式:API 网关", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "模式:API 网关"}, {"uroven": 2, "text": "背景"}, {"uroven": 2, "text": "问题"}, {"uroven": 2, "text": "需求"}, {"uroven": 2, "text": "方案"}, {"uroven": 2, "text": "示例"}, {"uroven": 2, "text": "结果"}, {"uroven": 2, "text": "相关模式"}, {"uroven": 2, "text": "已知用例"}, {"uroven": 2, "text": "致谢"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# 模式:API 网关\n\n## 背景\n\n假设我们正在利用[微服务模式](microservices.html)构建一套在线商店,并要包含产品细节页面,需要为产品信息用户界面开发出多个版本:\n\n- 基于HTML5/JavaScript的用户界面,用于桌面与移动浏览器 —— HTML由服务器端Web应用生成。\n- 原生Android与iPhone客户端——这些客户端通过REST API与服务器进行交互。\n\n另外,在线商店必须通过REST API发布产品细节,以供第三方应用程序使用。\n\n产品细节UI可以显示出大量产品信息。举例来说,Amazon.com的 POJOs in Action 图书详情页面中会显示:\n\n- ć­¤äšŚçš„ĺŸşćœŹäżĄćŻďźŒĺŚ‚ć ‡é˘˜ă€ä˝œč€…ă€äťˇć źç­‰\n- 书籍的购买记录\n- 库存\n- 购买选项\n- 经常与此书籍搭配购买的货品\n- 买过此书的买家经常购买的其它货品\n- 客户评论\n- 卖家排名\n- ……\n\n在使用微服务模式的在线商店中,产品详情数据会分布在多项服务之间,例如:\n\n- äş§ĺ“äżĄćŻćœĺŠĄâ€”äş§ĺ“çš„ĺŸşćœŹäżĄćŻďźŒĺŚ‚ć ‡é˘˜ä¸Žä˝œč€…ç­‰\n- äťˇć źćœĺŠĄâ€”äş§ĺ“äťˇć ź\n- 订单服务—产品的购买历史\n- 库存服务—当前产品的可购买数量\n- 评论服务—客户评论\n- ……\n\nĺ› ć­¤ďźŒć˜žç¤şäş§ĺ“čŻŚćƒ…çš„äťŁç éœ€čŚäťŽčż™äş›ćœĺŠĄä¸­čŽˇĺ–äżĄćŻă€‚\n\n## 问题\n\n微服务架构的应用客户端如何访问各项服务?\n\n## 需求\n\n- 微服务提供的API粒度通常与客户端需要的有所不同。微服务通常提供的是细粒度API,这意味着客户端需要同多项服务进行交互。举例来说,如之前所提到的,客户端需要从多项服务处获取数据方可获得产品详情。\n- 不同客户端需要不同的数据。举例来说,有产品详情页面的桌面浏览器版本通常较移动版复杂。\n- 不同客户端的网络性能亦有所区别。举例来说,移动网络通常较非移动网络速度更慢且更延迟。当然,广域网速度也必然低于局域网。这意味着原生移动客户端所使用的网络在性能上与服务器端Web应用采用的局域网完全不同。服务器端Web应用能够向后端服务发送多条请求,而且不会影响到用户体验,但移动客户端则只能发送少量请求。\n- 服务实例数量与其位置(主机与端口)会发生动态变化。\n- 服务的划分方式会随时间的推移而改变,且不应被客户端所感知。\n\n## 方案\n\n使用 API 网关作为全部客户端的单一入口点。该 API 网关通过以下两种方式之一处理请求。部分请求会被直接代理/路由至对应的服务,另一部分请求则需要接入多项服务。\n\n相比提供满足所有需求的API,API网关可以针对不同客户端提供出不同的API。举例来说,[Netflix API 网关](http://techblog.netflix.com/2012/07/embracing-differences-inside-netflix.html)čżčĄŒçš„ć˜ŻĺŽ˘ćˆˇçŤŻç‰šĺŽšé€‚é…äťŁç ďźŒčż™ç§äťŁç čƒ˝ĺ¤Ÿä¸şĺ„ĺŽ˘ćˆˇçŤŻćäž›ćœ€çŹŚĺˆĺ…śéœ€ćą‚çš„API。\n\nAPI网关还能够实现安全防护,例如验证当前客户端是否有权执行该请求。\n\n## 示例\n\n[Netflix 的 API 网关](http://techblog.netflix.com/2013/01/optimizing-netflix-api.html)\n\n## 结果\n\nAPI网关有以下优势:\n\n- çĄŽäżĺŽ˘ćˆˇçŤŻć— ćł•ĺŻŸč§‰ĺş”ç”¨ç¨‹ĺşć˜ŻĺŚ‚ä˝•č˘Ťć‹†ĺˆ†ä¸şĺ¤šéĄšĺžŽćœĺŠĄçš„ă€‚\n- 确保客户端不受服务实例的位置的影响。\n- 为每套客户端提供最优API。\n- 降低请求/往返次数。举例来说,API网关能够确保客户端在单次往返中就从多项服务中检索出数据。请求数量更少意味着运行负担更低且用户体验更好。API网关对于移动应用而言是必不可少的。\n- 将从客户端调用多项服务的逻辑转换为从API网关处调用,从而简化整个客户端。\n\nAPI网关模式也有一些弊端:\n\n- 复杂性高—API网关是另外一种需要开发、部署与管理的活动部件。\n- APIç˝‘ĺ…łäźšé€ ćˆĺ¤šä˝™çš„ç˝‘çťœčˇłč˝ŹďźŒäťŽč€Œĺ˘žĺŠ ĺ“ĺş”ć—śé—´â€”ä¸čż‡ĺŻšäşŽĺ¤§ĺ¤šć•°ĺş”ç”¨ç¨‹ĺşč€Œč¨€ďźŒä¸€ćŹĄĺ¤šä˝™çš„ĺž€čż”ĺšśä¸äźšé€ ćˆäť€äšˆĺ˝ąĺ“ă€‚\n\n问题:\n\n- 如何实现API网关?如果需要不断扩展以处理高负载量,那么事件驱动型/响应型方案是最理想的选择。在JVM上,Netty、Spring Reactor等基于NIO的库大有用处。Node.JS也是一个可行的选项。\n\n## 相关模式\n\n- [微服务架构模式](microservices.html) 催生了 API 网关模式。\n- API 网关必须使用 [客户端服务发现模式](client-side-discovery.html) 或 [服务器端服务发现模式](server-side-discovery.html) 将请求路由到可用的服务实例。\n- API ç˝‘ĺ…łĺż…éĄťĺż…éĄťéŞŒčŻç”¨ćˆˇčşŤäť˝ĺšśĺœ¨ćœĺŠĄč°ƒç”¨äš‹é—´äź é€’ĺŒ…ć‹Źç”¨ćˆˇäżĄćŻçš„ [访问令牌](security/access-token.html) 。\n- API 网关对服务的调用都会经过一个 [断路器](reliability/circuit-breaker.html) 。\n\n## 已知用例\n\n- [Netflix 的 API 网关](http://techblog.netflix.com/2012/07/embracing-differences-inside-netflix.html)\n\n## 致谢\n\nä¸şäş†éżĺ…é‡ĺ¤çżťčŻ‘ďźŒćœŹć–‡ć šćŽä¸­ĺ›˝ć™Žĺ…ƒĺ…Źĺ¸ĺŽ‹ć˝‡ć–‡ĺ…ˆç”Ÿçš„[译文](http://blog.csdn.net/xn_sung/article/details/52318969)整理修订,在此向宋潇文先生表示感谢!\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 10129, "slov": 402, "odkazu": 66, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:06", "sha256": "290da751995531c1b520dfc54c4d7ebb7b24351db4c9edd5277b8a5b799cbdb1", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "http://techblog.netflix.com/2012/07/embracing-differences-inside-netflix.html", "http://techblog.netflix.com/2013/01/optimizing-netflix-api.html", "http://blog.csdn.net/xn_sung/article/details/52318969", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/client-side-discovery.html", "titulek": "Client-side service discovery pattern", "h1": "模式: 客户端服务发现", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "模式: 客户端服务发现"}, {"uroven": 2, "text": "背景"}, {"uroven": 2, "text": "问题"}, {"uroven": 2, "text": "需求"}, {"uroven": 2, "text": "方案"}, {"uroven": 2, "text": "例子"}, {"uroven": 2, "text": "结果"}, {"uroven": 2, "text": "相关模式"}, {"uroven": 2, "text": "致谢"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# 模式: 客户端服务发现\n\n## 背景\n\nä¸ĺŒćœĺŠĄäš‹é—´é€šĺ¸¸éœ€čŚç›¸äş’č°ƒç”¨ă€‚ĺœ¨ĺ•ä˝“ĺş”ç”¨ç¨‹ĺşĺ˝“ä¸­ďźŒćœĺŠĄé—´é€ščż‡čŻ­č¨€ĺą‚çş§çš„ć–šćł•ćˆ–č€…čż‡ç¨‹ĺŽžçŽ°ç›¸äş’č°ƒç”¨ă€‚ĺœ¨äź çťŸçš„ĺˆ†ĺ¸ƒĺźçłťçťŸéƒ¨ç˝˛ä¸‹ďźŒćœĺŠĄĺœ¨ĺ›şĺŽšĺšśä¸”ĺˇ˛çŸĽçš„ä˝ç˝Žďźˆä¸ťćœşä¸ŽçŤŻĺŁďź‰čżčĄŒďźŒäťŽč€ŒçĄŽäżĺ„ćœĺŠĄĺŻĺˆŠç”¨HTTP/REST或者某种RPC机制进行相互调用。然而,现代化[微服务应用程序](microservices.html)ä¸­é€šĺ¸¸ĺœ¨č™šć‹ŸĺŒ–ćˆ–č€…ĺŽšĺ™¨ĺŒ–çŽŻĺ˘ƒä¸­čżčĄŒďźŒĺœ¨čż™ć ˇçš„çŽŻĺ˘ƒä¸­ćœĺŠĄçš„ĺŽžäž‹ć•°é‡ĺ’Œä˝ç˝Žć˜ŻĺŠ¨ć€ĺ˜ĺŒ–çš„ă€‚\n\nĺ› ć­¤ďźŒčŚćƒłĺŽžçŽ°ĺŽ˘ćˆˇçŤŻĺ‘ĺŠ¨ć€ĺ˜ĺŒ–çš„ä¸€çť„ćœĺŠĄçŤŻĺŽžäž‹ĺ‘é€čŻˇćą‚ďźŒćˆ‘äťŹĺż…éĄťé‡‡ç”¨ć–°çš„ćœşĺˆśă€‚\n\n## 问题\n\n服务的客户端——包括API网关或者其它服务——如何才能获取服务端实例的位置?\n\n## 需求\n\n- 每一服务实例都会在特定位置(主机与端口)通过HTTP/REST或者Thrift等方式发布一个远程API。\n- 服务端实例的具体数量及位置会发生动态变化。\n- 虚拟机与容器通常会被分配动态IP地址。\n- 服务实例的数量会发生动态变化。例如,ECč‡ŞĺŠ¨äź¸çźŠçť„äźšć šćŽč´Ÿč˝˝ćƒ…ĺ†ľéšć—śč°ƒć•´ĺŽžäž‹ć•°é‡ă€‚\n\n## 方案\n\n在向某一服务发送请求时,客户端会通过查询 Service Registry,即[服务注册表](service-registry.html),以获取该服务实例的位置。该注册表中包含全部服务的位置。\n\n以下示意图展现了这种模式的结构:\n\n而这正是[微服务基底框架](microservice-chassis.html)的典型处理方式。\n\n## 例子\n\n[Netflix OSS](http://netflix.github.io/) 正是客户端发现机制的典型代表:\n\n- [Eureka](https://github.com/Netflix/eureka/wiki/Eureka-at-a-glance) 充当其中的 [服务注册表](service-registry.html)\n- [Ribbon Client](https://github.com/Netflix/ribbon) 是一套HTTP客户端,负责向 Eureka 发出查询任务并将 HTTP 请求路由至可用的服务实例。\n\n## 结果\n\n客户端发现机制拥有以下优势:\n\n- 相较于 [服务器端服务发现](server-side-discovery.html) ,其活动部件与网络中转数量更少。\n\n客户端发现机制亦存在着以下弊端:\n\n- 这一模式使客户端与 [服务注册表](service-registry.html) 相耦合。\n- 需要为应用程序中使用的每种编程语言/框架建立客户端服务发现逻辑,例如Java/Scala以及JavaScript/Node JS。举例来说, [Netflix Prana](https://github.com/Netflix/Prana) 就为非 JVM 客户端提供了一套基于HTTP代理的服务发现方案。\n\n## 相关模式\n\n- [服务注册表](service-registry.html) - 服务发现的基础\n- [微服务的基底](microservice-chassis.html) - 客户端服务发现是微服务基底模块的职责之一\n- [服务器端服务发现](server-side-discovery.html) 是另一种可选的方案\n\n## 致谢\n\nä¸şäş†éżĺ…é‡ĺ¤çżťčŻ‘ďźŒćœŹć–‡ć šćŽä¸­ĺ›˝ć™Žĺ…ƒĺ…Źĺ¸ĺŽ‹ć˝‡ć–‡ĺ…ˆç”Ÿçš„[译文](http://blog.csdn.net/xn_sung/article/details/52336732)整理修订,在此向宋潇文先生表示感谢!\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 8007, "slov": 325, "odkazu": 67, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:17", "sha256": "138e5ce084f6377e31081645900bb210a7eb5686e3bd53723cb29f076a1ed80f", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "http://netflix.github.io/", "https://github.com/Netflix/eureka/wiki/Eureka-at-a-glance", "https://github.com/Netflix/ribbon", "https://github.com/Netflix/Prana", "http://blog.csdn.net/xn_sung/article/details/52336732", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/communication-style/domain-specific.html", "titulek": "Domain-specific protocol", "h1": "Pattern: Domain-specific protocol", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Domain-specific protocol"}, {"uroven": 2, "text": "Summary"}, {"uroven": 2, "text": "Examples"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Domain-specific protocol\n\n## Summary\n\nUse a domain-specific protocol for inter-service communication.\n\n- The [Messaging](messaging.html) pattern is an alternative pattern\n- The [RPI](rpi.html) pattern is an alternative pattern\n\n## Examples\n\nThere are numerous domain-specific protocols including:\n\n- Email protocols such as SMTP and IMAP\n- Media streaming protocols such as RTMP, HLS, and HDS\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5444, "slov": 277, "odkazu": 60, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:37", "sha256": "83625683acae34a8049fce35b4d096707af44664c3e5f97ffeb2d12f952129e4", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/communication-style/messaging.html", "titulek": "Messaging", "h1": "Pattern: Messaging", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Messaging"}, {"uroven": 2, "text": "Summary"}, {"uroven": 2, "text": "Examples"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Messaging\n\n## Summary\n\nUse asynchronous messaging for inter-service communication.\n\n- The [Domain-specific protocol](domain-specific.html) pattern is an alternative pattern\n- The [RPI](rpi.html) pattern is an alternative pattern\n\n## Examples\n\nThere are numerous examples of asynchronous messaging technologies\n\n- [Apache Kafka](http://kafka.apache.org)\n- [RabbitMQ](https://www.rabbitmq.com/)\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5444, "slov": 264, "odkazu": 62, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:53", "sha256": "2c1fe2f082656900ad9fa42d6a8ab58235411b459e771d411333a36251c51f72", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "http://kafka.apache.org/", "https://www.rabbitmq.com/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/communication-style/rpi.html", "titulek": "Remote Procedure Invocation (RPI)", "h1": "Pattern: Remote Procedure Invocation (RPI)", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Remote Procedure Invocation (RPI)"}, {"uroven": 2, "text": "Summary"}, {"uroven": 2, "text": "Examples"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Remote Procedure Invocation (RPI)\n\n## Summary\n\nUse RPI for inter-service communication.\n\n- The [Domain-specific protocol](domain-specific.html) is an alternative pattern\n- The [Messaging](messaging.html) is an alternative pattern\n\n## Examples\n\nThere are numerous examples of RPI technologies\n\n- [REST](https://en.wikipedia.org/wiki/Representational_state_transfer)\n- [gRPC](http://www.grpc.io/)\n- [Apache Thrift](https://thrift.apache.org/)\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5491, "slov": 264, "odkazu": 63, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:04", "sha256": "09fa30c666304792a89b8ba8ec6c2af2aba4e5b5d7c120d2ad4144d3496397f3", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://en.wikipedia.org/wiki/Representational_state_transfer", "http://www.grpc.io/", "https://thrift.apache.org/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/data/application-events.html", "titulek": "Application publishes events", "h1": "Pattern: Application publishes events", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Application publishes events"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Application publishes events\n\n## Problem\n\nHow to reliably/atomically publish events whenever state changes\n\n## Solution\n\nThe application insert events into an `EVENTS` table as part of the local transaction.\nA separate process polls the `EVENTS` table and publishes the events to a message broker.\n\n- The [Event-driven architecture pattern](event-driven-architecture.html) creates the need for this pattern.\n- The [Event sourcing](event-sourcing.html) is an alternative pattern\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5528, "slov": 289, "odkazu": 60, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:08", "sha256": "3e3ba7c6504332b15244dd037a2952248cdbb9e1be2eeb63400e0b871157c8c8", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/data/cqrs.html", "titulek": "Command Query Responsibility Segregation (CQRS)", "h1": "Pattern: Command Query Responsibility Segregation (CQRS)", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Command Query Responsibility Segregation (CQRS)"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Command Query Responsibility Segregation (CQRS)\n\n## Problem\n\nHow to implement queries in a microservice architecture\n\n## Solution\n\nSplit the application into two parts: the command-side and the query-side.\nThe command-side handles create, update, and delete requests and emits events when data changes.\nThe query-side handles queries by executing them against one or more materialized views that are kept up to date by subscribing to the stream of events emitted when data changes.\n\n- The [Database per Service pattern](database-per-service.html) creates the need for this pattern\n- The [Event-driven architecture](event-driven-architecture.html) pattern generates the event stream\n- The [Event sourcing](event-sourcing.html) is often used with CQRS\n\n## Examples\n\n- See the [Eventuate example applications](http://eventuate.io/exampleapps.html) , which use event sourcing and CQRS.\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5930, "slov": 346, "odkazu": 61, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:24", "sha256": "b90a790286f9f872823d469b2b558da8ba002d6ecf62cb1fa6678b63077de1e2", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/data/database-per-service.html", "titulek": "Database per service", "h1": "Pattern: Database per service", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Database per service"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Resulting context"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Database per service\n\n## Context\n\nLet’s imagine you are developing an online store application using the [Microservice architecture pattern](/patterns/microservices.html).\nMost services need to persist data in some kind of database.\nFor example, the `Order Service` stores information about orders and the `Customer Service` stores information about customers.\n\n## Problem\n\nWhat’s the database architecture in a microservices application?\n\n## Forces\n\n- Services must be loosely coupled so that they can be developed, deployed and scaled independently\n- Some business transactions must enforce invariants that span multiple services.\nFor example, the `Place Order` use case must verify that a new Order will not exceed the customer’s credit limit.\nOther business transactions, must update data owned by multiple services.\n- Some business transactions need to query data that is owned by multiple services.\nFor example, the `View Available Credit` use must query the Customer to find the `creditLimit` and Orders to calculate the total amount of the open orders.\n- Some queries must join data that is owned by multiple services.\nFor example, finding customers in a particular region and their recent orders requires a join between customers and orders.\n- Databases must sometimes be replicated and sharded in order to scale. See the [Scale Cube](/articles/scalecube.html).\n- Different services have different data storage requirements.\nFor some services, a relational database is the best choice.\nOther services might need a NoSQL database such as MongoDB, which is good at storing complex, unstructured data, or Neo4J, which is designed to efficiently store and query graph data.\n\n## Solution\n\nKeep each microservice’s persistent data private to that service and accessible only via its API.\nThe following diagram shows the structure of this pattern.\n\nThe service’s database is effectively part of the implementation of that service.\nIt cannot be accessed directly by other services.\n\nThere are a few different ways to keep a service’s persistent data private.\nYou do not need to provision a database server for each service.\nFor example, if you are using a relational database then the options are:\n\n- Private-tables-per-service – each service owns a set of tables that must only be accessed by that service\n- Schema-per-service – each service has a database schema that’s private to that service\n- Database-server-per-service – each service has it’s own database server.\n\nPrivate-tables-per-service and schema-per-service have the lowest overhead.\nUsing a schema per service is appealing since it makes ownership clearer.\nSome high throughput services might need their own database server.\n\nIt is a good idea to create barriers that enforce this modularity.\nYou could, for example, assign a different database user id to each service and use a database access control mechanism such as grants.\nWithout some kind of barrier to enforce encapsulation, developers will always be tempted to bypass a service’s API and access it’s data directly.\n\n## Resulting context\n\nUsing a database per service has the following benefits:\n\n- Helps ensure that the services are loosely coupled.\nChanges to one service’s database does not impact any other services.\n- Each service can use the type of database that is best suited to its needs.\nFor example, a service that does text searches could use ElasticSearch.\nA service that manipulates a social graph could use Neo4j.\n\nUsing a database per service has the following drawbacks:\n\n- Implementing business transactions that span multiple services is not straightforward.\nDistributed transactions are best avoided because of the CAP theorem.\nMoreover, many modern (NoSQL) databases don’t support them.\nThe best solution is to use an [eventually consistent, event-driven architecture](event-driven-architecture.html).\nServices publish events when they update data.\nOther services subscribe to events and update their data in response.\n- Implementing queries that join data that is now in multiple databases is challenging.\nThere are various solutions:\n- Application-side joins - the application performs the join rather than the database.\n For example, a service (or the API gateway) could retrieve a customer and their orders by first retrieving the customer from the customer service and then querying the order service to return the customer’s most recent orders.\n- Command Query Responsibility Segregation (CQRS) - maintain one or more materialized views that contain data from multiple services.\n The views are kept by services that subscribe to events that each services publishes when it updates its data.\n For example, the online store could implement a query that finds customers in a particular region and their recent orders by maintaining a view that joins customers and orders.\n The view is updated by a service that subscribes to customer and order events.\n- Complexity of managing multiple SQL and NoSQL databases\n\n- [Microservice architecture pattern](/patterns/microservices.html) creates the need for this pattern\n- [Event-driven architecture pattern](event-driven-architecture.html) is a useful way to implement eventually consistent transactions\n- The [Command Query Responsibility Segregation (CQRS) pattern](cqrs.html) is a useful way to implement complex queries\n- The [Shared Database anti-pattern](shared-database.html) describes the problems that result from microservices sharing a database\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 10484, "slov": 1033, "odkazu": 63, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:26", "sha256": "fcd6e1bea7ba647a96ead78603e90a71e47ba95ffd46c8001c005c12d159d94c", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/data/database-triggers.html", "titulek": "Publish events using database triggers", "h1": "Pattern: Publish events using database triggers", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Publish events using database triggers"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Publish events using database triggers\n\n## Problem\n\nHow to reliably/atomically publish events whenever state changes\n\n## Solution\n\nOne or more database triggers insert events into an `EVENTS` table, which is polled by a separate process that publishes the events.\n\n- The [Event-driven architecture pattern](event-driven-architecture.html) creates the need for this pattern.\n- The [Event sourcing](event-sourcing.html) is an alternative pattern\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5496, "slov": 284, "odkazu": 60, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:28", "sha256": "5460a00235623354a761bd99a096236760aed47dba6cf696271b1bcc2f647ebf", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/data/event-driven-architecture.html", "titulek": "Event-driven architecture", "h1": "Pattern: Event-driven architecture", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Event-driven architecture"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "Example"}, {"uroven": 2, "text": "See also"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Event-driven architecture\n\n## Problem\n\nYou have applied the [Database per Service](database-per-service.html) pattern.\nEach service has its own database.\nSome business transactions, however, span multiple service so you need a mechanism to ensure data consistency across services.\n\nFor example, lets imagine that you are building an e-commerce store where customers have a credit limit.\nThe application must ensure that a new order will not exceed the customer’s credit limit.\nSince Orders and Customers are in different databases the application cannot simply use a local ACID transaction.\nIn theory, it could use a distributed transaction that spans the `Customer Service` and the `Order Service`.\nHowever, for a variety of reasons distributed transactions are not a viable choice for most modern applications.\n\n## Solution\n\nUse an event-driven, eventually consistent approach.\nEach service publishes an event whenever it update its data.\nOther service subscribe to events.\nWhen an event is received, a service updates its data.\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- It enables an application to maintain data consistency across multiple services without using distributed transactions\n\nThis solution has the following drawbacks:\n\n- The programming model is more complex\n\nThere are also the following issues to address:\n\n- In order to be reliable, an application must atomically update its database and publish an event.\nIt cannot use the traditional mechanism of a distributed transaction that spans the database and the message broker.\nInstead, it must use one the patterns listed below.\n\n## Example\n\nAn e-commerce application that uses this approach would work as follows:\n\n1. The `Order Service` creates an Order in a *pending* state and publishes an `OrderCreated` event.\n2. The `Customer Service` receives the event and attempts to reserve credit for that Order. It then publishes either a `Credit Reserved` event or a `CreditLimitExceeded` event.\n3. The `Order Service` receives the event from the `Customer Service` and changes the state of the order to either *approved* or *cancelled*\n\n- The [Database per Service pattern](database-per-service.html) creates the need for this pattern\n- The following patterns are ways to *atomically* update state *and* publish events:\n - [Event sourcing](event-sourcing.html)\n - [Transactional Outbox](/patterns/cn/data/transactional-outbox.html)\n - [Database triggers](database-triggers.html)\n - [Transaction log tailing](transaction-log-tailing.html)\n\n## See also\n\nThe article [Event-Driven Data Management for Microservices](https://www.nginx.com/blog/event-driven-data-management-microservices/) by @crichardson describes this pattern\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 7714, "slov": 605, "odkazu": 63, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:39", "sha256": "48aab6e294260339c0b4f95a3af52e803f2cbc0a34ddf098c5beee5f749fd95c", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://www.nginx.com/blog/event-driven-data-management-microservices/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/data/event-sourcing.html", "titulek": "Event sourcing", "h1": "Pattern: Event sourcing", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Event sourcing"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Example"}, {"uroven": 2, "text": "Resulting context"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Event sourcing\n\n## Problem\n\nYou have applied the [Event-driven architecture pattern](event-driven-architecture.html).\nIn order to be reliable, services must atomically publish events whenever their state changes.\nIt is not viable to use a distributed transaction that spans the database and the message broker.\nHow to reliably/atomically publish events whenever state changes?\n\n## Solution\n\nA good solution to this problem is to use event sourcing.\nEvent sourcing persists the state of a business entity such an Order or a Customer as a sequence of state-changing events.\nWhenever the state of a business entity changes, a new event is appended to the list of events.\nSince saving an event is a single operation, it is inherently atomic.\nThe application reconstructs an entity’s current state by replaying the events.\n\nApplications persist events in an event store, which is a database of events.\nThe store has an API for adding and retrieving an entity’s events.\nThe event store also behaves like a message broker.\nIt provides an API that enables services to subscribe to events.\nWhen a service saves an event in the event store, it is delivered to all interested subscribers.\n\n## Example\n\nThe following diagram shows how the e-commerce system could use event sourcing to persist orders.\n\nInstead of simply storing the current state of each order as a row in an `ORDERS` table, the application persists each Order as a sequence of events.\nThe `CustomerService` can subscribe to the order events and update its own state.\n\nFor more details, see the [Eventuate Platform](http://eventuate.io), which is an application platform based on event sourcing and CQRS. There are [several example applications](http://eventuate.io/exampleapps.html)\n\n## Resulting context\n\nEvent sourcing has several benefits:\n\n- It solves one of the key problems in implementing an event-driven architecture and makes it possible to reliably publish events whenever state changes.\n- Because it persists events rather than domain objects, it mostly avoids the object‑relational impedance mismatch problem.\n- It provides a 100% reliable audit log of the changes made to a business entity\n- It makes it possible to implement temporal queries that determine the state of an entity at any point in time.\n- Event sourcing-based business logic consists of loosely coupled business entities that exchange events. This makes it a lot easier to migrate from a monolithic application to a microservice architecture.\n\nEvent sourcing also has several drawbacks:\n\n- It is a different and unfamiliar style of programming and so there is a learning curve.\n- The event store is difficult to query since it requires typical queries to reconstruct the state of the business entities. That is likely to be complex and inefficient.\nAs a result, the application must use [Command Query Responsibility Segregation (CQRS)](cqrs.html) to implement queries.\nThis in turn means that applications must handle eventually consistent data.\n\n- The [Event-driven architecture pattern](event-driven-architecture.html) creates the need for this pattern.\n- The [CQRS](cqrs.html) is often used with event sourcing.\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 8185, "slov": 704, "odkazu": 60, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:41", "sha256": "7b07ea0d76ca33d25b58a52f283645fc7ceb3574dbd76e39e52bddf51297d3f3", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/data/shared-database.html", "titulek": "Shared database", "h1": "Pattern: Shared database", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Shared database"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 1, "text": "Solution"}, {"uroven": 1, "text": "Example"}, {"uroven": 1, "text": "Resulting context"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Shared database\n\n## Context\n\nLet’s imagine you are developing an online store application using the [Microservice architecture pattern](/patterns/microservices.html).\nMost services need to persist data in some kind of database.\nFor example, the `Order Service` stores information about orders and the `Customer Service` stores information about customers.\n\n## Problem\n\nWhat’s the database architecture in a microservices application?\n\n## Forces\n\n- Services must be loosely coupled so that they can be developed, deployed and scaled independently\n- Some business transactions must enforce invariants that span multiple services.\nFor example, the `Place Order` use case must verify that a new Order will not exceed the customer’s credit limit.\nOther business transactions, must update data owned by multiple services.\n- Some business transactions need to query data that is owned by multiple services.\nFor example, the `View Available Credit` use must query the Customer to find the `creditLimit` and Orders to calculate the total amount of the open orders.\n- Some queries must join data that is owned by multiple services.\nFor example, finding customers in a particular region and their recent orders requires a join between customers and orders.\n- Databases must sometimes be replicated and sharded in order to scale. See the [Scale Cube](/articles/scalecube.html).\n- Different services have different data storage requirements.\nFor some services, a relational database is the best choice.\nOther services might need a NoSQL database such as MongoDB, which is good at storing complex, unstructured data, or Neo4J, which is designed to efficiently store and query graph data.\n\n# Solution\n\nUse a (single) database that is shared by multiple services.\nEach service freely accesses data owned by other services using local ACID transactions.\n\n# Example\n\nThe `OrderService` and `CustomerService` freely access each other’s tables.\nFor example, the `OrderService` can use the following ACID transaction ensure that a new order will not violate the customer’s credit limit.\n\n```\nBEGIN TRANSACTION\n…\nSELECT ORDER_TOTAL\n FROM ORDERS WHERE CUSTOMER_ID = ?\n…\nSELECT CREDIT_LIMIT\nFROM CUSTOMERS WHERE CUSTOMER_ID = ?\n…\nINSERT INTO ORDERS …\n…\nCOMMIT TRANSACTION\n```\n\nThe database will guarantee that the credit limit will not be exceeded even when simultaneous transactions attempt to create orders for the same customer.\n\n# Resulting context\n\nThe benefits of this pattern are:\n\n- A developer uses familiar and straightforward ACID transactions to enforce data consistency\n- A single database is simpler to operate\n\nThe drawbacks of this pattern are:\n\n- Development time coupling - a developer working on, for example, the `OrderService` will need to coordinate schema changes with the developers of other services that access the same tables.\nThis coupling and additional coordination will slow down development.\n- Runtime coupling - because all services access the same database they can potentially interfere with one another.\nFor example, if long running `CustomerService` transaction holds a lock on the `ORDER` table then the `OrderService` will be blocked.\n- Single database might not satisfy the data storage and access requirements of all services.\n\n- [Database per Service](database-per-service.html) is an alternative approach\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 8339, "slov": 704, "odkazu": 61, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:31", "sha256": "39412c0b25149161807d619f9edff3ac1d81992794f6827bc0b822bf9b3f4b7d", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/data/transaction-log-tailing.html", "titulek": "Transaction log tailing", "h1": "Pattern: Transaction log tailing", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Transaction log tailing"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Example"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Transaction log tailing\n\n## Problem\n\nHow to reliably/atomically publish events whenever state changes\n\n## Solution\n\nTail the database transaction log and publish each change as an event.\n\n- The [Event-driven architecture pattern](event-driven-architecture.html) creates the need for this pattern.\n- The [Event sourcing](event-sourcing.html) is an alternative pattern\n\n## Example\n\n- [Eventuate Local](https://blog.eventuate.io/2016/10/06/eventuate-local-event-sourcing-and-cqrs-with-spring-boot-apache-kafka-and-mysql/) uses transaction log tailing.\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5598, "slov": 291, "odkazu": 61, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:37", "sha256": "ba1cd07632bf7b9ed53e47a694a188c654df0d635c516a6f7c25c7556fce3600", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://blog.eventuate.io/2016/10/06/eventuate-local-event-sourcing-and-cqrs-with-spring-boot-apache-kafka-and-mysql/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/data/transactional-outbox.html", "titulek": "Redirect to renamed pattern", "h1": "", "popis": "", "klicova_slova": "renamed-pattern", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [], "markdown": "If your browser doesn't automatically go there within a few seconds,\nyou may want to go to\n [the destination](application-events.html) \nmanually.", "znaku_textu": 145, "slov": 21, "odkazu": 1, "kodovani": "utf-8", "kodovani_deklarovane": null, "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:40", "sha256": "780db6ea3c591baa9f13e432c3103a8deb94d86af0831ab14488bfb416732642", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": []} {"url": "http://microservices.io/patterns/cn/decomposition/decompose-by-business-capability.html", "titulek": "Decompose by business capability", "h1": "Pattern: Decompose by business capability", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Decompose by business capability"}, {"uroven": 1, "text": "Context"}, {"uroven": 1, "text": "Problem"}, {"uroven": 1, "text": "Forces"}, {"uroven": 2, "text": "Solution"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Decompose by business capability\n\n# Context\n\nYou are developing a large, complex application and want to use the [microservice architecture](../microservices.html).\nThe microservice architecture structures an application as a set of loosely coupled services.\nThe goal of the microservice architecture is to accelerate software development by enabling continuous delivery/deployment.\n\nThe microservice architecture does this in two ways:\n\n1. Simplifies testing and enables components to deployed independently\n2. Structures the engineering organization as a collection of small (6-10 members), autonomous teams, each of which is responsible for one or more services\n\nThese benefits are not automatically guaranteed.\nInstead, they can only be achieved by the careful functional decomposition of the application into services.\n\nA service must be small enough to be developed by a small team and to be easily tested.\nA useful guideline from object-oriented design (OOD) is the Single Responsibility Principle ([SRP](http://www.objectmentor.com/resources/articles/srp.pdf)).\nThe SRP defines a responsibility of a class as a reason to change, and states that a class should only have one reason to change.\nIt make sense to apply the SRP to service design as well and design services that are cohesive and implement a small set of strongly related functions.\n\nThe application also be decomposed in a way so that most new and changed requirements only affect a single service.\nThat is because changes that affect multiple services requires coordination across multiple teams, which slows down development.\nAnother useful principle from OOD is the Common Closure Principle (CCP), which states that classes that change for the same reason should be in the same package.\nPerhaps, for instance, two classes implement different aspects of the same business rule.\nThe goal is that when that business rule changes developers, only need to change code in a small number - ideally only one - of packages.\nThis kind of thinking makes sense when designing services since it will help ensure that each change should impact only one service.\n\n# Problem\n\nHow to decompose an application into services?\n\n# Forces\n\n- The architecture must be stable\n- Services must be cohesive.\nA service should implement a small set of strongly related functions.\n- Services must conform to the Common Closure Principle - things that change together should be packaged together - to ensure that each change affect only one service\n- Services must be loosely coupled - each service as an API that encapsulates its implementation.\nThe implementation can be changed without affecting clients\n- A service should be testable\n- Each service be small enough to be developed by a “two pizza” team, i.e. a team of 6-10 people\n- Each team that owns one or more services must be autonomous.\nA team must be able to develop and deploy their services with minimal collaboration with other teams.\n\n## Solution\n\nDefine services corresponding to business capabilities\n\n- The [Decompose by subdomain](decompose-by-subdomain.html) pattern is an alternative pattern\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 8138, "slov": 691, "odkazu": 61, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:30", "sha256": "ac4608464fa8840bf8f118e177a27320b7de9fb675cf630631d18ab9b87f8555", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "http://www.objectmentor.com/resources/articles/srp.pdf", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/decomposition/decompose-by-subdomain.html", "titulek": "Decompose by subdomain", "h1": "Pattern: Decompose by subdomain", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Decompose by subdomain"}, {"uroven": 1, "text": "Context"}, {"uroven": 1, "text": "Problem"}, {"uroven": 1, "text": "Forces"}, {"uroven": 2, "text": "Solution"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Decompose by subdomain\n\n# Context\n\nYou are developing a large, complex application and want to use the [microservice architecture](../microservices.html).\nThe microservice architecture structures an application as a set of loosely coupled services.\nThe goal of the microservice architecture is to accelerate software development by enabling continuous delivery/deployment.\n\nThe microservice architecture does this in two ways:\n\n1. Simplifies testing and enables components to deployed independently\n2. Structures the engineering organization as a collection of small (6-10 members), autonomous teams, each of which is responsible for one or more services\n\nThese benefits are not automatically guaranteed.\nInstead, they can only be achieved by the careful functional decomposition of the application into services.\n\nA service must be small enough to be developed by a small team and to be easily tested.\nA useful guideline from object-oriented design (OOD) is the Single Responsibility Principle ([SRP](http://www.objectmentor.com/resources/articles/srp.pdf)).\nThe SRP defines a responsibility of a class as a reason to change, and states that a class should only have one reason to change.\nIt make sense to apply the SRP to service design as well and design services that are cohesive and implement a small set of strongly related functions.\n\nThe application also be decomposed in a way so that most new and changed requirements only affect a single service.\nThat is because changes that affect multiple services requires coordination across multiple teams, which slows down development.\nAnother useful principle from OOD is the Common Closure Principle (CCP), which states that classes that change for the same reason should be in the same package.\nPerhaps, for instance, two classes implement different aspects of the same business rule.\nThe goal is that when that business rule changes developers, only need to change code in a small number - ideally only one - of packages.\nThis kind of thinking makes sense when designing services since it will help ensure that each change should impact only one service.\n\n# Problem\n\nHow to decompose an application into services?\n\n# Forces\n\n- The architecture must be stable\n- Services must be cohesive.\nA service should implement a small set of strongly related functions.\n- Services must conform to the Common Closure Principle - things that change together should be packaged together - to ensure that each change affect only one service\n- Services must be loosely coupled - each service as an API that encapsulates its implementation.\nThe implementation can be changed without affecting clients\n- A service should be testable\n- Each service be small enough to be developed by a “two pizza” team, i.e. a team of 6-10 people\n- Each team that owns one or more services must be autonomous.\nA team must be able to develop and deploy their services with minimal collaboration with other teams.\n\n## Solution\n\nDefine services corresponding to domain-driven design subdomains\n\n- The [Decompose by business capability](decompose-by-business-capability.html) pattern is an alternative pattern\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 8158, "slov": 694, "odkazu": 61, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:32", "sha256": "3cb9ffbe48439f6cf38c560886c5430d3f89600822a6d1767a658197c5ae5290", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "http://www.objectmentor.com/resources/articles/srp.pdf", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/deployment/multiple-services-per-host.html", "titulek": "Multiple service instances per host pattern", "h1": "Pattern: Multiple service instances per host", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Multiple service instances per host"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Multiple service instances per host\n\n## Context\n\nYou have applied the [Microservice architecture pattern](/patterns/microservices.html) and architected your system as a set of services.\nEach service is deployed as a set of service instances for throughput and availability.\n\n## Problem\n\nHow are services packaged and deployed?\n\n## Forces\n\n- Services are written using a variety of languages, frameworks, and framework versions\n- Each service consists of multiple service instances for throughput and availability\n- Service must be independently deployable and scalable\n- Service instances need to be isolated from one another\n- You need to be able to quickly build and deploy a service\n- You need to be able to constrain the resources (CPU and memory) consumed by a service\n- You need to monitor the behavior of each service instance\n- You want deployment to reliable\n- You must deploy the application as cost-effectively as possible\n\n## Solution\n\nRun multiple instances of different services on a host (Physical or Virtual machine).\n\nThere are various ways of deploying a service instance on a shared host including:\n\n- Deploy each service instance as a JVM process. For example, a Tomcat or Jetty instances per service instance.\n- Deploy multiple service instances in the same JVM. For example, as web applications or OSGI bundles.\n\n## Examples\n\n## Resulting context\n\nThe benefits of this pattern include:\n\n- More efficient resource utilization than the [Service Instance per host pattern](single-service-per-host.html)\n\nThe drawbacks of this approach include:\n\n- Risk of conflicting resource requirements\n- Risk of conflicting dependency versions\n- Difficult to limit the resources consumed by a service instance\n- If multiple services instances are deployed in the same process then its difficult to monitor the resource consumption of each service instance.\nIts also impossible to isolate each instance\n\n- The [Single Service Instance per Host pattern](single-service-per-host.html) is an alternative solution.\n- The [Serverless deployment pattern](/patterns/deployment/serverless-deployment.html) is an alternative solution.\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 7149, "slov": 525, "odkazu": 61, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:01", "sha256": "e57f36805727946f66488e06fe9e226ee441cbda63d2a74e869a26b4a1c47e83", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/deployment/serverless-deployment.html", "titulek": "Serverless deployment", "h1": "Pattern: Serverless deployment", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Serverless deployment"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Serverless deployment\n\n## Context\n\nYou have applied the [Microservice architecture pattern](/patterns/microservices.html) and architected your system as a set of services.\nEach service is deployed as a set of service instances for throughput and availability.\n\n## Problem\n\nHow are services packaged and deployed?\n\n## Forces\n\n- Services are written using a variety of languages, frameworks, and framework versions\n- Each service consists of multiple service instances for throughput and availability\n- Service must be independently deployable and scalable\n- Service instances need to be isolated from one another\n- You need to be able to quickly build and deploy a service\n- You need to be able to constrain the resources (CPU and memory) consumed by a service\n- You need to monitor the behavior of each service instance\n- You want deployment to reliable\n- You must deploy the application as cost-effectively as possible\n\n## Solution\n\nUse a deployment infrastructure that hides any concept of servers (i.e. reserved or preallocated resources)- physical or virtual hosts, or containers.\nThe infrastructure takes your service’s code and runs it.\nYou are charged for each request based on the resources consumed.\n\nTo deploy your service using this approach, you package the code (e.g. as a ZIP file), upload it to the deployment infrastructure and describe the desired performance characteristics.\n\nThe deployment infrastructure is a utility operated by a public cloud provider.\nIt typically uses either containers or virtual machines to isolate the services.\nHowever, these details are hidden from you.\nNeither you nor anyone else in your organization is responsible for managing any low-level infrastructure such as operating systems, virtual machines, etc.\n\n## Examples\n\nThere are a few different serverless deployment environments:\n\n- [AWS Lambda](https://aws.amazon.com/lambda/)\n- [Google Cloud Functions](https://cloud.google.com/functions/docs)\n- [Azure Functions](https://azure.microsoft.com/en-us/services/functions/)\n\nThey offer similar functionality but AWS Lambda has the richest feature set.\nAn AWS Lambda function is a stateless component that is invoked to handle events.\nTo create an AWS Lambda function you package your the NodeJS, Java or Python code for your service in a ZIP file, and upload it to AWS Lambda.\nYou also specify the name of function that handles events as well as resource limits.\n\nWhen an event occurs, AWS Lambda finds an idle instance of your function, launching one if none are available and invokes the handler function.\nAWS Lambda runs enough instances of your function to handle the load.\nUnder the covers, it uses containers to isolate each instance of a lambda function.\nAs you might expect, AWS Lambda runs the containers on EC2 instances.\n\nThere are four ways to invoke a lambda function.\nOne option is to configure your lambda function to be invoked in response to an event generated by an AWS service such as S3, DynamoDB or Kinesis.\nExamples of events include the following:\n\n- an object being created in a S3 bucket\n- an item is created, updated or deleted in a DynamoDB table\n- a message is available to read from a Kinesis stream\n- an email being received via the Simple email service.\n\nAnother way to invoke a lambda function is to configure the AWS Lambda Gateway to route HTTP requests to your lambda.\nAWS Gateway transforms an HTTP request into an event object, invokes the lambda function, and generates a HTTP response from the lambda function’s result.\n\nYou can also explicitly invoke your lambda function using the AWS Lambda Web Service API.\nYour application that invokes the lambda function supplies a JSON object, which is passed to the lambda function.\nThe web service call returns the value returned by the lambda.\n\nThe fourth way to invoke a lambda function is periodically using a cron-like mechanism.\nYou can, for example, tell AWS to invoke you lambda function every five minutes.\n\nThe cost of each invocation is a function of the duration of the invocation, which is measured in 100 millisecond increments, and the memory consumed.\n\n## Resulting context\n\nThe benefits of using serverless deployment include:\n\n- It eliminates the need to spend time on the undifferentiated heavy lifting of managing low-level infrastructure.\nInstead, you can focus on your code.\n- The serverless deployment infrastructure is extremely elastic.\nIt automatically scales your services to handle the load.\n- You pay for each request rather than provisioning what might be under utilized virtual machines or containers.\n\nThe drawbacks of serverless deployment include:\n\n- Significant limitation and constraints -\nA serverless deployment environment typically has far more constraints that a VM-based or Container-based infrastructure.\nFor example, AWS Lambda only supports a few languages.\nIt is only suitable for deploying stateless applications that run in response to a request.\nYou cannot deploy a long running stateful application such as a database or message broker.\n- Limited “input sources” - lambdas can only respond to requests from a limited set of input sources.\nAWS Lambda is not intended to run services that, for example, subscribe to a message broker such as RabbitMQ.\n- Applications must startup quickly - serverless deployment is not a good fit your service takes a long time to start\n- Risk of high latency - the time it takes for the infrastructure to provision an instance of your function and for the function to initialize might result in significant latency.\nMoreover, a serverless deployment infrastructure can only react to increases in load.\nYou cannot proactively pre-provision capacity.\nAs a result, your application might initially exhibit high latency when there are sudden, massive spikes in load.\n\nThe deployment infrastructure will internally deploy your application using one of the other patterns.\nIt will most likely use [Service Service per Host pattern](single-service-per-host.html).\n\n- The [Multiple Service Instances per Host pattern](multiple-services-per-host.html) is an alternative deployment solution\n- The [Single Service per Host pattern](single-service-per-host.html) is an alternative deployment solution\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 11200, "slov": 1161, "odkazu": 64, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:14", "sha256": "2bc7368bf89a1a6d54713fb9ea53988875897cd8e4cf68e900e3457398533835", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://aws.amazon.com/lambda/", "https://cloud.google.com/functions/docs", "https://azure.microsoft.com/en-us/services/functions/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/deployment/service-deployment-platform.html", "titulek": "Service deployment platform", "h1": "Pattern: Service deployment platform", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Service deployment platform"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Service deployment platform\n\n## Context\n\nYou have applied the [Microservice architecture pattern](/patterns/microservices.html) and architected your system as a set of services.\nEach service is deployed as a set of service instances for throughput and availability.\n\n## Problem\n\nHow are services packaged and deployed?\n\n## Forces\n\n- Services are written using a variety of languages, frameworks, and framework versions\n- Each service consists of multiple service instances for throughput and availability\n- Service must be independently deployable and scalable\n- Service instances need to be isolated from one another\n- You need to be able to quickly build and deploy a service\n- You need to be able to constrain the resources (CPU and memory) consumed by a service\n- You need to monitor the behavior of each service instance\n- You want deployment to reliable\n- You must deploy the application as cost-effectively as possible\n\n## Solution\n\nUse a deployment platform, which is automated infrastructure for application deployment.\nIt provides a service abstraction, which is a named, set of highly available (e.g. load balanced) service instances.\n\n- Some deployment platforms provide a [Service Registry](../service-registry.html) and [Server-Side discovery](../server-side-discovery.html)\n- Internally, a deployment platform might use use [containers](../deployment/service-per-container.html) or [virtual machines](../deployment/service-per-vm.html) to deploy a service.\nDocker orchestration frameworks are, of course, explicitly [container-based](../deployment/service-per-container.html)\n\n## Examples\n\n- Docker orchestration frameworks including [Docker swarm mode](https://docs.docker.com/engine/swarm/) and [Kubernetes](http://kubernetes.io/)\n- [Serverless platforms](serverless-deployment.html) such as AWS Lambda\n- PaaS including [Cloud Foundry](https://www.cloudfoundry.org/) and [AWS Elastic Beanstalk](https://aws.amazon.com/elasticbeanstalk/)\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 6984, "slov": 459, "odkazu": 68, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:18", "sha256": "bc49ef39b3c597fe719869d106c896f9375f63a3b4b871b5db9a1eba7265ce88", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://docs.docker.com/engine/swarm/", "http://kubernetes.io/", "https://www.cloudfoundry.org/", "https://aws.amazon.com/elasticbeanstalk/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/deployment/service-per-container.html", "titulek": "Service instance per container pattern", "h1": "Pattern: Service instance per container", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Service instance per container"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Service instance per container\n\n## Context\n\nYou have applied the [Microservice architecture pattern](/patterns/microservices.html) and architected your system as a set of services.\nEach service is deployed as a set of service instances for throughput and availability.\n\n## Problem\n\nHow are services packaged and deployed?\n\n## Forces\n\n- Services are written using a variety of languages, frameworks, and framework versions\n- Each service consists of multiple service instances for throughput and availability\n- Service must be independently deployable and scalable\n- Service instances need to be isolated from one another\n- You need to be able to quickly build and deploy a service\n- You need to be able to constrain the resources (CPU and memory) consumed by a service\n- You need to monitor the behavior of each service instance\n- You want deployment to reliable\n- You must deploy the application as cost-effectively as possible\n\n## Solution\n\nPackage the service as a (Docker) container image and deploy each service instance as a container\n\n## Examples\n\nDocker is becoming an extremely popular way of packaging and deploying services.\nEach service is packaged as a Docker image and each service instance is a Docker container.\nThere are several Docker clustering frameworks including:\n\n- [Kubernetes](http://kubernetes.io/)\n- [Marathon/Mesos](https://mesosphere.github.io/marathon/)\n- [Amazon EC2 Container Service](http://aws.amazon.com/ecs/)\n\n## Resulting context\n\nThe benefits of this approach include:\n\n- It is straightforward to scale up and down a service by changing the number of container instances.\n- The container encapsulates the details of the technology used to build the service. All services are, for example, started and stopped in exactly the same way.\n- Each service instance is isolated\n- A container imposes limits on the CPU and memory consumed by a service instance\n- Containers are extremely fast to build and start.\nFor example, it’s 100x faster to package an application as a Docker container than it is to package it as an AMI.\nDocker containers also start much faster than a VM since only the application process starts rather than an entire OS.\n\nThe drawbacks of this approach include:\n\n- The infrastructure for deploying containers is not as rich as the infrastructure for deploying virtual machines.\n\n- This pattern is a refinement of the [Service Instance per Host pattern](single-service-per-host.html)\n- The [Service Instance per VM pattern](service-per-vm.html) is an alternative solution\n- The [Serverless deployment pattern](/patterns/deployment/serverless-deployment.html) is an alternative solution.\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 7657, "slov": 598, "odkazu": 65, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:23", "sha256": "25f112f5e88ace0d71396d267fbf6764edbe8d4022fbc51467bdb5232d004e0d", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "http://kubernetes.io/", "https://mesosphere.github.io/marathon/", "http://aws.amazon.com/ecs/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/deployment/service-per-vm.html", "titulek": "Service Instance per VM pattern", "h1": "Pattern: Service Instance per VM", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Service Instance per VM"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Service Instance per VM\n\n## Context\n\nYou have applied the [Microservice architecture pattern](/patterns/microservices.html) and architected your system as a set of services.\nEach service is deployed as a set of service instances for throughput and availability.\n\n## Problem\n\nHow are services packaged and deployed?\n\n## Forces\n\n- Services are written using a variety of languages, frameworks, and framework versions\n- Each service consists of multiple service instances for throughput and availability\n- Service must be independently deployable and scalable\n- Service instances need to be isolated from one another\n- You need to be able to quickly build and deploy a service\n- You need to be able to constrain the resources (CPU and memory) consumed by a service\n- You need to monitor the behavior of each service instance\n- You want deployment to reliable\n- You must deploy the application as cost-effectively as possible\n\n## Solution\n\nPackage the service as a virtual machine image and deploy each service instance as a separate VM\n\n## Examples\n\n- Netflix packages each service as an EC2 AMI and deploys each service instance as a EC2 instance.\n\n## Resulting context\n\nThe benefits of this approach include:\n\n- Its straightforward to scale the service by increasing the number of instances. Amazon Autoscaling Groups can even do this automatically based on load.\n- The VM encapsulates the details of the technology used to build the service. All services are, for example, started and stopped in exactly the same way.\n- Each service instance is isolated\n- A VM imposes limits on the CPU and memory consumed by a service instance\n- IaaS solutions such as AWS provide a mature and feature rich infrastructure for deploying and managing virtual machines. For example,\n - Elastic Load Balancer -\n - Autoscaling groups\n - …\n\nThe drawbacks of this approach include:\n\n- Building a VM image is slow and time consuming\n\n- This pattern is a refinement of the [Single Service per Host pattern](single-service-per-host.html)\n- The [Service Instance per Container pattern](service-per-container.html) is an alternative solution\n- The [Serverless deployment pattern](/patterns/deployment/serverless-deployment.html) is an alternative solution.\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 7243, "slov": 550, "odkazu": 62, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:26", "sha256": "da69fb632c458a835da9a59788542073d9a4305fdefd2dfdedbaaa6eff3d5ffe", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/deployment/single-service-per-host.html", "titulek": "Single Service Instance per Host pattern", "h1": "Pattern: Single Service Instance per Host", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Single Service Instance per Host"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Single Service Instance per Host\n\n## Context\n\nYou have applied the [Microservice architecture pattern](/patterns/microservices.html) and architected your system as a set of services.\nEach service is deployed as a set of service instances for throughput and availability.\n\n## Problem\n\nHow are services packaged and deployed?\n\n## Forces\n\n- Services are written using a variety of languages, frameworks, and framework versions\n- Each service consists of multiple service instances for throughput and availability\n- Service must be independently deployable and scalable\n- Service instances need to be isolated from one another\n- You need to be able to quickly build and deploy a service\n- You need to be able to constrain the resources (CPU and memory) consumed by a service\n- You need to monitor the behavior of each service instance\n- You want deployment to reliable\n- You must deploy the application as cost-effectively as possible\n\n## Solution\n\nDeploy each single service instance on its own host\n\n## Examples\n\n## Resulting context\n\nThe benefits of this approach include:\n\n- Services instances are isolated from one another\n- There is no possibility of conflicting resource requirements or dependency versions\n- A service instance can only consume at most the resources of a single host\n- Its straightforward to monitor, manage, and redeploy each service instance\n\nThe drawbacks of this approach include:\n\n- Potentially less efficient resource utilization compared to [Multiple Services per Host](multiple-services-per-host.html) because there are more hosts\n\n- The [Multiple Service Instances per Host pattern](multiple-services-per-host.html) is an alternative solution\n- The [Service Instance per VM pattern](service-per-vm.html) is a refinement of this pattern\n- The [Service Instance per Container pattern](service-per-container.html) is a refinement of this pattern\n- The [Serverless deployment pattern](/patterns/deployment/serverless-deployment.html) is an alternative solution.\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 7007, "slov": 499, "odkazu": 63, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:34", "sha256": "30dd2458311746090a85292b304d39188d723f7101f1ec32f6946a3c4a11855f", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/externalized-configuration.html", "titulek": "Externalized configuration", "h1": "模式: 配置信息外部化", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "模式: 配置信息外部化"}, {"uroven": 2, "text": "问题"}, {"uroven": 2, "text": "方案"}, {"uroven": 2, "text": "示例"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# 模式: 配置信息外部化\n\n## 问题\n\nĺş”ç”¨é€šĺ¸¸éœ€čŚĺœ¨ä¸ĺŒçš„çŽŻĺ˘ƒä¸‹čżčĄŒďźŒäž‹ĺŚ‚ćľ‹čŻ•ă€é˘„ĺ‘ĺ¸ƒďźŒç”Ÿäş§çŽŻĺ˘ƒç­‰ç­‰ďźŒĺ› ć­¤éœ€čŚä¸Žäš‹ĺŻšĺş”çš„ĺ¤šĺĽ—é…ç˝Žć–‡äťśă€‚\n\n## 方案\n\n将应用程序所有相关的配置信息,包括数据库、网络连接等等保存在外部。在应用启动时,从外部(例如操作系统环境变量)读取这些配置信息。\n\n## 示例\n\n- [Spring Boot externalized configuration](https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html)\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5589, "slov": 247, "odkazu": 59, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:44", "sha256": "ef3416daa9fd6ad61a5c63bd3b598a84c6b405f5da50a1fa0671de982ec5de73", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/index.html", "titulek": "A pattern language for microservices", "h1": "微服务的模式语言", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "微服务的模式语言"}, {"uroven": 1, "text": "ć ¸ĺżƒć¨ĄĺźďźˆApplication architecture patterns)"}, {"uroven": 1, "text": "服务拆分(Decomposition)"}, {"uroven": 1, "text": "部署模式(Deployment patterns)"}, {"uroven": 1, "text": "需要关注的边界问题(Cross cutting concerns)"}, {"uroven": 1, "text": "通讯模式(Communication patterns)"}, {"uroven": 2, "text": "éŁŽć ź"}, {"uroven": 2, "text": "外部 API"}, {"uroven": 2, "text": "服务发现"}, {"uroven": 2, "text": "ĺŻé ć€§"}, {"uroven": 1, "text": "数据管理(Data management)"}, {"uroven": 1, "text": "安全(Security)"}, {"uroven": 1, "text": "测试(Testing)"}, {"uroven": 1, "text": "可观测性(Observability)"}, {"uroven": 1, "text": "UI 模式(UI patterns)"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# 微服务的模式语言\n\n咱们开始聊聊微服务架构的[模式语言](https://book.douban.com/subject/1471535/)吧。\n\n> [译注]:模式语言提供了讨论问题的交流术语,它明确了特定场景、特定问题的解决方案和延伸性思考。模式语言主要目的是帮助开发者解决在设计和编程中遇到的共同的问题,即清晰的问题陈述、体现问题的解决方案以及推动解决方案的力量(Forceďź‰çš„ć¸…ć™°čĄ¨čż°ă€‚ĺžŽćœĺŠĄćžśćž„ä˝œä¸şä¸€ä¸ŞçŽ°ĺœ¨ćľčĄŒçš„ćœĺŠĄćžśćž„ďźŒäšŸćœ‰ä¸€ĺĽ—ĺąžäşŽč‡Şĺˇąçš„ć¨Ąĺźă€‚čż™çŻ‡ć–‡çŤ ć˜ŻĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łć¨ĄĺźčŻ­č¨€çš„ä¸€ä¸Şćçş˛ă€‚Chris Richardson 从不同的角度,对相关的模式进行了分类。可以点击链接查看每个模式的详细描述。下图通过虚线框细分了不同的微服务模式。\n\n# ć ¸ĺżƒć¨ĄĺźďźˆApplication architecture patterns)\n\n您为应用程序选择哪一种架构?\n\n- [单体架构(Monolithic architecture)](monolithic.html) - 采用单一部署单元的方式架构应用\n- [微服务架构(Microservices architecture)](microservices.html) - 采用一组松耦合服务的方式架构应用\n\n# 服务拆分(Decomposition)\n\n如何把应用拆分为若干个服务?\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†ďźˆDecompose by business capability)](decomposition/decompose-by-business-capability.html) new - ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ç•ŒĺŽšćœĺŠĄçš„čŒƒĺ›´\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†ďźˆDecompose by subdomain)](decomposition/decompose-by-subdomain.html) new - ć šćŽé˘†ĺŸŸéŠąĺŠ¨čŽžčŽĄä¸­ĺ­ĺŸŸçš„ćŚ‚ĺżľç•ŒĺŽšćœĺŠĄçš„čŒƒĺ›´\n\n# 部署模式(Deployment patterns)\n\n如何部署应用程序的服务?\n\n- [单主机上部署服务的多个实例(Multiple service instances per host)](deployment/multiple-services-per-host.html) - 把服务的多个实例部署在一台主机上\n- [单主机上部署服务的单个实例(Single service instance per host)](deployment/single-service-per-host.html) - 把服务的单一实例部署在它独享的主机上\n- [服务实例与虚拟机一一对应(Service instance per VM)](deployment/service-per-vm.html) - 把服务的单一实例部署在它独享的虚拟机上\n- [服务实例与容器一一对应(Service instance per Container)](deployment/service-per-container.html) - 把服务的单一实例部署在它独享的容器上\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛ďźˆServerless deployment)](/patterns/deployment/serverless-deployment.html) - ä˝żç”¨ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛ĺšłĺ°éƒ¨ç˝˛ćœĺŠĄĺŽžäž‹\n- [服务部署平台(Service deployment platform)](/patterns/deployment/service-deployment-platform.html) new - 使用提供服务抽象能力的高度自动化部署平台部署服务实例\n\n# 需要关注的边界问题(Cross cutting concerns)\n\n如何处理服务实例与外界交互的问题?\n\n- [微服务的基底(Microservice chassis)](/patterns/microservice-chassis.html) - 一个用于服务实例与外界交互和简化服务开发的框架\n- [配置信息外部化(Externalized configuration)](/patterns/externalized-configuration.html) new - 把类似数据库连接、访问密钥等配置信息外部化\n\n# 通讯模式(Communication patterns)\n\n## éŁŽć ź\n\nĺş”čŻĽé€‰ć‹Šć€Žć ˇçš„é€šäżĄćœşĺˆśćĽčż›čĄŒćœĺŠĄé—´é€ščŽŻĺ’Œĺ¤–éƒ¨ĺŽ˘ćˆˇçŤŻé€ščŽŻďźŸ\n\n- [远程过程调用(Remote Procedure Invocation)](communication-style/rpi.html) - 使用基于 RPI 协议的服务间通讯方式\n- [月息Messaging)](communication-style/messaging.html) - 使用异步消息进行服务间通讯\n- [领域独用协议(Domain-specific protocol)](communication-style/domain-specific.html) new - 使用特定领域的通讯协议(如 SIP,等)\n\n## 外部 API\n\n如何处理外部客户端与服务之间的通讯?\n\n- [API 网关(API gateway)](apigateway.html) - 为每一类客户端提供一个访问服务的独特接口\n- [服务前端的后端(Backend for front-end)](apigateway.html) - 为每一类客户端都提供一个独立的 API 网关\n\n## 服务发现\n\n一个基于 RPI 的客户端如何在网络上发现服务实例的位置?\n\n- [客户端服务发现(Client-side discovery)](client-side-discovery.html) - 客户端通过直接查询服务注册表获取服务实例的位置\n- [服务器端服务发现(Server-side discovery)](server-side-discovery.html) - 路由模块通过查询服务注册表获取服务实例的位置\n- [服务注册表(Service registry)](service-registry.html) - 一个记录了服务实例位置的数据\n- [自注册(Self registration)](self-registration.html) - 服务实例自己完成向服务注册表的注册\n- [第三方注册(3rd party registration)](3rd-party-registration.html) - 通过第三方模块来进行服务实例信息到服务注册表的注册过程\n\n## ĺŻé ć€§\n\n如何避免由于服务故障或网络中断所引起的故障蔓延到其他服务?\n\n- [断路器(Circuit Breaker)](reliability/circuit-breaker.html) - 当远端服务返回的故障率超过一定的阀值时,客户端代理(比如 API 网关)对远程服务的调用将立刻返回失败的信息\n\n# 数据管理(Data management)\n\n如何实现数据一致性和查询?\n\n- [每服务数据库(Database per Service)](data/database-per-service.html) - 每个服务都拥有它私有的数据库\n- [共享数据库(Shared database)](data/shared-database.html) - 服务之间共享同一个数据库\n- [事件驱动架构(Event-driven architecture)](data/event-driven-architecture.html) - 使用事件来维护服务间的数据一致性\n- [事件溯源(Event sourcing)](data/event-sourcing.html) - 以一连串事件的方式来持久化聚合\n- [事务日志跟踪(Transaction log tailing)](data/transaction-log-tailing.html) - 跟踪数据库的日志变更并由此对外发布消息\n- [数据库触发器(Database triggers)](data/database-triggers.html) - 使用触发器来捕获对数据的修改\n- [应用程序事件(Application events)](/patterns/cn/data/transactional-outbox.html) - 应用程序从消息队列获取事件并插入数据库中\n- [命令查询职责分离(CQRS)](data/cqrs.html) - 维护一个或者多个重要的数据视图以供高效率的查询\n\n# 安全(Security)\n\nĺŚ‚ä˝•ĺ‘ćœĺŠĄĺŽžäž‹äź é€’čŽżé—ŽĺŽ˘ćˆˇçŤŻçš„čşŤäť˝äżĄćŻďźŸ\n\n- [访问令牌(Access Token)](security/access-token.html) new - ćœĺŠĄĺŽžäž‹é€ščż‡čŽżé—Žäť¤ç‰ŒćĽĺŽ‰ĺ…¨ĺœ°äź é€’ĺŽ˘ćˆˇçŤŻçš„čşŤäť˝äżĄćŻ\n\n# 测试(Testing)\n\n如何更便捷的测试?\n\n- [服务组件测试(Service Component Test)](testing/service-component-test.html)new - a test suite that tests a service in isolation using test doubles for any services that it invokes\n- [服务集成协议测试(Service Integration Contract Test)](testing/service-integration-contract-test.html)new - a test suite for a service that is written by the developers of another service that consumes it\n\n# 可观测性(Observability)\n\n如何掌握一个运行中微服务应用的行为并进行有效的故障排错?\n\n- [应用日志(Log aggregation)](observability/application-logging.html) new - 聚合应用程序产生的日志文件\n- [ĺş”ç”¨ćŒ‡ć ‡ďźˆApplication metrics)](observability/application-metrics.html) new - ĺœ¨äťŁç ä¸­ĺŽžçŽ°ć”śé›†ĺş”ç”¨čżčĽčż‡ç¨‹ä¸­ĺ„çąťćŒ‡ć ‡çš„ĺŠŸčƒ˝\n- [审计日志(Audit logging)](observability/audit-logging.html) new - ćŠŠç”¨ćˆˇčĄŒä¸şčŽ°ĺ˝•ĺœ¨ć•°ćŽĺş“ä¸­äž›ć—ĽĺŽć ¸ćŸĽ\n- [分布式追踪(Distributed tracing)](observability/distributed-tracing.html)new - ĺœ¨ćœĺŠĄäťŁç ä¸­é’ˆĺŻšćŻä¸€ä¸Şĺ¤–éƒ¨čŽżé—ŽďźŒéƒ˝ĺˆ†é…ä¸€ä¸Şĺ”Żä¸€çš„ć ‡čŻ†çŹŚďźŒĺšśĺœ¨čˇ¨ćœĺŠĄčŽżé—Žć—śäź é€’čż™ä¸Şć ‡čŻ†çŹŚäťĽäž›čż˝č¸Şĺˆ†ĺ¸ƒĺźĺź•ĺ‘çš„é—Žé˘˜ă€‚äž‹ĺŚ‚ďźŒĺ˝“é€ščż‡ä¸€ä¸Şé›†ä¸­ĺźćœĺŠĄĺ¤„ç†ĺ¤–éƒ¨čŻˇćą‚ć—śďźŒčŽ°ĺ˝•čŻˇćą‚ćœŹčşŤçš„äżĄćŻäťĽĺŠčŻˇćą‚çš„ĺź€ĺ§‹ĺ’Œçť“ćŸć—śé—´ă€‚\n- [异常追踪(Exception tracking)](observability/exception-tracking.html)new - ćŠŠć‰€ćœ‰ćœĺŠĄç¨‹ĺşäťŁç č§Śĺ‘çš„ĺź‚ĺ¸¸äżĄćŻéƒ˝ćą‡čšĺˆ°é›†ä¸­çš„ĺź‚ĺ¸¸čż˝č¸ŞćœĺŠĄďźŒĺšść šćŽä¸€ĺŽšçš„é€ťčž‘ĺŻšĺź€ĺ‘č€…ćˆ–čżçť´äşşĺ‘˜ĺ‘ĺ‡şé€šçŸĽă€‚\n- [健康检查 APIHealth check API)](observability/health-check-api.html) new - 一个监控服务可调用的 API,通常返回服务健康度信息,或对 ping 等心跳检查请求做出响应。\n\n# UI 模式(UI patterns)\n\n如何将源自多个服务的信息组织在一起生成 UI 界面或 Web 页面?\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťşďźˆServer-side page fragment composition)](ui/server-side-page-fragment-composition.html)new - 在服务器端通过编排由多个业务或领域相关后端服务生成的 HTML 片段来构建前端输出的页面内容\n- [厢戡獯 UI 构建(Client-side UI composition)](ui/client-side-ui-composition.html)new - 在客户端通过编排由多个业务或领域相关 UI 组件生成的 HTML 片段来构建前端输出的页面内容\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 13745, "slov": 615, "odkazu": 99, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:36", "sha256": "b085caa5a75b84621f1819a84444a1bdec3cbf0bc32edb022338faadec2ad6f7", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://book.douban.com/subject/1471535/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/microservice-chassis.html", "titulek": "Microservice chassis", "h1": "Pattern: Microservice chassis", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Microservice chassis"}, {"uroven": 2, "text": "Context"}, {"uroven": 1, "text": "Forces"}, {"uroven": 1, "text": "Solution"}, {"uroven": 1, "text": "Example"}, {"uroven": 2, "text": "Resulting context"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Microservice chassis\n\n## Context\n\nWhen you start the development of an application you often spend a significant amount of time putting in place the mechanisms to handle cross-cutting concerns.\nExamples of cross-cutting concern include:\n\n- Externalized configuration - includes credentials, and network locations of external services such as databases and message brokers\n- Logging - configuring of a logging framework such as log4j or logback\n- Health checks - a url that a monitoring service can “ping” to determine the health of the application\n- Metrics - measurements that provide insight into what the application is doing and how it is performing\n\nAs well as these generic cross-cutting concerns, there are also cross-cutting concerns that are specific to the technologies that an application uses.\nApplications that use infrastructure services such as databases or a message brokers require boilerplate configuration in order to do that.\nFor example, applications that use a relational database must be configured with a connection pool.\nWeb applications that process HTTP requests also need boilerplate configuration.\n\nIt is common to spend one or two days, sometimes even longer, setting up these mechanisms.\nIf you going to spend months or years developing a monolithic application then the upfront investment in handling cross-cutting concerns is insignificant.\nThe situation is very different, however, if you are developing an application that has the [microservice architecture](microservices.html).\nThere are tens or hundreds of services.\nYou will frequently create new services, each of which will only take days or weeks to develop.\nYou cannot afford to spend a few days configuring the mechanisms to handle cross-cutting concerns.\nWhat is even worse is that in a microservice architecture there are additional cross-cutting concerns that you have to deal with including service registration and discovery, and circuit breakers for reliably handling partial failure.\n\n# Forces\n\n- Creating a new microservice should be fast and easy\n- When creating a microservice you must handle cross-cutting concerns such as externalized configuration, logging, health checks, metrics, service registration and discovery, circuit breakers. There are also cross-cutting concerns that are specific to the technologies that the microservices uses.\n\n# Solution\n\nBuild your microservices using a microservice chassis framework, which handles cross-cutting concerns\n\n# Example\n\nExamples of microservice chassis frameworks:\n\n- Java\n - [Spring Boot](http://projects.spring.io/spring-boot/) and [Spring Cloud](http://cloud.spring.io/)\n - [Dropwizard](https://dropwizard.github.io/)\n- Go\n - [Gizmo](http://open.blogs.nytimes.com/2015/12/17/introducing-gizmo/?_r=2)\n - [Micro](https://github.com/micro)\n - [Go kit](https://github.com/go-kit/kit)\n\n## Resulting context\n\nThe major benefit of a microservice chassis is that you can quickly and easy get started with developing a microservice.\n\nYou need a microservice chassis for each programming language/framework that you want to use.\nThis can be an obstacle to adopting a new programming language or framework.\n\nThere are the following related patterns:\n\n- [Microservices](microservices.html) - this pattern motivates the need for the Microservice Chassis pattern\n- [Self Registration](self-registration.html) - the microservice chassis is often responsible for registering the service with the service registry\n- [Client-side discovery](client-side-discovery.html) - the microservice chassis is often responsible for client-side service discovery\n- [Circuit Breaker](reliability/circuit-breaker.html) - the microservice chassis framework might implement this pattern\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 8718, "slov": 716, "odkazu": 68, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:54", "sha256": "0fc1af3ef2735a484f16255bb0922765d02d8af854bacdbcd27c5c71a9f64aa1", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "http://projects.spring.io/spring-boot/", "http://cloud.spring.io/", "https://dropwizard.github.io/", "http://open.blogs.nytimes.com/2015/12/17/introducing-gizmo/?_r=2", "https://github.com/micro", "https://github.com/go-kit/kit", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/microservices.html", "titulek": "Microservice Architecture pattern", "h1": "模式: 微服务架构", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "模式: 微服务架构"}, {"uroven": 2, "text": "背景"}, {"uroven": 2, "text": "问题"}, {"uroven": 2, "text": "需求"}, {"uroven": 2, "text": "方案"}, {"uroven": 2, "text": "示例"}, {"uroven": 2, "text": "结果"}, {"uroven": 3, "text": "优势"}, {"uroven": 3, "text": "弊端:"}, {"uroven": 3, "text": "需要解决的问题"}, {"uroven": 4, "text": "何时应该使用微服务架构?"}, {"uroven": 4, "text": "如何将应用拆分为服务?"}, {"uroven": 4, "text": "如何维护数据一致性?"}, {"uroven": 4, "text": "如何实现数据查询?"}, {"uroven": 2, "text": "相关模式"}, {"uroven": 2, "text": "已知案例"}, {"uroven": 1, "text": "ç¤şäž‹äťŁç "}, {"uroven": 1, "text": "致谢"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# 模式: 微服务架构\n\n## 背景\n\n在开发服务端企业应用时,应用需要支持各种不同类型的客户端,比如桌面浏览器、移动浏览器以及原生移动应用。应用还需要向第三方提供可访问的API,并通过Web Service或者消息代理与其它应用实现集成。应用通过执行业务逻辑、访问数据库、与其它系统交换信息、并返回一条HTML/JSON/XML响应,来处理请求(HTTP请求与消息)。\n\nĺş”ç”¨é‡‡ç”¨ĺ¤šĺą‚ćžśćž„ćˆ–č€…ĺ…­č§’ćžśćž„ďźŒä¸ťčŚç”ąäťĽä¸‹ĺ‡ çąťä¸ĺŒçť„äťśćž„ćˆďźš\n\n- 展现组件——负责处理HTTP请求并响应HTML或者JSON/XML(对于web Services APIs)\n- 业务逻辑——应用的业务逻辑\n- 数据库访问逻辑——用于访问数据库的数据访问对象\n- 应用集成逻辑——消息层,例如基于Spring Integration\n\n不同逻辑组件分别响应应用中的不同功能模块。\n\n## 问题\n\n应用的部署架构是什么?\n\n## 需求\n\n- 应用需要由一个开发者团队专门负责\n- 团队新成员需要快速上手\n- 应用应该易于理解和修改\n- 对应用能够进行持续部署\n- 需要在多台设备上运行应用副本,从而满足可扩展性与可用性的要求\n- 使用各种新技术(框架、编程语言等)\n\n## 方案\n\n用 [Scale Cube](../../articles/scalecube.html) 方法(特别是Y轴扩展)设计应用架构,将应用程序按功能拆分为一组互相协作的服务。每个服务实现一组特定、相关的功能。举例来说,一个应用程序可能由订单管理服务、客户管理服务等多个服务构成。\n\n服务间的通信则可由HTTP/REST等同步协议或者AMQP等异步协议实现。服务可以彼此独立开发与部署。每个服务皆有自己的[数据库](data/database-per-service.html),从而保证其与其它服务解耦。在必要时,可利用数据库复制机制或者应用层[事件驱动](data/event-driven-architecture.html)机制,维护数据库之间的数据一致性。\n\n## 示例\n\n假设需要构建一款电子商务应用程序,使其能够接收来自客户的订单、验证库存信息与可用信用额度,而后进行发货。该应用程序会包含多个组件,其中StoreFrontUI负责实现用户界面,而其它后端服务则分别负责检查信用额度、维护库存信息以及发送订单。\n\n此应用程序被部署为一组服务集合。\n\n## 结果\n\n### 优势\n\n此类解决方案拥有以下优势:\n\n- 每项微服务相对较小\n - 易于开发者理解\n - IDE处理速度更快,可提高开发者生产效率\n - WebĺŽšĺ™¨ĺŻĺŠ¨é€ŸĺşŚć›´ĺżŤďźŒćéŤ˜ĺź€ĺ‘č€…ç”Ÿäş§ć•ˆçŽ‡ĺšśĺŻĺŠ ĺżŤéƒ¨ç˝˛é€ŸĺşŚ\n- 每项服务皆可独立于其它服务进行部署——简化频繁部署新服务版本的流程\n- 易于实现规模化开发。多团队可以共同进行开发工作。每个(双披萨,即团队成员规模控制在订购两块披萨即可吃饱的程度)团队负责其中一项服务。各团队可独立于其他团队,进行开发、部署工作及扩展自身服务。\n- 改善故障隔离。举例来说,如果某一服务出现内存外溢,则只有该服务本身受到影响。其它服务将继续正常处理请求。相比之下,单体架构中的故障组件会令整套系统陷入瘫痪。\n- 每项服务可独立进行开发与部署\n- ć— éœ€é•żćœŸä˝żç”¨ĺŒä¸€ĺĽ—ćŠ€ćœŻĺ †ć ˆ\n\n### 弊端:\n\n但这类解决方案中也存在着以下弊端:\n\n- ĺź€ĺ‘č€…ĺż…éĄťĺş”ĺŻšĺˆ›ĺťşĺˆ†ĺ¸ƒĺźçłťçťŸć‰€äş§ç”Ÿçš„é˘ĺ¤–çš„ĺ¤ć‚ĺ› ç´ ă€‚\n - 现有开发者工具/IDEä¸ťčŚé˘ĺ‘ĺ•ä˝“ĺş”ç”¨ç¨‹ĺşďźŒĺ› ć­¤ć— ćł•ć˜žĺźć”ŻćŒĺˆ†ĺ¸ƒĺźĺş”ç”¨çš„ĺź€ĺ‘ă€‚\n - ćľ‹čŻ•ĺˇĽä˝œć›´ĺŠ ĺ›°éšžă€‚\n - 开发者必须采取服务间通信机制。\n - 很难在不使用分布式事务机制的情况下跨服务实现功能。\n - 跨服务实现功能要求各团队进行密切协作。\n- 部署复杂。在生产环境下,对这类多种服务类型构建而成的系统进行部署与管理十分困难。\n- ĺ†…ĺ­˜ĺ ç”¨é‡ć›´éŤ˜ă€‚ĺžŽćœĺŠĄćžśćž„ä˝żç”¨N*M个服务实例替代N个单体应用实例,如果每项服务运行自己的JVM(或者其它类似机制),且各实例之间需要进行隔离,那将导致M倍JVM运行时的额外开销。另外,如果每项服务都在自己的虚拟机(例如 EC2 实例)上运行,如同Netflixä¸€ć ˇďźŒé‚Łäšˆé˘ĺ¤–ĺź€é”€äźšć›´éŤ˜ă€‚\n\n### 需要解决的问题\n\n采用微服务架构之前,有若干需要解决的问题。\n\n#### 何时应该使用微服务架构?\n\n应用此类方案带来的挑战在于如何把握好时机。在开发应用程序的最初版本时,大家往往不会面临需要使用微服务架构才能解决的问题。另外,使用复杂的分布式架构会拖慢开发流程。对于初创企业,其面临的最大挑战往往在于如何快速发展商业模式及附属应用。微服务架构中的Yč˝´ć‹†ĺˆ†ć–šĺźĺŻčƒ˝ä˝żĺş”ç”¨ć›´ĺŠ éšžäťĽčż…é€Ÿčż­äťŁă€‚ä˝†ć˜ŻďźŒĺŚ‚ćžœĺ˝“é˘ä¸´éœ€čŚč§Łĺ†łć‰Šĺą•ć€§é—Žé˘˜çš„ć—śĺ€™ĺ†ĺŽťčż›čĄŒĺŠŸčƒ˝ć‹†ĺˆ†ďźŒĺ•ä˝“ĺş”ç”¨çš„ĺ¤ć‚äžčľ–ć€§ä˝żĺ…śĺžˆéšžč˘Ťĺˆ†č§Łä¸şćœĺŠĄé›†ĺˆă€‚\n\n#### 如何将应用拆分为服务?\n\n另一项挑战在于如何将系统拆分为多个微服务。这虽然很棘手但还是有些可行之策:\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†ďźˆDecompose by business capability)](decomposition/decompose-by-business-capability.html) - ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ç•ŒĺŽšćœĺŠĄçš„čŒƒĺ›´\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†ďźˆDecompose by subdomain)](decomposition/decompose-by-subdomain.html) - ć šćŽé˘†ĺŸŸéŠąĺŠ¨čŽžčŽĄä¸­ĺ­ĺŸŸçš„ćŚ‚ĺżľç•ŒĺŽšćœĺŠĄçš„čŒƒĺ›´\n- ć šćŽâ€œĺŠ¨čŻâ€ćˆ–č€…ç”¨äž‹čż›čĄŒćœĺŠĄĺˆ’ĺˆ†ă€‚ä¸žäž‹ćĽčŻ´ďźŒćˆ‘äťŹçťĺ¸¸äźšĺœ¨ç”ľĺ­ĺ•†ĺŠĄĺş”ç”¨ä¸­ĺ‘çŽ°ćœ‰ĺ•ç‹Źçš„â€œĺ‘č´§â€ćœĺŠĄç”¨äşŽĺ¤„ç†ĺˇ˛ĺŽŒćˆčŽ˘ĺ•ă€‚ĺŚä¸€ç§ĺ¸¸č§çš„â€œĺŠ¨čŻâ€ĺˆ’ĺˆ†ć–šĺźć˜ŻĺŽžçŽ°ç™ťĺ˝•ç”¨äž‹çš„â€œç™ťĺ˝•â€ćœĺŠĄă€‚\n- ć šćŽâ€œĺčŻâ€ćˆ–č€…čľ„ćşčż›čĄŒçłťçťŸĺˆ’ĺˆ†ă€‚čż™çąťćœĺŠĄč´Ÿč´ŁĺˆŠç”¨ç‰šĺŽšçš„ĺŽžä˝“/资源完成一系列操作。举例来说,大家可能会在电子商务系统当中发现有“库存”服务用于跟踪货物的库存。\n\n在理想情况下,每项服务都应只面向一小部分职责。(大叔)Bob Martin ć›žćĺ‡şć šćŽĺ•ä¸€č´ŁäťťĺŽŸĺˆ™ďźˆSingle Responsibility Principle,简称 SRP)进行类的设计。SRP äźšç”¨ĺ•ä¸€ĺ˜ć›´ç†ç”ąĺŽťĺŽšäš‰ä¸€ä¸Şçąťçš„čŒč´Łďźšä¸€ä¸Şçąťçš„çŠść€ĺ˜ć›´ĺŞčƒ˝ç”ąä¸€ä¸ŞĺŽŸĺ› ĺŻźč‡´ă€‚ĺŒç†ďźŒćˆ‘äťŹäšŸĺŻäťĽĺœ¨ĺžŽćœĺŠĄčŽžčŽĄĺ˝“ä¸­ĺź•ĺ…Ľ SRP。\n\n另一项可用于指导服务设计的是Unix工具的设计思路。Unix 提供大量工具选项,包括 grep、cat 以及 find 等等。每种工具都只负责实现一项功能,而且功能良好,它们可以通过Shell脚本与其它工具结合进而执行复杂的任务。\n\n#### 如何维护数据一致性?\n\n为了确保松耦合,每个服务都有独用的数据库。维护服务间的数据一致性成为了挑战。在多数应用的架构下,2 阶段提交和分布式事务不再是一个可选项。应用需要采用[事件驱动架构](data/event-driven-architecture.html)ďźŒä¸€ä¸ŞćœĺŠĄĺœ¨ĺ…ść•°ćŽĺ‘ç”Ÿĺ˜ĺŒ–ć—śďźŒĺŻšĺ¤–ĺ‘ĺ¸ƒä¸€ä¸Şäş‹äťśďźŒĺ…śäť–ćœĺŠĄčŽ˘é˜…ĺšśé€ščż‡ćśˆč´ščż™ä¸Şäş‹äťśćĽĺŻšĺş”ć›´ć–°č‡Şĺˇąçš„ć•°ćŽă€‚ćœ‰ä¸€äş›ĺŻé çš„ć–šĺźĺŻäťĽĺŽžçŽ°äş‹äťśçš„ĺ‘ĺ¸ƒĺ’Œć•°ćŽçš„ć›´ć–°ďźŒćŻ”ĺŚ‚[事件溯源](data/event-sourcing.html) 和[事物日志跟踪](data/transaction-log-tailing.html)。\n\n#### 如何实现数据查询?\n\n另一个挑战是进行跨服务的数据的查询。一个常用的解决方式是采用[CQRS](data/cqrs.html),维护一份包含重要数据的视图并通过事件流的方式保持数据的更新。\n\n## 相关模式\n\n微服务架构有很多与之相关的模式,[单体架构](monolithic.html) 便是微服务架构的另一众选择。在应用微服务架构时,您还会跟如下这些模式打交道:\n\n- 服务拆分模式\n - [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/decomposition/decompose-by-business-capability.html) new\n - [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/decomposition/decompose-by-subdomain.html) new\n- [每服务数据库模式](data/database-per-service.html) 描述了服务之间采用独享数据库的方式实现了解耦合。\n- [API 网关模式](apigateway.html) 定义在微服务架构下客户端访问服务的方式。\n- [客户端服务发现](client-side-discovery.html) 和 [服务器端服务发现](server-side-discovery.html) 模式用来在微服务架构中把客户端请求路由到一个可用的服务实例上。\n- 消息和远程过程调用是服务间通信的两种选择。\n- [单主机上部署服务的单个实例](deployment/single-service-per-host.html) 和 [单主机上部署服务的多个实例](deployment/multiple-services-per-host.html) 模式是两种不同的部署策略。\n- 解决边界问题的模式:: [微服务的基底模式](/patterns/microservice-chassis.html) 和 [配置信息外部化](/patterns/externalized-configuration.html) new\n- 可测试性模式: [服务组件测试](testing/service-component-test.html) new 和 [服务集成协议测试](testing/service-integration-contract-test.html) new\n- [断路器](/patterns/reliability/circuit-breaker.html) new\n- [访问令牌](/patterns/security/access-token.html) new\n- 可观测性模式:\n - [应用日志](/patterns/observability/application-logging.html) new\n - [ĺş”ç”¨ćŒ‡ć ‡](/patterns/observability/application-metrics.html) new\n - [审计日志](/patterns/observability/audit-logging.html) new\n - [分布式追踪](/patterns/observability/distributed-tracing.html) new\n - [异常追踪](/patterns/observability/exception-tracking.html) new\n - [健康检查](/patterns/observability/health-check-api.html) new\n- UI 模式:\n - [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/ui/server-side-page-fragment-composition.html) new\n - [厢戡獯 UI 构建](/patterns/ui/client-side-ui-composition.html) new\n\n## 已知案例\n\n众多大型网站将单体架构发展为微服务架构,其中包括 [Netflix](http://techblog.netflix.com/)、[Amazon](http://highscalability.com/blog/2007/9/18/amazon-architecture.html) 与 [eBay](http://www.addsimplicity.com/downloads/eBaySDForum2006-11-29.pdf) 等。\n\n作为一个热门视频流服务,Netflix 利用一套大规模的面向服务的架构来承载高于 30% 的互联网流量。该公司每天需要处理来自 800 多种设备的 10 亿多次视频流 API 请求。平均每次 API 调用会在后端服务中产生 6 次后续调用。\n\nAmazon.com 最初采用一套双层架构。为了扩展业务规模,其决定迁移至一套由数百项后端服务构成的面向服务的架构。多个应用调用这些服务,其中包括 Amazon.com网站和Web服务API。Amazon.com 网站需要调用 100 到 150 个服务方可获取到构建一个 Web 页面所需的全部数据。\n\n作为拍卖网站,eBay.com 也是从单体架构逐步转向面向服务的架构。其应用层由多个独立应用构成。每个应用负责实现完成一组特定功能的业务逻辑,例如购买或者出售。每个应用皆利用X轴进行拆分,部分应用(例如搜索)以Z轴进行拆分。eBay.com 还在数据库层采用了 X、Y 与 Z 轴相结合的扩展方式。\n\n[这里](../../articles/whoisusingmicroservices.html)汇聚了使用微服务架构企业的众多案例。\n\n# ç¤şäž‹äťŁç \n\nChris Richardson 提供了一套基于微服务架构的[ç¤şäž‹äťŁç ](http://eventuate.io/exampleapps.html) 。\n\n# 致谢\n\n为了避免重复翻译,本文在中国普元公司宋潇文先生的[译文](http://blog.csdn.net/xn_sung/article/details/52318956)基础之上整理修订,在此向宋潇文先生表示感谢!\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 16544, "slov": 583, "odkazu": 93, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:56", "sha256": "2a505d385fc4de34fd444d8fe12db690628c9a75279200014f2d6c3785bc890f", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "http://techblog.netflix.com/", "http://highscalability.com/blog/2007/9/18/amazon-architecture.html", "http://www.addsimplicity.com/downloads/eBaySDForum2006-11-29.pdf", "http://blog.csdn.net/xn_sung/article/details/52318956", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/monolithic.html", "titulek": "Monolithic Architecture pattern", "h1": "模式: 单体架构", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "模式: 单体架构"}, {"uroven": 2, "text": "背景"}, {"uroven": 2, "text": "问题"}, {"uroven": 2, "text": "需求(Forces)"}, {"uroven": 2, "text": "方案"}, {"uroven": 2, "text": "ä¸žä¸Şć —ĺ­"}, {"uroven": 2, "text": "结果(Resulting context)"}, {"uroven": 2, "text": "相关模式"}, {"uroven": 2, "text": "已知案例"}, {"uroven": 2, "text": "变体"}, {"uroven": 2, "text": "致谢"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# 模式: 单体架构\n\n## 背景\n\n在开发服务端企业应用时,应用需要支持各种不同类型的客户端,比如桌面浏览器、移动浏览器以及原生移动应用。应用还需要向第三方提供可访问的API,并通过Web Service或者消息代理与其它应用实现集成。应用通过执行业务逻辑、访问数据库、与其它系统交换信息、并返回一条HTML/JSON/XML响应,来处理请求(HTTP请求与消息)。\n\nĺş”ç”¨é‡‡ç”¨ĺ¤šĺą‚ćžśćž„ćˆ–č€…ĺ…­č§’ćžśćž„ďźŒä¸ťčŚç”ąäťĽä¸‹ĺ‡ çąťä¸ĺŒçť„äťśćž„ćˆďźš\n\n- 展现组件——负责处理HTTP请求并响应HTML或者JSON/XML(对于web Services APIs)\n- 业务逻辑——应用的业务逻辑\n- 数据库访问逻辑——用于访问数据库的数据访问对象\n- 应用集成逻辑——消息层,例如基于Spring Integration\n\n不同逻辑组件分别响应应用中的不同功能模块。\n\n## 问题\n\n应用的部署架构是什么?\n\n## 需求(Forces)\n\n- 应用需要由一个开发者团队专门负责\n- 团队新成员需要快速上手\n- 应用应该易于理解和修改\n- 对应用能够进行持续部署\n- 需要在多台设备上运行应用副本,从而满足可扩展性与可用性的要求\n- 使用各种新技术(框架、编程语言等)\n\n## 方案\n\n使用单体架构构建应用。例如:\n\n- 单个Java WAR文件。\n- 单个Rails或者NodeJSäťŁç ç›Žĺ˝•ĺą‚çş§ă€‚\n\n## ä¸žä¸Şć —ĺ­\n\n假设需要构建一款电子商务应用程序,使其能够接收来自客户的订单、验证库存信息与可用信用额度,而后进行发货。该应用程序会包含多个组件,其中StoreFrontUI负责实现用户界面,而其它后端服务则分别负责检查信用额度、维护库存信息以及发送订单。\n\n应用被当作一个单体进行部署。例如:一个 Java Web 应用仅包含一个运行在 Tomcat 之类的 Web 容器上 WAR 文件。一个 Rails 应用由单一目录层级构成,该目录层级的部署通过在 Apache/Nginx 上使用 Phusion Passenger,或者在 Tomcat 上使用 JRuby ĺž—äťĽĺŽžçŽ°ă€‚ä¸şäş†ćéŤ˜ć‰Šĺą•ć€§ĺ’ŒĺŻç”¨ć€§ďźŒä˝ ĺŻäťĽĺœ¨č´Ÿč˝˝ĺ‡čĄĄĺ™¨äš‹ĺŽčżčĄŒć­¤ĺş”ç”¨çš„ĺ¤šä¸ŞĺŽžäž‹ă€‚\n\n## 结果(Resulting context)\n\n这类解决方案拥有以下优势:\n\n- 易于开发 — 当前开发工具与IDEçš„čŽžčŽĄç›Žć ‡ĺłĺœ¨äşŽć”ŻćŒĺ•ä˝“ĺş”ç”¨çš„ĺź€ĺ‘ă€‚\n- 易于部署 — ä˝ ĺŞéœ€čŚĺ°†čŻĽWAR(或者目录层级)部署在合适的运行环境中即可。\n- 易于扩展 — ä˝ ĺŻäťĽĺœ¨č´Ÿč˝˝ĺ‡čĄĄĺ™¨ĺŽé˘čżčĄŒĺ¤šä¸Şĺş”ç”¨ĺ‰ŻćœŹĺŽžçŽ°ć‰Šĺą•ă€‚\n\n然而,一旦应用变大、团队扩大,这种方案的弊端将会变得愈发明显:\n\n- ĺ•ä˝“ĺş”ç”¨ĺˇ¨ĺ¤§çš„äťŁç ĺş“ĺŻčƒ˝äźščŽŠäşşćœ›č€Œç”Ÿç•ďźŒç‰šĺˆŤć˜ŻĺŻšé‚Łäş›ĺ›˘é˜Ÿć–°ćˆĺ‘˜ćĽčŻ´ă€‚ĺş”ç”¨éšžäťĽč˘Ťç†č§Łĺ’Œčż›čĄŒäżŽć”šďźŒčż›č€ŒĺŻźč‡´ĺź€ĺ‘é€ŸĺşŚĺ‡ć…˘ă€‚ç”ąäşŽć˛Ąćœ‰ć¸…ć™°çš„ć¨Ąĺ—čžšç•ŒďźŒć¨Ąĺ—ĺŒ–äźšé€ć¸ćśˆĺ¤ąă€‚ĺŚĺ¤–ďźŒç”ąäşŽéšžäťĽć­ŁçĄŽćŠŠćĄäťŁç ĺ˜ĺŒ–ďźŒĺŻźč‡´äťŁç č´¨é‡é€ć­Ľä¸‹ćť‘ďźŒé™ˇĺ…Ľćść€§ĺžŞçŽŻă€‚\n- 过载的IDEâ€”â€”äťŁç ĺş“čśŠĺ¤§ďźŒIDE速度越慢,开发者的生产效率越低。\n- 过载的Web容器——应用越大,Web容器启动时间越长。容器启动耗费时间,极大影响到开发者的生产效率。对部署工作也有负面影响。\n- ćŒçť­éƒ¨ç˝˛ĺ›°éšžâ€”â€”ĺˇ¨ĺ¤§çš„ĺ•ä˝“ĺş”ç”¨ćœŹčşŤĺ°ąć˜Żé˘‘çšéƒ¨ç˝˛çš„ä¸€ĺ¤§éšœç˘ă€‚ä¸şäş†ć›´ć–°ä¸€ä¸Şçť„äťśďźŒä˝ ĺż…éĄťé‡ć–°éƒ¨ç˝˛ć•´ä¸Şĺş”ç”¨ă€‚čż™äźšä¸­ć–­é‚Łäş›ĺŻčƒ˝ä¸Žć›´ć”šć— ĺ…łçš„ĺŽĺ°äťťĺŠĄďźˆäž‹ĺŚ‚Java应用中的QuartzäťťĺŠĄďź‰ďźŒĺŒć—śĺŻčƒ˝ĺź•ĺ‘é—Žé˘˜ă€‚ĺŚĺ¤–ďźŒćœŞč˘Ťć›´ć–°çš„çť„äťśćœ‰ĺŻčƒ˝ć— ćł•ć­Łĺ¸¸ĺŻĺŠ¨ă€‚é‡ć–°éƒ¨ç˝˛äźšĺ˘žĺŠ éŁŽé™ŠďźŒčż›č€Œé˜ťç˘é˘‘çšć›´ć–°ă€‚ĺ› ä¸şç”¨ćˆˇç•Œé˘ĺź€ĺ‘č€…çťĺ¸¸éœ€čŚčż›čĄŒĺżŤé€Ÿčż­äťŁä¸Žé˘‘çšé‡ć–°éƒ¨ç˝˛ďźŒć‰€äťĽčż™ĺŻšç”¨ćˆˇç•Œé˘ĺź€ĺ‘č€…č€Œč¨€ć›´ĺŠ ć˜Żä¸Şéšžé˘˜ă€‚\n- ĺş”ç”¨ć‰Šĺą•ĺ›°éšžâ€”â€”ĺ•ä˝“ćžśćž„ĺŞčƒ˝čż›čĄŒä¸€çť´äź¸çźŠă€‚ä¸€ć–šé˘ďźŒĺŽƒĺŻäťĽé€ščż‡čżčĄŒĺ¤šä¸Şĺş”ç”¨ĺ‰ŻćœŹćĽĺ˘žĺŠ ä¸šĺŠĄĺŽšé‡ďźŒĺŽžçŽ°ć‰Šĺą•ă€‚ä¸€äş›äş‘ćœĺŠĄç”šč‡łĺŻäťĽć šćŽč´Ÿč˝˝é‡ĺŠ¨ć€č°ƒć•´ĺŽžäž‹ć•°é‡ă€‚ä˝†ĺœ¨ĺŚä¸€ć–šé˘ďźŒć•°ćŽé‡ĺ˘žĺ¤§äźšä˝żĺž—čŻĽćžśćž„ć— ćł•äź¸çźŠă€‚ćŻä¸Şĺş”ç”¨ĺŽžäž‹éœ€čŚčŽżé—Žć‰€ćœ‰ć•°ćŽďźŒĺŻźč‡´çź“ĺ­˜ä˝Žć•ˆďźŒĺŠ ĺ¤§ĺ†…ĺ­˜ĺ ç”¨ĺ’ŒI/O流量。另外,不同的应用组件有不同的资源需求——有的是CPUĺŻ†é›†ĺž‹çš„ďźŒĺŚĺ¤–ä¸€äş›ć˜Żĺ†…ĺ­˜ĺŻ†é›†ĺž‹çš„ă€‚ĺ•ä˝“ćžśćž„ć— ćł•ĺ•ç‹Źäź¸çźŠćŻä¸Şçť„äťśă€‚\n- 难于进行规模化开发——单体应用是规模化开发的障碍。应用一旦达到特定规模,需要将现有组织拆分成多个团队,每个团队负责不同的功能模块。举例来说,我们可能需要设立UIĺ›˘é˜Ÿă€äźščŽĄĺ›˘é˜Ÿă€ĺş“ĺ­˜ĺ›˘é˜Ÿç­‰ç­‰ă€‚ĺ•ä˝“ĺş”ç”¨çš„é—Žé˘˜ĺœ¨äşŽĺŽƒä˝żĺ›˘é˜Ÿć— ćł•ç‹ŹçŤ‹ĺą•ĺź€ĺˇĽä˝œă€‚ĺ›˘é˜Ÿéœ€čŚĺœ¨ĺˇĽä˝œčż›ĺşŚĺ’Œé‡ć–°éƒ¨ç˝˛ä¸Ščż›čĄŒĺč°ƒă€‚ĺŻšäşŽĺ„ĺ›˘é˜Ÿč€Œč¨€ďźŒčż™ä˝żĺž—ĺ˜ć›´ĺ’Œć›´ć–°äş§ĺ“ĺ˜ĺž—ĺź‚ĺ¸¸ĺ›°éšžă€‚\n- éœ€čŚé•żćœŸĺ…łćł¨ĺŒä¸€ĺĽ—ćŠ€ćœŻć ˆâ€”â€”ĺ•ä˝“ćžśćž„čżŤä˝żćˆ‘äťŹé•żćœŸä˝żç”¨ĺœ¨ĺź€ĺ‘ĺˆćœŸé€‰ĺŽšçš„ćŠ€ćœŻĺ †ć ˆďźˆĺœ¨ćŸäş›ćƒ…ĺ†ľä¸‹ďźŒĺŻčƒ˝ć˜ŻćŸäş›ćŠ€ćœŻçš„ç‰šĺŽšç‰ˆćœŹďź‰ă€‚ĺ•ä˝“ĺş”ç”¨ć˜Żć¸čż›é‡‡ç”¨ć–°ćŠ€ćœŻçš„éšœç˘ă€‚ä¸žäž‹ćĽčŻ´ďźŒĺŚ‚ćžœćˆ‘äťŹé€‰ć‹Šäş†JVM,那么我们可以选择JavaäťĽĺ¤–çš„ä¸€äş›čŻ­č¨€ďźŒĺ› ä¸şGroovy和Scala等基于JVM的语言也可以和Java进行良好的互操作。但此时以非JVMčŻ­č¨€çź–ĺ†™çš„çť„äťśĺ°ąć— ćł•ĺœ¨čŻĽĺ•ä˝“ćžśćž„ä¸­ä˝żç”¨ă€‚ĺŚĺ¤–ďźŒĺŚ‚ćžœĺ¤§ĺŽść‰€ä˝żç”¨çš„ĺş”ç”¨ĺšłĺ°ćĄ†ćžśĺˇ˛çťčż‡ć—śďźŒé‚Łäšˆćˆ‘äťŹĺ°†ĺžˆéšžĺ°†ĺş”ç”¨čżç§ťĺˆ°ĺ…śĺŽƒć›´ć–°ĺšśä¸”ć›´ĺŽŒĺ–„çš„ćĄ†ćžśĺ˝“ä¸­ă€‚ćœ‰ć—śĺ€™ä¸şäş†é‡‡ç”¨ä¸€ĺĽ—ć–°ĺž‹ĺšłĺ°ćĄ†ćžśďźŒćˆ‘äťŹç”šč‡łéœ€čŚé‡ĺ†™ć•´ä¸Şĺş”ç”¨ďźŒčż™ć˜ŻéŁŽé™Šĺžˆĺ¤§çš„ĺˇĽä˝œă€‚\n\n## 相关模式\n\n[微服务架构](microservices.html) 是一种能够解决单体架构各种局限的备选模式。\n\n## 已知案例\n\n知名的互联网服务商最初皆采用单体架构,包括 Netflix、Amazon.com 以及 eBay 等等。作者开发的大多数 Web 应用也是用单体架构。\n\n## 变体\n\nć—\n\n## 致谢\n\nä¸şäş†éżĺ…é‡ĺ¤çżťčŻ‘ďźŒćœŹć–‡ć šćŽä¸­ĺ›˝ć™Žĺ…ƒĺ…Źĺ¸ĺŽ‹ć˝‡ć–‡ĺ…ˆç”Ÿçš„[译文](http://blog.csdn.net/xn_sung/article/details/52318942)整理修订,在此向宋潇文先生表示感谢!\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 11103, "slov": 380, "odkazu": 60, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:58", "sha256": "20359ab541ddaef6bacaa6e7ea997a19d8703e533addf7b21ed20f9dbd76c06b", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "http://blog.csdn.net/xn_sung/article/details/52318942", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/observability/application-logging.html", "titulek": "Log aggregation", "h1": "Pattern: Log aggregation", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Log aggregation"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Log aggregation\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\n\n## Problem\n\nHow to understand the behavior of an application and troubleshoot problems?\n\n## Solution\n\nA service writes information about what it is doing to a log file in a standardized format.\nThe log file contains errors, warnings, information and debug messages.\nUse a centralized logging service that aggregates logs from each services instance and allows users to search.\n\n- [Distributed tracing](distributed-tracing.html) - include the external request id in each log message\n- [Exception tracking](exception-tracking.html) - as well as logging exceptions, report them to an exception tracking service\n\n## Examples\n\n- [AWS Cloud Watch](https://aws.amazon.com/cloudwatch/)\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5830, "slov": 324, "odkazu": 62, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:10", "sha256": "5be7862a2c729f72e7c071927c01319051a0a922f52e72f3975857a62c6cddef", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://aws.amazon.com/cloudwatch/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/observability/application-metrics.html", "titulek": "Application metrics", "h1": "Pattern: Application metrics", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Application metrics"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Application metrics\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\n\n## Problem\n\nHow to understand the behavior of an application and troubleshoot problems?\n\n## Solution\n\nInstrument a service’s code to gather statistics about individual operations.\nAggregate metrics in centralized metrics service, which provides reporting and alerting.\nThere are two models for delivery metrics to the metrics service:\nMetrics are either pushed to the metrics service or the metrics service pulls them using an API exposed by the service.\n\n## Examples\n\n- Instrumentation libraries:\n - Coda Hale/Yammer [Java Metrics Library](http://metrics.dropwizard.io/3.1.0/)\n - [Prometheus client libraries](https://prometheus.io/docs/instrumenting/clientlibs/)\n- Metrics aggregation services\n - [Prometheus](https://prometheus.io/docs/introduction/overview/)\n - [AWS Cloud Watch](https://aws.amazon.com/cloudwatch/)\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5976, "slov": 320, "odkazu": 63, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:12", "sha256": "62c054e1cde5b5e38cec4d936671c47eb513c0eae6308d64930106ba03df4c80", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "http://metrics.dropwizard.io/3.1.0/", "https://prometheus.io/docs/instrumenting/clientlibs/", "https://prometheus.io/docs/introduction/overview/", "https://aws.amazon.com/cloudwatch/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/observability/audit-logging.html", "titulek": "Audit logging", "h1": "Pattern: Audit logging", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Audit logging"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Audit logging\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\n\n## Problem\n\nHow to understand the behavior of an application and troubleshoot problems?\n\n## Solution\n\nRecord user activity in a database.\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5300, "slov": 255, "odkazu": 59, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:14", "sha256": "6104307e72e403870067fabf817193e71422cf30f8f9dbd8767fd49ee2451927", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/observability/distributed-tracing.html", "titulek": "Distributed tracing", "h1": "Pattern: Distributed tracing", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Distributed tracing"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Distributed tracing\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\n\n## Problem\n\nHow to understand the behavior of an application and troubleshoot problems?\n\n## Solution\n\nInstrument services with code that assigns each external request an unique identifier.\nThe external request id is passed to all services that are involved in handling the request and included in [Log aggregation](application-logging.html) messages.\nRecord information (e.g. start time, end time) about the work (e.g. service requests) performed when handling the external request in a centralized service.\n\n- [Log aggregation](application-logging.html) - external request identifier is included in each log messages\n\n## Examples\n\n- [Spring Cloud Sleuth](https://cloud.spring.io/spring-cloud-sleuth/) - distributed tracing for Spring Cloud applications\n- [Open Zipkin](http://zipkin.io/) - service for recording and displaying tracing information\n- [Open Tracing](http://opentracing.io) - standardized API for distributed tracing\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 6082, "slov": 347, "odkazu": 63, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:34", "sha256": "fa37591a831384d425e1f0dc3ecdc7cb8a0d020b97ff873506868a2b9b2a7545", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://cloud.spring.io/spring-cloud-sleuth/", "http://zipkin.io/", "http://opentracing.io/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/observability/exception-tracking.html", "titulek": "Exception tracking", "h1": "Pattern: Exception tracking", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Exception tracking"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Exception tracking\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\n\n## Problem\n\nHow to understand the behavior of an application and troubleshoot problems?\n\n## Solution\n\nReport all exceptions to a centralized exception tracking service that aggregates and tracks exceptions and notifies developers.\n\n- [Log aggregation](application-logging.html) - exceptions should be logged as well as reported to a tracking service\n\n> (译注:[sentry](https://sentry.io/welcome/)ĺ°ąć˜Żćäž›čż™ć ˇćœĺŠĄçš„ä¸€ä¸Ş SaaS 应用)\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5611, "slov": 285, "odkazu": 61, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:43", "sha256": "9cfad86ea578707c3de52b02f139f8b4d0b0d420ea7a4646ba1cb7194a55e8d2", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://sentry.io/welcome/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/observability/health-check-api.html", "titulek": "Health Check", "h1": "Pattern: Health Check API", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Health Check API"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Health Check API\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\n\n## Problem\n\nHow to understand the behavior of an application and troubleshoot problems?\n\n## Solution\n\nA service has an API (e.g. HTTP endpoint) that returns the health of the service.\nA monitoring service, monitoring service, [service registry](../service-registry.html) or load balancer can ‘ping’ the health check API to verify that a service instance is available.\n\n## Examples\n\n- [Spring Boot Actuator](http://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html)\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5666, "slov": 297, "odkazu": 61, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:47", "sha256": "ac0b3df60d10e54f8a6b187ffd692ff23b2118baa05da9206c1f032b534e630b", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "http://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/reliability/circuit-breaker.html", "titulek": "Circuit Breaker", "h1": "Pattern: Circuit Breaker", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Circuit Breaker"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Example"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Circuit Breaker\n\n## Problem\n\nHow to prevent a network or service failure from cascading to other services?\n\n## Solution\n\nA service client should invoke a remote service via a proxy that functions in a similar fashion to an electrical circuit breaker.\nWhen the number of consecutive failures crosses a threshold, the circuit breaker trips, and for the duration of a timeout period all attempts to invoke the remote service will fail immediately.\nAfter the timeout expires the circuit breaker allows a limited number of test requests to pass through.\nIf those requests succeed the circuit breaker resumes normal operation.\nOtherwise, if there is a failure the timeout period begins again.\n\n- The [Microservice Chassis](../microservice-chassis.html) might implement this pattern\n- An [API Gateway](../apigateway.html) will use this pattern to invoke services\n- A [Server-side discovery](../server-side-discovery.html) router might use this pattern to invoke services\n\n## Example\n\n- [Netflix Hystrix](https://github.com/Netflix/Hystrix)\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 6081, "slov": 369, "odkazu": 62, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:16", "sha256": "790f63690ea4964d37e25b444e63c322e6448bf0ac307d3c452ae7c6560c4e9f", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://github.com/Netflix/Hystrix", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/security/access-token.html", "titulek": "Access token", "h1": "Pattern: Access token", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Access token"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Access token\n\n## Problem\n\nHow to communicate the identity of the requestor to the services that handle the request?\n\n## Solution\n\nThe [API Gateway](../apigateway.html) authenticates the user and passes an access token (e.g. [JSON Web Token](https://jwt.io/)) that securely identifies the user in each request to the services.\n\n- The [API Gateway](../apigateway.html) uses this pattern.\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5441, "slov": 277, "odkazu": 60, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:01", "sha256": "2df0ed5652ddbf68aac59721abd80d530591503b4ac60c0dcd3caa0aac1fcec5", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://jwt.io/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/self-registration.html", "titulek": "Self Registration pattern", "h1": "模式: 自注册", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "模式: 自注册"}, {"uroven": 2, "text": "背景"}, {"uroven": 2, "text": "问题"}, {"uroven": 2, "text": "需求"}, {"uroven": 2, "text": "方案"}, {"uroven": 2, "text": "示例"}, {"uroven": 2, "text": "结果"}, {"uroven": 2, "text": "相关模式"}, {"uroven": 2, "text": "致谢"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# 模式: 自注册\n\n## 背景\n\n如采用[客户端服务发现模式](client-side-discovery.html)或者[服务器端服务发现模式](client-side-discovery.html),各服务实例必须在启动时注册至服务注册表,从而保证其能够被获取,并在关闭时进行注销。\n\n## 问题\n\n如何在服务注册表内注册和注销服务实例?\n\n## 需求\n\n- 各服务实例必须在启动时被注册至服务注册表,并在关闭时进行注销。\n- 崩溃的服务实例必须从服务注册表中注销。\n- ĺœ¨čżčĄŒä˝†ć— ĺŠ›ĺ¤„ç†čŻˇćą‚çš„ćœĺŠĄĺŽžäž‹ĺż…éĄťäťŽćœĺŠĄćł¨ĺ†ŒčĄ¨ä¸­ćł¨é”€ă€‚\n\n## 方案\n\n一项服务实例必须可以自动注册到服务注册表中。在启动时,该服务实例将自身(主机与IP地址)注册至服务注册表,使自身可被发现。客户端必须定期更新其注册信息,确保注册表获悉其仍处于运行状态。在关闭时,服务实例从服务注册表中自动注销。\n\n这一流程通常由[微服务基底框架](microservice-chassis.html)实现。\n\n## 示例\n\n[Netflix Eureka](https://github.com/Netflix/eureka/wiki/Understanding-eureka-client-server-communication) 即是服务注册表的一个例子。它为服务实现自动注册(注销)提供一个注册API及一套客户端库。\n\n在使用 [Apache Zookeeper](http://zookeeper.apache.org) 作为服务注册表时,每项服务对应一个特定的Zookeeper znode。在启动时,各服务实例会在该服务的znode下创建一个具有短暂存活时间的子znode。该子znode中包含该实例的位置信息。服务客户端通过检索该服务的子znode即可判断对应服务实例的可用性。如果服务实例终止但未移除对应的子znode,Zookeeper会在该子znode的存活时间超时后将其移除。\n\n## 结果\n\n自注册模式的优势在于:\n\n- ćœĺŠĄĺŽžäž‹äş†č§Łč‡ŞčşŤçŠść€ďźŒĺ› ć­¤čƒ˝ĺ¤ŸĺŽžçŽ°ćŻ”ĺŻĺŠ¨/停止更为复杂的状态模型,例如启动中、可用……\n\n但自注册模式也存在着以下弊端:\n\n- 将服务与服务注册表耦合起来。\n- 需要为编写服务时使用的每种编程语言/框架分别实现服务注册逻辑,例如Node.JS/JavaScript、Java/Scala等等。\n- äťĺœ¨čżčĄŒä˝†ć— ćł•ĺ¤„ç†čŻˇćą‚çš„ćœĺŠĄĺŽžäž‹é€šĺ¸¸ć— ćł•č‡ŞĺŠ¨ĺœ¨ćœĺŠĄćł¨ĺ†ŒčĄ¨ä¸­čż›čĄŒč‡Şćˆ‘ćł¨é”€ă€‚\n\n## 相关模式\n\n- [服务注册表](service-registry.html) - 服务发现机制中的重要部分。\n- [客户端服务发现](client-side-discovery.html) - 服务实例发现的方式之一。\n- [服务器端服务发现](server-side-discovery.html) - 服务实例发现的另一方式。\n- [微服务的基底](microservice-chassis.html) - 微服务底盘框架负责实现自注册功能。\n- [第三方注册](3rd-party-registration.html) 是备选方案。\n\n## 致谢\n\nä¸şäş†éżĺ…é‡ĺ¤çżťčŻ‘ďźŒćœŹć–‡ć šćŽä¸­ĺ›˝ć™Žĺ…ƒĺ…Źĺ¸ĺŽ‹ć˝‡ć–‡ĺ…ˆç”Ÿçš„[译文](http://blog.csdn.net/xn_sung/article/details/52336772)整理修订,在此向宋潇文先生表示感谢!\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 7979, "slov": 313, "odkazu": 66, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:07", "sha256": "8fd90a1453b0b777bd977fc8bb2a2127112c1e2672997df490886160c3439fd7", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://github.com/Netflix/eureka/wiki/Understanding-eureka-client-server-communication", "http://zookeeper.apache.org/", "http://blog.csdn.net/xn_sung/article/details/52336772", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/server-side-discovery.html", "titulek": "Server-side service discovery pattern", "h1": "模式: 服务器端服务发现", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "模式: 服务器端服务发现"}, {"uroven": 2, "text": "背景"}, {"uroven": 2, "text": "问题"}, {"uroven": 2, "text": "需求"}, {"uroven": 2, "text": "方案"}, {"uroven": 2, "text": "例子"}, {"uroven": 2, "text": "结果"}, {"uroven": 2, "text": "相关模式"}, {"uroven": 2, "text": "致谢"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# 模式: 服务器端服务发现\n\n## 背景\n\nä¸ĺŒćœĺŠĄäš‹é—´é€šĺ¸¸éœ€čŚç›¸äş’č°ƒç”¨ă€‚ĺœ¨ĺ•ä˝“ĺş”ç”¨ç¨‹ĺşĺ˝“ä¸­ďźŒćœĺŠĄé—´é€ščż‡čŻ­č¨€ĺą‚çş§çš„ć–šćł•ćˆ–č€…čż‡ç¨‹ĺŽžçŽ°ç›¸äş’č°ƒç”¨ă€‚ĺœ¨äź çťŸçš„ĺˆ†ĺ¸ƒĺźçłťçťŸéƒ¨ç˝˛ä¸‹ďźŒćœĺŠĄĺœ¨ĺ›şĺŽšĺšśä¸”ĺˇ˛çŸĽçš„ä˝ç˝Žďźˆä¸ťćœşä¸ŽçŤŻĺŁďź‰čżčĄŒďźŒäťŽč€ŒçĄŽäżĺ„ćœĺŠĄĺŻĺˆŠç”¨HTTP/REST或者某种RPC机制进行相互调用。然而,现代化[微服务应用程序](microservices.html)ä¸­é€šĺ¸¸ĺœ¨č™šć‹ŸĺŒ–ćˆ–č€…ĺŽšĺ™¨ĺŒ–çŽŻĺ˘ƒä¸­čżčĄŒďźŒĺœ¨čż™ć ˇçš„çŽŻĺ˘ƒä¸­ćœĺŠĄçš„ĺŽžäž‹ć•°é‡ĺ’Œä˝ç˝Žć˜ŻĺŠ¨ć€ĺ˜ĺŒ–çš„ă€‚\n\nĺ› ć­¤ďźŒčŚćƒłĺŽžçŽ°ĺŽ˘ćˆˇçŤŻĺ‘ĺŠ¨ć€ĺ˜ĺŒ–çš„ä¸€çť„ćœĺŠĄçŤŻĺŽžäž‹ĺ‘é€čŻˇćą‚ďźŒćˆ‘äťŹĺż…éĄťé‡‡ç”¨ć–°çš„ćœşĺˆśă€‚\n\n## 问题\n\n服务的客户端——包括API网关或者其它服务——如何才能获取服务端实例的位置?\n\n## 需求\n\n- 每一服务实例都会在特定位置(主机与端口)通过HTTP/REST或者Thrift等方式发布一个远程API。\n- 服务端实例的具体数量及位置会发生动态变化。\n- 虚拟机与容器通常会被分配动态IP地址。\n- 服务实例的数量会发生动态变化。例如,ECč‡ŞĺŠ¨äź¸çźŠçť„äźšć šćŽč´Ÿč˝˝ćƒ…ĺ†ľéšć—śč°ƒć•´ĺŽžäž‹ć•°é‡ă€‚\n\n## 方案\n\n在向某一服务发送请求时,客户端会通过在已知位置运行的路由器(或者是负载均衡器)发送请求。路由器会查询[服务注册表](service-registry.html),并向可用的服务实例转发该请求。服务注册表也可能背内建于路由器之中。\n\n以下示意图展现了这种模式的结构:\n\n## 例子\n\nAWS Elastic Load Balancer(即AWS弹性负载均衡,简称ELB)便是一个服务器端服务发现模式的例子。客户端向该ELB发出HTTPS)请求(或者开启TCP连接),而ELB则在一组EC2实例中对该流量进行负载均衡。ELB既能够对来自互联网的外部流量进行负载均衡,又能够被部署在VPC中,对内部流量进行负载均衡。ELBĺŒć ˇĺŻä˝œä¸ş[服务注册表](service-registry.html)发挥作用。EC2实例可通过API调用或者借助自动伸缩分组机制注册至ELB。\n\n一些集群解决方案如 [Kubernetes](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/services.md) 以及 [Marathon](https://mesosphere.github.io/marathon/docs/service-discovery-load-balancing.html),会在每台主机上运行一套代理,用来提供服务器端服务发现模式的路由机制。为了访问服务,客户端可以利用被分配至该服务的端口接入这个本地代理。该代理随后会将各请求转发给在集群某处运行的服务实例。\n\n## 结果\n\n服务器端发现机制拥有以下优势:\n\n- 相较于 [客户端服务发现](client-side-discovery.html) ďźŒĺ…śĺŽ˘ćˆˇçŤŻäťŁç ç”ąäşŽć— éœ€ĺŽžçŽ°ĺ‘çŽ°ĺŠŸčƒ˝č€Œć›´ä¸şçŽ€ĺ•ă€‚č€Œä¸”ĺŽ˘ćˆˇçŤŻĺŞéœ€čŚĺ‘čˇŻç”ąćœşĺˆśĺ‘é€čŻˇćą‚ĺłĺŻă€‚\n- 部分云环境提供此项功能,例如AWS Elastic Load Balancer。\n\n但服务器端发现机制亦存在着以下弊端:\n\n- 除非成为云环境的一部分,否则该路由机制必须作为另一系统组件进行安装与配置。为实现可用性和一定的接入能力,还需要为其配置一定数量的副本。\n- 相较于 [客户端服务发现](client-side-discovery.html) ,服务器端发现机制需要更多的网络跳转。\n\n## 相关模式\n\n- [服务注册表](service-registry.html)\n- [断路器](reliability/circuit-breaker.html)\n- [客户端服务发现](client-side-discovery.html)\n\n## 致谢\n\n- ä¸şäş†éżĺ…é‡ĺ¤çżťčŻ‘ďźŒćœŹć–‡ć šćŽä¸­ĺ›˝ć™Žĺ…ƒĺ…Źĺ¸ĺŽ‹ć˝‡ć–‡ĺ…ˆç”Ÿçš„ [译文](http://blog.csdn.net/xn_sung/article/details/52336752) 整理修订,在此向宋潇文先生表示感谢!\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 8679, "slov": 324, "odkazu": 65, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:09", "sha256": "ccceaad503167661e3e9f15070b44d4f6cc00a152abe43a1c7922fb882421410", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/services.md", "https://mesosphere.github.io/marathon/docs/service-discovery-load-balancing.html", "http://blog.csdn.net/xn_sung/article/details/52336752", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/service-registry.html", "titulek": "Service registry pattern", "h1": "模式: 服务注册表", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "模式: 服务注册表"}, {"uroven": 2, "text": "背景"}, {"uroven": 2, "text": "问题"}, {"uroven": 2, "text": "需求"}, {"uroven": 2, "text": "方案"}, {"uroven": 2, "text": "示例"}, {"uroven": 2, "text": "结果"}, {"uroven": 2, "text": "相关模式"}, {"uroven": 2, "text": "致谢"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# 模式: 服务注册表\n\n## 背景\n\n一项服务的客户端需要使用[客户端服务发现](client-side-discovery.html)或者[服务器端服务发现](server-side-discovery.html)机制,从而获取给其发送请求的服务实例的位置。\n\n## 问题\n\n服务的客户端(在[客户端服务发现](client-side-discovery.html)机制中)或者服务路由(在[服务器端服务发现](server-side-discovery.html)机制中)如何获取可用服务实例的信息?\n\n## 需求\n\n- 每个服务实例都会在特定位置(主机与端口)通过HTTP/REST或者Thrift等方式发布一个远程API。\n- 服务实例的数量和位置会发生动态变化。虚拟机与容器通常会被分配给一个动态IP地址。例如,AWS的EC2č‡ŞĺŠ¨äź¸çźŠçť„äźšć šćŽč´Ÿč˝˝ćƒ…ĺ†ľč°ƒć•´ĺŽžäž‹ć•°é‡ă€‚\n\n## 方案\n\n建立一套服务注册表,即一个包括服务、服务的实例和其位置信息的数据库。各服务实例需要在启动时注册至该服务注册表,并在关闭时进行注销。该服务的客户端以及/或者路由器通过查询此服务注册表以找到可用的服务实例。\n\n## 示例\n\n服务注册表的例子(或者经常作为服务注册表使用的技术)包括:\n\n- [Eureka](https://github.com/Netflix/eureka/wiki/Eureka-at-a-glance)\n- [Apache Zookeeper](http://zookeeper.apache.org)\n- [Consul](https://consul.io/)\n- [Etcd](https://github.com/coreos/etcd)\n\nKubernetes、Marathon 以及 AWS ELB 等系统中存在一套隐式的服务注册表。\n\n## 结果\n\n服务注册表模式的优势包括:\n\n- 服务的客户端及/或路由器能够获取服务实例的位置。\n\n服务注册表模式的弊端包括:\n\n- é™¤éžć­¤ćœĺŠĄćł¨ĺ†ŒčĄ¨č˘Ťĺ†…ç˝ŽäşŽĺŸşçĄ€čŽžć–˝ďźŒĺŚĺˆ™ĺ…śĺż…éĄťä˝œä¸şĺŚĺ¤–çš„ĺŸşçĄ€čŽžć–˝çť„äťśčż›čĄŒĺŽ‰čŁ…ă€é…ç˝Žä¸ŽçŽĄç†ă€‚ĺŚĺ¤–ďźŒćœĺŠĄćł¨ĺ†ŒčĄ¨äšŸć˜Żä¸€ä¸Şĺžˆĺ…łé”Žçš„çłťçťŸçť„äťśă€‚ĺ°˝çŽĄĺŽ˘ćˆˇçŤŻĺş”ĺ˝“ĺŻšćœĺŠĄćł¨ĺ†ŒčĄ¨ćäž›çš„ć•°ćŽčż›čĄŒçź“ĺ­˜ďźŒä˝†ä¸€ć—ŚčŻĽćœĺŠĄćł¨ĺ†ŒčĄ¨ĺ‘ç”Ÿć•…éšœé‚Łäšˆčż™äş›ć•°ćŽĺ°ąäźščż‡ćœŸă€‚ĺ› ć­¤ďźŒćœĺŠĄćł¨ĺ†ŒčĄ¨ĺż…éĄťćœ‰ćžéŤ˜çš„ĺŻç”¨ć€§ă€‚\n\n开发者需要决定各服务实例如何注册至该服务注册表。有两个选项:\n\n- [自注册模式](self-registration.html) - 服务实例自行完成注册。\n- [第三方注册模式](3rd-party-registration.html) - 由第三方注册工具将各服务实例注册至服务注册表。\n\n服务注册表的客户端需要获取服务注册表实例的位置。另外,各服务注册表实例也必须被部署在固定且已知的IP地址上。各客户端则利用这些IP地址进行配置。\n\n举例来说,[Netflix Eureka](https://github.com/Netflix/eureka/wiki/Configuring-Eureka-in-AWS-Cloud)ćœĺŠĄĺŽžäž‹é€šĺ¸¸äźšć šćŽĺźšć€§IP地址进行部署。其弹性IPĺœ°ĺ€ĺŻç”¨čľ„ćşćą ĺˆ™ĺˆŠç”¨ĺąžć€§ć–‡äťśćˆ–č€…é€ščż‡DNS进行配置。当一个Eureka实例开始启动时,它会查询配置,寻找可用的弹性IP地址。Eureka客户端也需要通过该弹性IPĺœ°ĺ€ćą čż›čĄŒé…ç˝Žă€‚\n\n## 相关模式\n\n- [客户端服务发现](client-side-discovery.html) 和 [服务器端服务发现](server-side-discovery.html) 催生了服务注册表这个模式。\n- [自注册](self-registration.html) 和 [第三方注册](3rd-party-registration.html) 是将服务实例注册至服务注册表的两种不同方式。\n\n## 致谢\n\nä¸şäş†éżĺ…é‡ĺ¤çżťčŻ‘ďźŒćœŹć–‡ć šćŽä¸­ĺ›˝ć™Žĺ…ƒĺ…Źĺ¸ĺŽ‹ć˝‡ć–‡ĺ…ˆç”Ÿçš„[译文](http://blog.csdn.net/xn_sung/article/details/52336759)整理修订,在此向宋潇文先生表示感谢!\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 8511, "slov": 340, "odkazu": 68, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:27", "sha256": "5ec4a8de205905ec94f2cb79f583dcf193d3457570809ed5e59f7b554c67889a", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://github.com/Netflix/eureka/wiki/Eureka-at-a-glance", "http://zookeeper.apache.org/", "https://consul.io/", "https://github.com/coreos/etcd", "https://github.com/Netflix/eureka/wiki/Configuring-Eureka-in-AWS-Cloud", "http://blog.csdn.net/xn_sung/article/details/52336759", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/testing/service-component-test.html", "titulek": "Service Component Test", "h1": "Pattern: Service Component Test", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Service Component Test"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "See also"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Service Component Test\n\n## Problem\n\nHow to simplify the testing of a service\n\n## Solution\n\nA test suite that tests a service in isolation using test doubles for any services that it invokes.\n\n- See [Service Integration Contract Test](service-integration-contract-test.html)\n\n## See also\n\n- See [Component Testing](http://martinfowler.com/articles/microservice-testing/#testing-component-introduction)\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5451, "slov": 274, "odkazu": 60, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:15", "sha256": "e26dddc5c6b0ea25fd4f27edc20067941ba372bfb5fe73355351f59aa4b74aad", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "http://martinfowler.com/articles/microservice-testing/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/testing/service-integration-contract-test.html", "titulek": "Service Integration Contract Test", "h1": "Pattern: Service Integration Contract Test", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Service Integration Contract Test"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "See also"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Service Integration Contract Test\n\n## Problem\n\nHow to verify that a service provides an API that its clients expect\n\n## Solution\n\nA test suite for a service that is written by the developers of another service that consumes it.\nThe test suite verifies that the service meets the consuming service’s expectations.\n\n- See [Service Component Test](service-component-test.html)\n\n## See also\n\n- See [Integration Contract Test](http://martinfowler.com/articles/microservice-testing/#testing-contract-introduction)\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5560, "slov": 291, "odkazu": 60, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:19", "sha256": "4493d26a72758f4e357304fa181d9f88c8028970e1a53da7b4e1c20bf0dbd7a4", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "http://martinfowler.com/articles/microservice-testing/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/ui/client-side-ui-composition.html", "titulek": "Client-side UI composition", "h1": "Pattern: Client-side UI composition", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Client-side UI composition"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Client-side UI composition\n\n## Problem\n\nHow to implement a UI screen or page that displays data from multiple services?\n\n## Solution\n\nBuild a UI on the client by composing UI fragments rendered by multiple, [business capability](../decomposition/decompose-by-business-capability.html)/[subdomain](../decomposition/decompose-by-subdomain.html)-specific UI components.\n\n- The [Server-side page fragment composition](server-side-page-fragment-composition.html) pattern is an alternative approach\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5548, "slov": 284, "odkazu": 61, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:20", "sha256": "b4ca955eb80ede378512ebe699ae940a0fca99a2b1a2029f1001e5507077c83c", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/cn/ui/server-side-page-fragment-composition.html", "titulek": "Server-side page fragment composition", "h1": "Pattern: Server-side page fragment composition", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Server-side page fragment composition"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Server-side page fragment composition\n\n## Problem\n\nHow to implement a UI screen or page that displays data from multiple services?\n\n## Solution\n\nBuild a webpage on the server by composing HTML fragments generated by multiple, [business capability](../decomposition/decompose-by-business-capability.html)/[subdomain](../decomposition/decompose-by-subdomain.html)-specific web applications.\n\n- The [Client-side UI composition](client-side-ui-composition.html) pattern is an alternative approach\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5548, "slov": 283, "odkazu": 61, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:12", "sha256": "010295240465ea0fd1e7021ca3360a7caf1e12ad40b0491c312122e2367ea279", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "http://microservices.io/patterns/communication-style/domain-specific.html", "titulek": "Pattern: Domain-specific protocol", "h1": "Pattern: Domain-specific protocol", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Domain-specific protocol", "og:url": "http://microservices.io/patterns/communication-style/domain-specific.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/communication-style/domain-specific.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Domain-specific protocol", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Domain-specific protocol"}, "url": "http://microservices.io/patterns/communication-style/domain-specific.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Domain-specific protocol"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Domain-specific protocol\n\n[pattern](/tags/pattern)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\nServices must handle requests from the application’s clients.\nFurthermore, services must sometimes collaborate to handle those requests.\nThey must use an inter-process communication protocol.\n\n## Forces\n\n## Solution\n\nUse a domain-specific protocol for inter-service communication.\n\n## Examples\n\nThere are numerous domain-specific protocols including:\n\n- Email protocols such as SMTP and IMAP\n- Media streaming protocols such as RTMP, HLS, and HDS\n\n## Resulting context\n\n- The [Messaging](messaging.html) pattern is an alternative pattern\n- The [RPI](rpi.html) pattern is an alternative pattern\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4020, "slov": 477, "odkazu": 30, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:36", "sha256": "d62d63620a6ab0b971475fd79a8ca45ffe5dc51cc03414b27add583fefd63fdd", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/communication-style/idempotent-consumer.html", "titulek": "Pattern: Idempotent Consumer", "h1": "Pattern: Idempotent Consumer", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Idempotent Consumer", "og:url": "http://microservices.io/patterns/communication-style/idempotent-consumer.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/communication-style/idempotent-consumer.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Idempotent Consumer", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Idempotent Consumer"}, "url": "http://microservices.io/patterns/communication-style/idempotent-consumer.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Idempotent Consumer"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "See also"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Idempotent Consumer\n\n[pattern](/tags/pattern)\n\n---\n\n## Context\n\nIn an enterprise application, it’s usually a good idea to use a message broker that guarantees at-least once delivery.\nAt-least once delivery guarantees that a message broker will deliver a message to a consumer even if errors occur.\nOne side-effect, however, is that the consumer can be invoked repeatedly for the same message.\n**Consequently, a consumer must be idempotent: the outcome of processing the same message repeatedly must be the same as processing the message once.**\nIf a consumer is not idempotent, multiple invocations can cause bugs.\nFor example, a consumer of an `AccountDebited` message that subtracts the debit amount from the current balance would calculate the incorrect balance.\n\n## Problem\n\nHow does a message consumer handle duplicate messages correctly?\n\n## Solution\n\nMake a consumer idempotent by having it record the IDs of processed messages in the database.\nWhen processing a message, a consumer can detect and discard duplicates by querying the database.\nThere are a couple of different places to store the message IDs.\nOne option is for the consumer to use a separate `PROCESSED_MESSAGES` table.\nThe other option is for the consumer to store the IDs in the business entities that it creates or updates.\n\nHere’s how a consumer can use the `PROCESSED_MESSAGES` table:\n\nAfter starting the database transaction, the message handler inserts the message’s ID into the `PROCESSED_MESSAGE` table.\nSince the `(subscriberId, messageID)` is the `PROCESSED_MESSAGE` table’s primary key the `INSERT` will fail if the message has been already processed successfully.\nThe message handler can then rollback the transaction and ignore the message.\n\n## See also\n\n- The [Eventuate framework](https://eventuate.io) implements this pattern.\n- This [blog post about this pattern](/post/microservices/patterns/2020/10/16/idempotent-consumer.html)\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 5184, "slov": 665, "odkazu": 28, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:48", "sha256": "f02804c7fb160f91bf78168b412d9b019d857c87168934bbdb0fc7257cf0ce7a", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://eventuate.io/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/communication-style/messaging.html", "titulek": "Pattern: Messaging", "h1": "Pattern: Messaging", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Messaging", "og:url": "http://microservices.io/patterns/communication-style/messaging.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/communication-style/messaging.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Messaging", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Messaging"}, "url": "http://microservices.io/patterns/communication-style/messaging.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Messaging"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "See also"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Messaging\n\n[pattern](/tags/pattern) [inter-service communication](/tags/inter-service communication) [service api](/tags/service api) [service design](/tags/service design)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\nServices must handle requests from the application’s clients.\nFurthermore, services often collaborate to handle those requests.\nConsequently, they must use an inter-process communication protocol.\n\n## Forces\n\n- Services often need to collaborate\n- Synchronous communicate results in tight runtime coupling, both the client and service must be available for the duration of the request\n\n## Problem\n\nHow do services in a microservice architecture communicate?\n\n## Solution\n\nUse asynchronous messaging for inter-service communication.\nServices communicating by exchanging messages over messaging channels.\n\nThere are several different styles of asynchronous communication:\n\n- Request/response - a service sends a request message to a recipient and expects to receive a reply message promptly\n- Notifications - a sender sends a message a recipient but does not expect a reply. Nor is one sent.\n- Request/asynchronous response - a service sends a request message to a recipient and expects to receive a reply message eventually\n- Publish/subscribe - a service publishes a message to zero or more recipients\n- Publish/asynchronous response - a service publishes a request to one or recipients, some of whom send back a reply\n\n## Examples\n\nThere are numerous examples of asynchronous messaging technologies\n\n- [Apache Kafka](http://kafka.apache.org)\n- [RabbitMQ](https://www.rabbitmq.com/)\n\n`OrderService` from the [FTGO Example application](https://github.com/microservices-patterns/ftgo-application) publishes an `Order Created` event when it creates an `Order`.\n\n```\npublic class OrderService { ... public Order createOrder(long consumerId, long restaurantId, List lineItems) { Restaurant restaurant = restaurantRepository.findById(restaurantId) .orElseThrow(() -> new RestaurantNotFoundException(restaurantId)); List orderLineItems = makeOrderLineItems(lineItems, restaurant); ResultWithDomainEvents orderAndEvents = Order.createOrder(consumerId, restaurant, orderLineItems); Order order = orderAndEvents.result; orderRepository.save(order); orderAggregateEventPublisher.publish(order, orderAndEvents.events); OrderDetails orderDetails = new OrderDetails(consumerId, restaurantId, orderLineItems, order.getOrderTotal()); CreateOrderSagaState data = new CreateOrderSagaState(order.getId(), orderDetails); createOrderSagaManager.create(data, Order.class, order.getId()); meterRegistry.ifPresent(mr -> mr.counter(\"placed_orders\").increment()); return order; } \n```\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- Loose runtime coupling since it decouples the message sender from the consumer\n- Improved availability since the message broker buffers messages until the consumer is able to process them\n- Supports a variety of communication patterns including request/reply, notifications, request/async response, publish/subscribe, publish/async response etc\n\nThis pattern has the following drawbacks:\n\n- Additional complexity of message broker, which must be highly available\n\nThis pattern has the following issues:\n\n- Request/reply-style communication is more complex\n\n- The [Saga pattern](/patterns/data/saga.html) and [CQRS pattern](/patterns/data/cqrs.html) use messaging\n- The [Transactional Outbox pattern](/patterns/data/transactional-outbox.html) enables messages to be sent as part of a database transaction\n- The [Externalized configuration pattern](../externalized-configuration.html) supplies the (logical) message channel names and the location of the message broker\n- The [Domain-specific protocol](domain-specific.html) pattern is an alternative pattern\n- The [RPI](rpi.html) pattern is an alternative pattern\n\n## See also\n\n- My book [Microservices patterns](/book) describes inter-communication in depth\n- [Enterprise Integration Patterns](http://www.enterpriseintegrationpatterns.com/) - a comprehensive set of message patterns\n- The [Eventuate Tram framework](http://eventuate.io/) , which implements transaction messaging for microservices\n\n---\n\n[pattern](/tags/pattern) [inter-service communication](/tags/inter-service communication) [service api](/tags/service api) [service design](/tags/service design)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 7654, "slov": 852, "odkazu": 42, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:52", "sha256": "56772e57da28676360d2ad7df4c84720e48a6f7d658d90475a6d0af0896f9f00", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "http://kafka.apache.org/", "https://www.rabbitmq.com/", "https://github.com/microservices-patterns/ftgo-application", "http://www.enterpriseintegrationpatterns.com/", "http://eventuate.io/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/communication-style/rpi.html", "titulek": "Pattern: Remote Procedure Invocation (RPI)", "h1": "Pattern: Remote Procedure Invocation (RPI)", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Remote Procedure Invocation (RPI)", "og:url": "http://microservices.io/patterns/communication-style/rpi.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/communication-style/rpi.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Remote Procedure Invocation (RPI)", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Remote Procedure Invocation (RPI)"}, "url": "http://microservices.io/patterns/communication-style/rpi.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Remote Procedure Invocation (RPI)"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Remote Procedure Invocation (RPI)\n\n[pattern](/tags/pattern) [inter-service communication](/tags/inter-service communication) [service api](/tags/service api) [service design](/tags/service design)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\nServices must handle requests from the application’s clients.\nFurthermore, services must sometimes collaborate to handle those requests.\nThey must use an inter-process communication protocol.\n\n## Forces\n\n- Services often need to collaborate\n- Synchronous communicate results in tight runtime coupling, both the client and service must be available for the duration of the request\n\n## Problem\n\nHow do services in a microservice architecture communicate?\n\n## Solution\n\nUse RPI for inter-service communication.\nThe client uses a request/reply-based protocol to make requests to a service.\n\n## Examples\n\nThere are numerous examples of RPI technologies\n\n- [REST](https://en.wikipedia.org/wiki/Representational_state_transfer)\n- [gRPC](http://www.grpc.io/)\n- [Apache Thrift](https://thrift.apache.org/)\n\n`RegistrationServiceProxy` from the [Microservices Example application](https://github.com/cer/microservices-examples) is an example of a component, which is written in Scala, that makes a REST request using the Spring Framework’s `RestTemplate`:\n\n```\n@Component class RegistrationServiceProxy @Autowired()(restTemplate: RestTemplate) extends RegistrationService { @Value(\"${user_registration_url}\") var userRegistrationUrl: String = _ @HystrixCommand(commandProperties=Array(new HystrixProperty(name=\"execution.isolation.thread.timeoutInMilliseconds\", value=\"800\"))) override def registerUser(emailAddress: String, password: String): Either[RegistrationError, String] = { try { val response = restTemplate.postForEntity(userRegistrationUrl, RegistrationBackendRequest(emailAddress, password), classOf[RegistrationBackendResponse]) response.getStatusCode match { case HttpStatus.OK => Right(response.getBody.id) } } catch { case e: HttpClientErrorException if e.getStatusCode == HttpStatus.CONFLICT => Left(DuplicateRegistrationError) } } } \n```\n\nThe value of `user_registration_url` is supplied using [Externalized configuration](../externalized-configuration.html).\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- Simple and familiar\n- Request/reply is easy\n- Simpler system since there in no intermediate broker\n\nThis pattern has the following drawbacks:\n\n- Usually only supports request/reply and not other interaction patterns such as notifications, request/async response, publish/subscribe, publish/async response\n- Reduced availability since the client and the service must be available for the duration of the interaction\n\nThis pattern has the following issues:\n\n- Client needs to discover locations of service instances\n\n- The [Domain-specific protocol](domain-specific.html) is an alternative pattern\n- The [Messaging](messaging.html) is an alternative pattern\n- [Externalized configuration](../externalized-configuration.html) supplies the (logical) network location, e.g. URL, of the service.\n- A client must use either [Client-side discovery](../client-side-discovery.html) and [Server-side discovery](../server-side-discovery.html) to locate a service instance\n- A client will typically use the [Circuit Breaker pattern](../reliability/circuit-breaker.html) to improve reliability\n\n---\n\n[pattern](/tags/pattern) [inter-service communication](/tags/inter-service communication) [service api](/tags/service api) [service design](/tags/service design)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 6786, "slov": 753, "odkazu": 41, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:03", "sha256": "7c08e77572604e35b9ec171a437e24af1f45e11e896cca2a7198623f18ec902d", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://en.wikipedia.org/wiki/Representational_state_transfer", "http://www.grpc.io/", "https://thrift.apache.org/", "https://github.com/cer/microservices-examples", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/data/aggregate.html", "titulek": "Pattern: Aggregate", "h1": "Pattern: Aggregate", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Aggregate", "og:url": "http://microservices.io/patterns/data/aggregate.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/data/aggregate.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Aggregate", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Aggregate"}, "url": "http://microservices.io/patterns/data/aggregate.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Aggregate"}, {"uroven": 2, "text": "See also"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Aggregate\n\n[pattern](/tags/pattern)\n\n---\n\nFrom Domain-Driven Design (DDD).\n\nA graph of objects that can be treated as a unit.\n\n## See also\n\n- My book [Microservices patterns](/book) describes this pattern in a lot more detail.\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 3520, "slov": 421, "odkazu": 27, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:03", "sha256": "6e6e62d4838c86e0b1b58c952bace84572f88ef004a685ffd6065cefb34138ab", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/data/api-composition.html", "titulek": "Pattern: API Composition", "h1": "Pattern: API Composition", "popis": "Invoke the services that own the data and perform an in-memory join", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: API Composition", "og:image": "http://microservices.io/i/data/ApiBasedQueryBigPicture.jpg", "og:url": "http://microservices.io/patterns/data/api-composition.html", "og:description": "Invoke the services that own the data and perform an in-memory join"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/data/api-composition.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: API Composition", "description": "A pattern language for microservices", "primaryImageOfPage": {"@type": "ImageObject", "contentUrl": "http://microservices.io/i/data/ApiBasedQueryBigPicture.jpg", "representativeOfPage": "True"}, "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: API Composition", "description": "Invoke the services that own the data and perform an in-memory join", "image": {"@type": "ImageObject", "name": "API Composition", "width": "735", "height": "428", "url": "http://microservices.io/i/data/ApiBasedQueryBigPicture.jpg"}}, "url": "http://microservices.io/patterns/data/api-composition.html"}, {"@context": "http://schema.org", "@type": "Question", "name": "How to implement queries that join data across multiple services in a microservice architecture?", "acceptedAnswer": {"@type": "Answer", "text": "Invoke the services that own the data and perform an in-memory join"}}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: API Composition"}, {"uroven": 2, "text": "Want to learn more about this pattern?"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Example"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "See also"}, {"uroven": 2, "text": "Learn more"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: API Composition\n\n[pattern](/tags/pattern) [service collaboration](/tags/service collaboration) [implementing queries](/tags/implementing queries)\n\n---\n\n## Want to learn more about this pattern?\n\nTake a look at my [self-paced, online bootcamp](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html) that teaches you how to use the Saga, API Composition, and CQRS patterns to design operations that span multiple services.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025)\n\n## Context\n\nYou have applied the [Microservices architecture pattern](../microservices.html) and the [Database per service pattern](database-per-service.html).\nAs a result, it is no longer straightforward to implement queries that join data from multiple services.\n\n## Problem\n\nHow to implement queries in a microservice architecture?\n\n## Solution\n\nImplement a query by defining an *API Composer*, which invoking the services that own the data and performs an in-memory join of the results.\n\n## Example\n\nAn [API Gateway](../apigateway.html) often does API composition.\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- It a simple way to query data in a microservice architecture\n\nThis pattern has the following drawbacks:\n\n- Some queries would result in inefficient, in-memory joins of large datasets.\n\n- The [Database per Service pattern](database-per-service.html) creates the need for this pattern\n- The [CQRS pattern](cqrs.html) is an alternative solution\n\n## See also\n\n## Learn more\n\n- My book [Microservices patterns](/book) describes this pattern in a lot more detail\n- Take a look at my [self-paced, online bootcamp](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html) that teaches you how to use the Saga, API Composition, and CQRS patterns to design operations that span multiple services.\n\n---\n\n[pattern](/tags/pattern) [service collaboration](/tags/service collaboration) [implementing queries](/tags/implementing queries)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 5259, "slov": 646, "odkazu": 33, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:05", "sha256": "a034e8d1cc53e8e5ea635876db3c2065b159aba885ff465aeb82b60af84bb94a", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/data/application-events.html", "titulek": "Redirect to renamed pattern", "h1": "", "popis": "", "klicova_slova": "renamed-pattern", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [], "markdown": "If your browser doesn't automatically go there within a few seconds,\nyou may want to go to\n [the destination](transactional-outbox.html) \nmanually.", "znaku_textu": 147, "slov": 21, "odkazu": 1, "kodovani": "utf-8", "kodovani_deklarovane": null, "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:41", "sha256": "d2e9ec3cb21eed04258ef4084138e2785e41f9c8bf3ac668dd8015a3d06803bc", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": []} {"url": "http://microservices.io/patterns/data/command-side-replica.html", "titulek": "Pattern: Command-side replica", "h1": "Pattern: Command-side replica", "popis": "Maintain a queryable replica of the data in the service that implements the command.", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Command-side replica", "og:image": "http://microservices.io/i/data/command-side-replica.jpg", "og:url": "http://microservices.io/patterns/data/command-side-replica.html", "og:description": "Maintain a queryable replica of the data in the service that implements the command."}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/data/command-side-replica.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Command-side replica", "description": "A pattern language for microservices", "primaryImageOfPage": {"@type": "ImageObject", "contentUrl": "http://microservices.io/i/data/command-side-replica.jpg", "representativeOfPage": "True"}, "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Command-side replica", "description": "Maintain a queryable replica of the data in the service that implements the command.", "image": {"@type": "ImageObject", "name": "Command-side replica", "width": "735", "height": "428", "url": "http://microservices.io/i/data/command-side-replica.jpg"}}, "url": "http://microservices.io/patterns/data/command-side-replica.html"}, {"@context": "http://schema.org", "@type": "Question", "name": "How can a service that implements a command retrieve data from another service?", "acceptedAnswer": {"@type": "Answer", "text": "Maintain a queryable replica of the data in the service that implements the command."}}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Command-side replica"}, {"uroven": 2, "text": "Want to learn more about this pattern?"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 3, "text": "Benefits"}, {"uroven": 3, "text": "Drawbacks"}, {"uroven": 2, "text": "See also"}, {"uroven": 2, "text": "Learn more"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Command-side replica\n\n[pattern](/tags/pattern) [service collaboration](/tags/service collaboration) [implementing commands](/tags/implementing commands)\n\n---\n\n## Want to learn more about this pattern?\n\nTake a look at my [self-paced, online bootcamp](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html) that teaches you how to use the Saga, API Composition, and CQRS patterns to design operations that span multiple services.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025)\n\n## Context\n\nYou have applied the [Microservices architecture pattern](../microservices.html) and the [Database per service pattern](database-per-service.html).\nAs a result, a service that implements a system command often needs to query other services.\nFor example, the `createOrder()` command is implemented by the `Order Service`, which needs to retrieve the restaurant’s menu `Restaurant Service` in order to price and validate the line items.\n\nOne option is for the `Order Service` to query the `Restaurant Service` each time.\nThe query can either be implemented synchronously using, for example, or asynchronously as a saga step.\nHowever, this approach has several drawbacks, which can be partially mitigated by caching, including more network traffic and a runtime dependency on the `Restaurant Service`.\n\nAn alternative approach is to replica the restaurants’ menus to the `Order Service`.\n\n## Problem\n\nHow can a service that implements a command retrieve data from another service?\n\nThere are five [dark energy forces](/post/microservices/2021/11/30/dark-matter-dark-energy.html):\n\n- [Simple components](/articles/dark-energy-dark-matter/dark-energy/simple-components.html) - simple components consisting of few subdomains are easier to understand and maintain than complex components\n- [Team autonomy](/articles/dark-energy-dark-matter/dark-energy/team-autonomy.html) - a team needs to be able to develop, test and deploy their software independently of other teams\n- [Fast deployment pipeline](/articles/dark-energy-dark-matter/dark-energy/fast-deployment-pipeline.html) - fast feedback and high deployment frequency are essential and are enabled by a fast deployment pipeline, which in turn requires components that are fast to build and test.\n- [Support multiple technology stacks](/articles/dark-energy-dark-matter/dark-energy/multiple-technology-stacks.html) - subdomains are sometimes implemented using a variety of technologies; and developers need to evolve the application’s technology stack, e.g. use current versions of languages and frameworks\n- [Segregate by characteristics](/articles/dark-energy-dark-matter/dark-energy/segregate-by-characteristics.html) - e.g. resource requirements to improve scalability, their availability requirements to improve availability, their security requirements to improve security, etc.\n\nThere are five [dark matter forces](/post/microservices/2021/11/30/dark-matter-dark-energy.html):\n\n- [Simple interactions](/articles/dark-energy-dark-matter/dark-matter/simple-interactions.html) - an operation that’s local to a component or consists of a few simple interactions between components is easier to understand and troubleshoot than a distributed operation, especially one consisting of complex interactions\n- [Efficient interactions](/articles/dark-energy-dark-matter/dark-matter/efficient-interactions.html) - a distributed operation that involves lots of network round trips and large data transfers can be too inefficient\n- [Prefer ACID over BASE](/articles/dark-energy-dark-matter/dark-matter/prefer-acid-over-base.html) - it’s easier to implement an operation as an ACID transaction rather than, for example, eventually consistent sagas\n- [Minimize runtime coupling](/articles/dark-energy-dark-matter/dark-matter/minimize-runtime-coupling.html) - to maximize the availability and reduce the latency of an operation\n- [Minimize design time coupling](/articles/dark-energy-dark-matter/dark-matter/minimize-design-time-coupling.html) - reduce the likelihood of changing services in lockstep, which reduces productivity\n\n## Solution\n\nThe solution consists of the following elements:\n\n- Command service - the service that implements the command.\n- Provider service - the service that owns the data that the command service needs\n- Replica database - a read-only replica of the data from the provider service.\nThe command service keeps the replica up to data by subscribing to [Domain events](domain-event.html) published by the provider service\n\n## Resulting context\n\n### Benefits\n\nThis pattern resolves the following forces:\n\n- Support multiple technology stacks - the replica database can use a technology stack that’s more optimized to support the command\n- Segregate by characteristics - the provider service is no longer invoked by the command and so might need to be as performant or available\n- Simple interactions - the command is simpler since it no longer needs to interact with the provider service\n- Efficient interactions - the command is more efficient since it no longer needs to interact with the provider service\n- Prefer ACID over BASE - the replica is potentially stale\n- Minimize runtime coupling - runtime coupling is reduced since the the command no longer needs to interact with the provider service\n\n### Drawbacks\n\nThis pattern potentially fails to resolve the following forces:\n\n- Simple components - makes the command service more complicated since it needs to maintain the replica. It also complicates the provider service since it must publish the events.\n- Team autonomy - the provider service’s team might need to coordinate more frequently with command service team due to increased design-time coupling (see below)\n- Fast deployment pipeline - the command service’s deployment pipeline might be slower since it needs test the replica\n- Segregate by characteristics - potentially increased since, for example, if the replica database contains regulated data (e.g. PII) then the command service might be more complicated.\n- Simple interactions - potentially more complicated since the provider service’s commands must publish events\n- Efficient interactions - potentially less efficient since the provider service might publish a large volume of events\n- Minimize design-time coupling - risk of tight design-time coupling between services, since the command service needs to know about the structure of the data that is replicated and potentially its lifecycle events.\n\n- The [Database per Service pattern](database-per-service.html) creates the need for this pattern\n- The [Saga](saga.html) is an alternative solution\n- The [Domain event](domain-event.html) pattern generates the events\n- This pattern is structurally identical to [CQRS](cqrs.html) .\n\n## See also\n\n- [Eventuate](http://eventuate.io) , which is a platform for developing transactional business applications.\n\n## Learn more\n\n- My book [Microservices patterns](/book) describes this pattern in a lot more detail\n- Take a look at my [self-paced, online bootcamp](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html) that teaches you how to use the Saga, API Composition, and CQRS patterns to design operations that span multiple services.\n\n---\n\n[pattern](/tags/pattern) [service collaboration](/tags/service collaboration) [implementing commands](/tags/implementing commands)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 10537, "slov": 1346, "odkazu": 46, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:21", "sha256": "8f9790de60a9f138ebaf30471d762e20a3d3973117d16ba81838251cba3ebd2d", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://eventuate.io/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/data/cqrs.html", "titulek": "Pattern: Command Query Responsibility Segregation (CQRS)", "h1": "Pattern: Command Query Responsibility Segregation (CQRS)", "popis": "Define a queryable replica that is kept up to date by subscribing to events published by the services that own the data.", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Command Query Responsibility Segregation (CQRS)", "og:image": "http://microservices.io/i/data/cqrs.jpg", "og:url": "http://microservices.io/patterns/data/cqrs.html", "og:description": "Define a queryable replica that is kept up to date by subscribing to events published by the services that own the data."}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/data/cqrs.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Command Query Responsibility Segregation (CQRS)", "description": "A pattern language for microservices", "primaryImageOfPage": {"@type": "ImageObject", "contentUrl": "http://microservices.io/i/data/cqrs.jpg", "representativeOfPage": "True"}, "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Command Query Responsibility Segregation (CQRS)", "description": "Define a queryable replica that is kept up to date by subscribing to events published by the services that own the data.", "image": {"@type": "ImageObject", "name": "Command Query Responsibility Segregation (CQRS)", "width": "735", "height": "428", "url": "http://microservices.io/i/data/cqrs.jpg"}}, "url": "http://microservices.io/patterns/data/cqrs.html"}, {"@context": "http://schema.org", "@type": "Question", "name": "How to implement queries that join data across multiple services in a microservice architecture?", "acceptedAnswer": {"@type": "Answer", "text": "Define a queryable replica that is kept up to date by subscribing to events published by the services that own the data."}}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Command Query Responsibility Segregation (CQRS)"}, {"uroven": 2, "text": "Want to learn more about this pattern?"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "See also"}, {"uroven": 2, "text": "Learn more"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Command Query Responsibility Segregation (CQRS)\n\n[pattern](/tags/pattern) [service collaboration](/tags/service collaboration) [implementing queries](/tags/implementing queries)\n\n---\n\n## Want to learn more about this pattern?\n\nTake a look at my [self-paced, online bootcamp](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html) that teaches you how to use the Saga, API Composition, and CQRS patterns to design operations that span multiple services.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025)\n\n## Context\n\nYou have applied the [Microservices architecture pattern](../microservices.html) and the [Database per service pattern](database-per-service.html).\nAs a result, it is no longer straightforward to implement queries that join data from multiple services.\nAlso, if you have applied the [Event sourcing pattern](event-sourcing.html) then the data is no longer easily queried.\n\n## Problem\n\nHow to implement a query that retrieves data from multiple services in a microservice architecture?\n\n## Solution\n\nDefine a view database, which is a read-only ‘replica’ that is designed specifically to support that query, or a group related queries.\nThe application keeps the database up to date by subscribing to [Domain events](domain-event.html) published by the service that own the data.\nThe type of database and its schema are optimized for the query or queries.\nIt’s often a NoSQL database, such as a document database or a key-value store.\n\n## Examples\n\n- My book’s FTGO example application has the [`Order History Service`](https://github.com/microservices-patterns/ftgo-application#chapter-7-implementing-queries-in-a-microservice-architecture), which implements this pattern.\n- There are [several Eventuate-based example applications](http://eventuate.io/exampleapps.html) that illustrate how to use this pattern.\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- Supports multiple denormalized views that are scalable and performant\n- Improved separation of concerns = simpler command and query models\n- Necessary in an event sourced architecture\n\nThis pattern has the following drawbacks:\n\n- Increased complexity\n- Potential code duplication\n- Replication lag/eventually consistent views\n\n- The [Database per Service pattern](database-per-service.html) creates the need for this pattern\n- The [API Composition pattern](api-composition.html) is an alternative solution\n- The [Domain event](domain-event.html) pattern generates the events\n- CQRS is often used with [Event sourcing](event-sourcing.html)\n\n## See also\n\n- [Eventuate](http://eventuate.io) , which is a platform for developing transactional business applications.\n\n## Learn more\n\n- My book [Microservices patterns](/book) describes this pattern in a lot more detail\n- Take a look at my [self-paced, online bootcamp](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html) that teaches you how to use the Saga, API Composition, and CQRS patterns to design operations that span multiple services.\n\n---\n\n[pattern](/tags/pattern) [service collaboration](/tags/service collaboration) [implementing queries](/tags/implementing queries)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 6442, "slov": 795, "odkazu": 36, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:23", "sha256": "4d0a288566879405ca9c27abeef8c31a0736d90df8d4eb8db5a038c933f4e117", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "https://github.com/microservices-patterns/ftgo-application", "http://eventuate.io/exampleapps.html", "http://eventuate.io/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/data/database-per-service.html", "titulek": "Pattern: Database per service", "h1": "Pattern: Database per service", "popis": "A service's database is private to that service", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Database per service", "og:image": "http://microservices.io/i/databaseperservice.png", "og:url": "http://microservices.io/patterns/data/database-per-service.html", "og:description": "A service's database is private to that service"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/data/database-per-service.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Database per service", "description": "A pattern language for microservices", "primaryImageOfPage": {"@type": "ImageObject", "contentUrl": "http://microservices.io/i/databaseperservice.png", "representativeOfPage": "True"}, "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Database per service", "description": "A service's database is private to that service", "image": {"@type": "ImageObject", "name": "Database per service", "width": "735", "height": "428", "url": "http://microservices.io/i/databaseperservice.png"}}, "url": "http://microservices.io/patterns/data/database-per-service.html"}, {"@context": "http://schema.org", "@type": "Question", "name": "What’s the database architecture in a microservices application?", "acceptedAnswer": {"@type": "Answer", "text": "A service's database is private to that service"}}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Database per service"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Example"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Database per service\n\n[pattern](/tags/pattern) [application architecture](/tags/application architecture) [loose coupling](/tags/loose coupling)\n\n---\n\n## Context\n\nLet’s imagine you are developing an online store application using the [Microservice architecture pattern](/patterns/microservices.html).\nMost services need to persist data in some kind of database.\nFor example, the `Order Service` stores information about orders and the `Customer Service` stores information about customers.\n\n## Problem\n\nWhat’s the database architecture in a microservices application?\n\n## Forces\n\n- Services must be loosely coupled so that they can be developed, deployed and scaled independently\n- Some business transactions must enforce invariants that span multiple services.\nFor example, the `Place Order` use case must verify that a new Order will not exceed the customer’s credit limit.\nOther business transactions, must update data owned by multiple services.\n- Some business transactions need to query data that is owned by multiple services.\nFor example, the `View Available Credit` use must query the Customer to find the `creditLimit` and Orders to calculate the total amount of the open orders.\n- Some queries must join data that is owned by multiple services.\nFor example, finding customers in a particular region and their recent orders requires a join between customers and orders.\n- Databases must sometimes be replicated and sharded in order to scale. See the [Scale Cube](/articles/scalecube.html).\n- Different services have different data storage requirements.\nFor some services, a relational database is the best choice.\nOther services might need a NoSQL database such as MongoDB, which is good at storing complex, unstructured data, or Neo4J, which is designed to efficiently store and query graph data.\n\n## Solution\n\nKeep each microservice’s persistent data private to that service and accessible only via its API.\nA service’s transactions only involve its database.\n\nThe following diagram shows the structure of this pattern.\n\nThe service’s database is effectively part of the implementation of that service.\nIt cannot be accessed directly by other services.\n\nThere are a few different ways to keep a service’s persistent data private.\nYou do not need to provision a database server for each service.\nFor example, if you are using a relational database then the options are:\n\n- Private-tables-per-service – each service owns a set of tables that must only be accessed by that service\n- Schema-per-service – each service has a database schema that’s private to that service\n- Database-server-per-service – each service has it’s own database server.\n\nPrivate-tables-per-service and schema-per-service have the lowest overhead.\nUsing a schema per service is appealing since it makes ownership clearer.\nSome high throughput services might need their own database server.\n\nIt is a good idea to create barriers that enforce this modularity.\nYou could, for example, assign a different database user id to each service and use a database access control mechanism such as grants.\nWithout some kind of barrier to enforce encapsulation, developers will always be tempted to bypass a service’s API and access it’s data directly.\n\n## Example\n\nThe [FTGO application](/post/microservices/patterns/data/2019/07/15/ftgo-database-per-service.html) is an example of an application that uses this approach.\nEach service has database credentials that only grant it access its own (logical) database on a shared MySQL server.\nFor more information, see this [blog post](/post/microservices/patterns/data/2019/07/15/ftgo-database-per-service.html).\n\n## Resulting context\n\nUsing a database per service has the following benefits:\n\n- Helps ensure that the services are loosely coupled.\nChanges to one service’s database does not impact any other services.\n- Each service can use the type of database that is best suited to its needs.\nFor example, a service that does text searches could use ElasticSearch.\nA service that manipulates a social graph could use Neo4j.\n\nUsing a database per service has the following drawbacks:\n\n- Implementing business transactions that span multiple services is not straightforward.\nDistributed transactions are best avoided because of the CAP theorem.\nMoreover, many modern (NoSQL) databases don’t support them.\n- Implementing queries that join data that is now in multiple databases is challenging.\n- Complexity of managing multiple SQL and NoSQL databases\n\nThere are various patterns/solutions for implementing transactions and queries that span services:\n\n- Implementing transactions that span services - use the [Saga pattern](saga.html).\n- Implementing queries that span services:\n - [API Composition](api-composition.html) - the application performs the join rather than the database.\n For example, a service (or the API gateway) could retrieve a customer and their orders by first retrieving the customer from the customer service and then querying the order service to return the customer’s most recent orders.\n - [Command Query Responsibility Segregation (CQRS)](cqrs.html) - maintain one or more materialized views that contain data from multiple services.\n The views are kept by services that subscribe to events that each services publishes when it updates its data.\n For example, the online store could implement a query that finds customers in a particular region and their recent orders by maintaining a view that joins customers and orders.\n The view is updated by a service that subscribes to customer and order events.\n\n- [Microservice architecture pattern](/patterns/microservices.html) creates the need for this pattern\n- [Saga pattern](/patterns/data/saga.html) is a useful way to implement eventually consistent transactions\n- The [API Composition](api-composition.html) and [Command Query Responsibility Segregation (CQRS)](cqrs.html) pattern are useful ways to implement queries\n- The [Shared Database anti-pattern](shared-database.html) describes the problems that result from microservices sharing a database\n\n---\n\n[pattern](/tags/pattern) [application architecture](/tags/application architecture) [loose coupling](/tags/loose coupling)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 9369, "slov": 1250, "odkazu": 37, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:25", "sha256": "4dbca44ffab823749d6f06484e10ddfba1790a5470655c55cae7383de2196ae0", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/data/database-triggers.html", "titulek": "Pattern: Publish events using database triggers", "h1": "Pattern: Publish events using database triggers", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Publish events using database triggers", "og:url": "http://microservices.io/patterns/data/database-triggers.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/data/database-triggers.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Publish events using database triggers", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Publish events using database triggers"}, "url": "http://microservices.io/patterns/data/database-triggers.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Publish events using database triggers"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Publish events using database triggers\n\n[pattern](/tags/pattern)\n\n---\n\n## Context\n\nA service command typically needs to create/update/delete [aggregates](aggregate.html) in the database **and** send messages/events to a message broker.\nFor example, a service that participates in a [saga](/patterns/data/saga.html) needs to update business entities and send messages/events.\nSimilarly, a service that publishes a [domain event](domain-event.html) must update an [aggregate](aggregate.html) and publish an event.\n\nThe command must atomically update the database and send messages in order to avoid data inconsistencies and bugs.\nHowever, it is not viable to use a traditional distributed transaction (2PC) that spans the database and the message broker\nThe database and/or the message broker might not support 2PC.\nAnd even if they do, it’s often undesirable to couple the service to both the database and the message broker.\n\nBut without using 2PC, sending a message in the middle of a transaction is not reliable.\nThere’s no guarantee that the transaction will commit.\nSimilarly, if a service sends a message after committing the transaction there’s no guarantee that it won’t crash before sending the message.\n\nIn addition, messages must be sent to the message broker in the order they were sent by the service.\nThey must usually be delivered to each consumer in the same order although that’s outside the scope of this pattern.\nFor example, let’s suppose that an aggregate is updated by a series of transactions `T1`, `T2`, etc.\nThis transactions might be performed by the same service instance or by different service instances.\nEach transaction publishes a corresponding event: `T1 -> E1`, `T2 -> E2`, etc.\nSince `T1` precedes `T2`, event `E1` must be published before `E2`.\n\n## Problem\n\nHow to atomically update the database and send messages to a message broker?\n\n## Forces\n\n- 2PC is not an option. The database and/or the message broker might not support 2PC. Also, it’s often undesirable to couple the service to both the database and the message broker.\n- If the database transaction commits then the messages must be sent. Conversely, if the database rolls back, the messages must not be sent\n- Messages must be sent to the message broker in the order they were sent by the service. This ordering must be preserved across multiple service instances that update the same aggregate.\n\n## Solution\n\nOne or more database triggers insert events into an `EVENTS` table, which is polled by a separate process that publishes the events.\n\n- The [Saga pattern](/patterns/data/saga.html) creates the need for this pattern.\n- The [Event sourcing](event-sourcing.html) is an alternative pattern\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 5945, "slov": 801, "odkazu": 31, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:27", "sha256": "650fba360e5e069e4a1caca07631aa899f9cb14646e4db701f4c13e69c63f8d4", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/data/domain-event.html", "titulek": "Pattern: Domain event", "h1": "Pattern: Domain event", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Domain event", "og:url": "http://microservices.io/patterns/data/domain-event.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/data/domain-event.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Domain event", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Domain event"}, "url": "http://microservices.io/patterns/data/domain-event.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Domain event"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "See also"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Domain event\n\n[pattern](/tags/pattern)\n\n---\n\nFrom Domain-Driven Design (DDD).\n\n## Context\n\nA service often needs to publish events when it updates its data.\nThese events might be needed, for example, to update a [CQRS view](cqrs.html).\nAlternatively, the service might participate in an choreography-based [saga](saga.html), which uses events for coordination.\n\n## Problem\n\nHow does a service publish an event when it updates its data?\n\n## Solution\n\nOrganize the business logic of a service as a collection of DDD [aggregates](aggregate.html) that emit domain events when they created or updated.\nThe service publishes these domain events so that they can be consumed by other services.\n\n- The [Saga](saga.html) and [CQRS](cqrs.html) patterns create the need for this pattern\n- The [Aggregate pattern](aggregate.html) is used to structure the business logic\n- The [Transactional outbox pattern](transactional-outbox.html) is used to publish events as part of a database transaction\n- [Event sourcing](event-sourcing.html) is sometimes used to publish domain events\n\n## See also\n\n- My book [Microservices patterns](/book) describes this pattern in a lot more detail.\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4443, "slov": 549, "odkazu": 32, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:35", "sha256": "5d1ab47b053255188b26c6e96b0e758ca26a1ecb9e53982f5a8461ae1fc2bfaf", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/data/event-driven-architecture.html", "titulek": "Pattern: Event-driven architecture", "h1": "Pattern: Event-driven architecture", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Event-driven architecture", "og:url": "http://microservices.io/patterns/data/event-driven-architecture.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/data/event-driven-architecture.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Event-driven architecture", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Event-driven architecture"}, "url": "http://microservices.io/patterns/data/event-driven-architecture.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Event-driven architecture"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Example"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "See also"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Event-driven architecture\n\n[pattern](/tags/pattern)\n\n---\n\n## Context\n\nYou have applied the [Database per Service](database-per-service.html) pattern.\nEach service has its own database.\nSome business transactions, however, span multiple service so you need a mechanism to ensure data consistency across services.\nFor example, lets imagine that you are building an e-commerce store where customers have a credit limit.\nThe application must ensure that a new order will not exceed the customer’s credit limit.\nSince Orders and Customers are in different databases the application cannot simply use a local ACID transaction.\n\n## Problem\n\nHow to maintain data consistency across services?\n\n## Forces\n\n- 2PC is not an option\n\n## Solution\n\nUse an event-driven, eventually consistent approach.\nEach service publishes an event whenever it update its data.\nOther service subscribe to events.\nWhen an event is received, a service updates its data.\n\n## Example\n\nAn e-commerce application that uses this approach would work as follows:\n\n1. The `Order Service` creates an Order in a *pending* state and publishes an `OrderCreated` event.\n2. The `Customer Service` receives the event and attempts to reserve credit for that Order. It then publishes either a `Credit Reserved` event or a `CreditLimitExceeded` event.\n3. The `Order Service` receives the event from the `Customer Service` and changes the state of the order to either *approved* or *cancelled*\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- It enables an application to maintain data consistency across multiple services without using distributed transactions\n\nThis solution has the following drawbacks:\n\n- The programming model is more complex\n\nThere are also the following issues to address:\n\n- In order to be reliable, an application must atomically update its database and publish an event.\nIt cannot use the traditional mechanism of a distributed transaction that spans the database and the message broker.\nInstead, it must use one the patterns listed below.\n\n- The [Database per Service pattern](database-per-service.html) creates the need for this pattern\n- The following patterns are ways to *atomically* update state *and* publish events:\n - [Event sourcing](event-sourcing.html)\n - [Transactional Outbox](transactional-outbox.html)\n - [Database triggers](database-triggers.html)\n - [Transaction log tailing](transaction-log-tailing.html)\n\n## See also\n\nThe article [Event-Driven Data Management for Microservices](https://www.nginx.com/blog/event-driven-data-management-microservices/) by @crichardson describes this pattern\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 5830, "slov": 748, "odkazu": 33, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:38", "sha256": "232a16d31dbbdf809c6727c8670c99a1cc336c40829ba84921960d1107aaa16b", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.nginx.com/blog/event-driven-data-management-microservices/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/data/event-sourcing.html", "titulek": "Pattern: Event sourcing", "h1": "Pattern: Event sourcing", "popis": "Use event sourcing, which persists aggregates as a sequence of domain events", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Event sourcing", "og:image": "http://microservices.io/i/data/storingevents.png", "og:url": "http://microservices.io/patterns/data/event-sourcing.html", "og:description": "Use event sourcing, which persists aggregates as a sequence of domain events"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/data/event-sourcing.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Event sourcing", "description": "A pattern language for microservices", "primaryImageOfPage": {"@type": "ImageObject", "contentUrl": "http://microservices.io/i/data/storingevents.png", "representativeOfPage": "True"}, "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Event sourcing", "description": "Use event sourcing, which persists aggregates as a sequence of domain events", "image": {"@type": "ImageObject", "name": "Event sourcing", "width": "735", "height": "428", "url": "http://microservices.io/i/data/storingevents.png"}}, "url": "http://microservices.io/patterns/data/event-sourcing.html"}, {"@context": "http://schema.org", "@type": "Question", "name": "How to reliably publish events when data changes?", "acceptedAnswer": {"@type": "Answer", "text": "Use event sourcing, which persists aggregates as a sequence of domain events"}}], "drobecky": [], "osnova": [{"uroven": 1, "text": "Pattern: Event sourcing"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Example"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "See also"}], "markdown": "# Pattern: Event sourcing\n\n[pattern](/tags/pattern)\n\n---\n\n## Context\n\nA service command typically needs to create/update/delete [aggregates](aggregate.html) in the database **and** send messages/events to a message broker.\nFor example, a service that participates in a [saga](/patterns/data/saga.html) needs to update business entities and send messages/events.\nSimilarly, a service that publishes a [domain event](domain-event.html) must update an [aggregate](aggregate.html) and publish an event.\n\nThe command must atomically update the database and send messages in order to avoid data inconsistencies and bugs.\nHowever, it is not viable to use a traditional distributed transaction (2PC) that spans the database and the message broker\nThe database and/or the message broker might not support 2PC.\nAnd even if they do, it’s often undesirable to couple the service to both the database and the message broker.\n\nBut without using 2PC, sending a message in the middle of a transaction is not reliable.\nThere’s no guarantee that the transaction will commit.\nSimilarly, if a service sends a message after committing the transaction there’s no guarantee that it won’t crash before sending the message.\n\nIn addition, messages must be sent to the message broker in the order they were sent by the service.\nThey must usually be delivered to each consumer in the same order although that’s outside the scope of this pattern.\nFor example, let’s suppose that an aggregate is updated by a series of transactions `T1`, `T2`, etc.\nThis transactions might be performed by the same service instance or by different service instances.\nEach transaction publishes a corresponding event: `T1 -> E1`, `T2 -> E2`, etc.\nSince `T1` precedes `T2`, event `E1` must be published before `E2`.\n\n## Problem\n\nHow to atomically update the database and send messages to a message broker?\n\n## Forces\n\n- 2PC is not an option. The database and/or the message broker might not support 2PC. Also, it’s often undesirable to couple the service to both the database and the message broker.\n- If the database transaction commits then the messages must be sent. Conversely, if the database rolls back, the messages must not be sent\n- Messages must be sent to the message broker in the order they were sent by the service. This ordering must be preserved across multiple service instances that update the same aggregate.\n\n## Solution\n\nA good solution to this problem is to use event sourcing.\nEvent sourcing persists the state of a business entity such an Order or a Customer as a sequence of state-changing events.\nWhenever the state of a business entity changes, a new event is appended to the list of events.\nSince saving an event is a single operation, it is inherently atomic.\nThe application reconstructs an entity’s current state by replaying the events.\n\nApplications persist events in an event store, which is a database of events.\nThe store has an API for adding and retrieving an entity’s events.\nThe event store also behaves like a message broker.\nIt provides an API that enables services to subscribe to events.\nWhen a service saves an event in the event store, it is delivered to all interested subscribers.\n\nSome entities, such as a Customer, can have a large number of events.\nIn order to optimize loading, an application can periodically save a snapshot of an entity’s current state.\nTo reconstruct the current state, the application finds the most recent snapshot and the events that have occurred since that snapshot.\nAs a result, there are fewer events to replay.\n\n## Example\n\n[Customers and Orders](https://github.com/eventuate-examples/eventuate-examples-java-customers-and-orders) is an example of an application that is built using Event Sourcing and [CQRS](cqrs.html).\nThe application is written in Java, and uses Spring Boot.\nIt is built using [Eventuate](http://eventuate.io), which is an application platform based on event sourcing and CQRS.\n\nThe following diagram shows how it persist orders.\n\nInstead of simply storing the current state of each order as a row in an `ORDERS` table, the application persists each `Order` as a sequence of events.\nThe `CustomerService` can subscribe to the order events and update its own state.\n\nHere is the `Order` aggregate:\n\n```\npublic class Order extends ReflectiveMutableCommandProcessingAggregate { private OrderState state; private String customerId; public OrderState getState() { return state; } public List process(CreateOrderCommand cmd) { return EventUtil.events(new OrderCreatedEvent(cmd.getCustomerId(), cmd.getOrderTotal())); } public List process(ApproveOrderCommand cmd) { return EventUtil.events(new OrderApprovedEvent(customerId)); } public List process(RejectOrderCommand cmd) { return EventUtil.events(new OrderRejectedEvent(customerId)); } public void apply(OrderCreatedEvent event) { this.state = OrderState.CREATED; this.customerId = event.getCustomerId(); } public void apply(OrderApprovedEvent event) { this.state = OrderState.APPROVED; } public void apply(OrderRejectedEvent event) { this.state = OrderState.REJECTED; } \n```\n\nHere is an example of an event handler in the `CustomerService` that subscribes to `Order` events:\n\n```\n@EventSubscriber(id = \"customerWorkflow\") public class CustomerWorkflow { @EventHandlerMethod public CompletableFuture> reserveCredit( EventHandlerContext ctx) { OrderCreatedEvent event = ctx.getEvent(); Money orderTotal = event.getOrderTotal(); String customerId = event.getCustomerId(); String orderId = ctx.getEntityId(); return ctx.update(Customer.class, customerId, new ReserveCreditCommand(orderTotal, orderId)); } } \n```\n\nIt processes an `OrderCreated` event by attempting to reserve credit for the orders customer.\n\nThere are [several example applications](http://eventuate.io/exampleapps.html) that illustrate how to use event sourcing.\n\n## Resulting context\n\nEvent sourcing has several benefits:\n\n- It solves one of the key problems in implementing an event-driven architecture and makes it possible to reliably publish events whenever state changes.\n- Because it persists events rather than domain objects, it mostly avoids the object‑relational impedance mismatch problem.\n- It provides a 100% reliable [audit log](../observability/audit-logging) of the changes made to a business entity\n- It makes it possible to implement temporal queries that determine the state of an entity at any point in time.\n- Event sourcing-based business logic consists of loosely coupled business entities that exchange events. This makes it a lot easier to migrate from a monolithic application to a microservice architecture.\n\nEvent sourcing also has several drawbacks:\n\n- It is a different and unfamiliar style of programming and so there is a learning curve.\n- The event store is difficult to query since it requires typical queries to reconstruct the state of the business entities. That is likely to be complex and inefficient.\nAs a result, the application must use [Command Query Responsibility Segregation (CQRS)](cqrs.html) to implement queries.\nThis in turn means that applications must handle eventually consistent data.\n\n- The [Saga](saga.html) and [Domain event](domain-event.html) patterns create the need for this pattern.\n- The [CQRS](cqrs.html) must often be used with event sourcing.\n- Event sourcing implements the [Audit logging](../observability/audit-logging) pattern.\n\n## See also\n\n- [Eventuate](http://eventuate.io) , which is a platform for developing applications with Event Sourcing and CQRS\n- [Articles about event sourcing and CQRS](http://eventuate.io/articles.html)\n- [How Eventuate implements snapshots](https://blog.eventuate.io/2017/03/07/eventuate-local-now-supports-snapshots/)", "znaku_textu": 7660, "slov": 1077, "odkazu": 37, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:40", "sha256": "f8928b7478fd7107c7fc9eac223780632f7232e5271797247bf8e0c4bd4a73ad", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://github.com/eventuate-examples/eventuate-examples-java-customers-and-orders", "http://eventuate.io/", "http://eventuate.io/exampleapps.html", "http://eventuate.io/articles.html", "https://blog.eventuate.io/2017/03/07/eventuate-local-now-supports-snapshots/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/data/polling-publisher.html", "titulek": "Pattern: Polling publisher", "h1": "Pattern: Polling publisher", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Polling publisher", "og:url": "http://microservices.io/patterns/data/polling-publisher.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/data/polling-publisher.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Polling publisher", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Polling publisher"}, "url": "http://microservices.io/patterns/data/polling-publisher.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Polling publisher"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "Learn more"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Polling publisher\n\n[pattern](/tags/pattern) [transactional messaging](/tags/transactional messaging) [inter-service communication](/tags/inter-service communication)\n\n---\n\n## Context\n\nYou have applied the [Transactional Outbox](transactional-outbox.html) pattern.\n\n## Problem\n\nHow to publish messages/events into the *outbox* in the database to the message broker?\n\n## Forces\n\n## Solution\n\nPublish messages by polling the database’s outbox table.\n\n## Examples\n\n- [Eventuate Tram framework](https://github.com/eventuate-tram/eventuate-tram-core) implements polling.\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- Works with any SQL database\n\nThis pattern has the following drawbacks:\n\n- Tricky to publish events in order\n- Not all NoSQL databases support this pattern\n\n- The [Transactional Outbox](transactional-outbox.html) pattern creates the need for this pattern.\n- The [Transaction log tailing](transaction-log-tailing.html) pattern is an alternative solution\n\n## Learn more\n\n- My book [Microservices patterns](/book) describes this pattern in a lot more detail.\n- The [Eventuate Tram framework](https://github.com/eventuate-tram/eventuate-tram-core) implements this pattern\n\n---\n\n[pattern](/tags/pattern) [transactional messaging](/tags/transactional messaging) [inter-service communication](/tags/inter-service communication)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4580, "slov": 529, "odkazu": 32, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:02", "sha256": "f675fb926272f419b676185d9bec6b25259ddbc92dc3de36d4168f408ebf159d", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://github.com/eventuate-tram/eventuate-tram-core", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/data/saga.html", "titulek": "Pattern: Saga", "h1": "Pattern: Saga", "popis": "Implement transactions using a saga, which is sequence of local transactions", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Saga", "og:image": "http://microservices.io/i/data/saga.jpg", "og:url": "http://microservices.io/patterns/data/saga.html", "og:description": "Implement transactions using a saga, which is sequence of local transactions"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/data/saga.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Saga", "description": "A pattern language for microservices", "primaryImageOfPage": {"@type": "ImageObject", "contentUrl": "http://microservices.io/i/data/saga.jpg", "representativeOfPage": "True"}, "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Saga", "description": "Implement transactions using a saga, which is sequence of local transactions", "image": {"@type": "ImageObject", "name": "Saga", "width": "735", "height": "428", "url": "http://microservices.io/i/data/saga.jpg"}}, "url": "http://microservices.io/patterns/data/saga.html"}, {"@context": "http://schema.org", "@type": "Question", "name": "How to implement transactions that span services in a microservice architecture?", "acceptedAnswer": {"@type": "Answer", "text": "Implement transactions using a saga, which is sequence of local transactions"}}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Saga"}, {"uroven": 2, "text": "Want to learn more about this pattern?"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Example: Choreography-based saga"}, {"uroven": 2, "text": "Example: Orchestration-based saga"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "Learn more"}, {"uroven": 2, "text": "Example code"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Saga\n\n[pattern](/tags/pattern) [transaction management](/tags/transaction management) [sagas](/tags/sagas) [service collaboration](/tags/service collaboration) [implementing commands](/tags/implementing commands)\n\n---\n\n## Want to learn more about this pattern?\n\nTake a look at my [self-paced, online bootcamp](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html) that teaches you how to use the Saga, API Composition, and CQRS patterns to design operations that span multiple services.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025)\n\n## Context\n\nYou have applied the [Database per Service](database-per-service.html) pattern.\nEach service has its own database.\nSome business transactions, however, span multiple service so you need a mechanism to implement transactions that span services.\nFor example, let’s imagine that you are building an e-commerce store where customers have a credit limit.\nThe application must ensure that a new order will not exceed the customer’s credit limit.\nSince Orders and Customers are in different databases owned by different services the application cannot simply use a local ACID transaction.\n\n## Problem\n\nHow to implement transactions that span services?\n\n## Forces\n\n- 2PC is not an option\n\n## Solution\n\nImplement each business transaction that spans multiple services as a saga.\nA saga is a sequence of local transactions.\nEach local transaction updates the database and publishes a message or event to trigger the next local transaction in the saga.\nIf a local transaction fails because it violates a business rule then the saga executes a series of compensating transactions that undo the changes that were made by the preceding local transactions.\n\nThere are two ways of coordination sagas:\n\n- Choreography - each local transaction publishes domain events that trigger local transactions in other services\n- Orchestration - an orchestrator (object) tells the participants what local transactions to execute\n\n## Example: Choreography-based saga\n\nAn e-commerce application that uses this approach would create an order using a choreography-based saga that consists of the following steps:\n\n1. The `Order Service` receives the `POST /orders` request and creates an `Order` in a `PENDING` state\n2. It then emits an `Order Created` event\n3. The `Customer Service` ’s event handler attempts to reserve credit\n4. It then emits an event indicating the outcome\n5. The `OrderService` ’s event handler either approves or rejects the `Order`\n\n[Take a tour of an example saga](/post/architecture/2024/03/20/tour-of-two-sagas.html)\n\n## Example: Orchestration-based saga\n\nAn e-commerce application that uses this approach would create an order using an orchestration-based saga that consists of the following steps:\n\n1. The `Order Service` receives the `POST /orders` request and creates the `Create Order` saga orchestrator\n2. The saga orchestrator creates an `Order` in the `PENDING` state\n3. It then sends a `Reserve Credit` command to the `Customer Service`\n4. The `Customer Service` attempts to reserve credit\n5. It then sends back a reply message indicating the outcome\n6. The saga orchestrator either approves or rejects the `Order`\n\n[Take a tour of an example saga](/post/architecture/2024/03/20/tour-of-two-sagas.html)\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- It enables an application to maintain data consistency across multiple services without using distributed transactions\n\nThis solution has the following drawbacks:\n\n- Lack of automatic rollback - a developer must design compensating transactions that explicitly undo changes made earlier in a saga rather than relying on the automatic rollback feature of ACID transactions\n- Lack of isolation (the “I” in ACID) - the lack of isolation means that there’s risk that the concurrent execution of multiple sagas and transactions can use data anomalies. consequently, a saga developer must typical use countermeasures, which are design techniques that implement isolation. Moreover, careful analysis is needed to select and correctly implement the countermeasures. See [Chapter 4/section 4.3 of my book Microservices Patterns](https://livebook.manning.com/book/microservices-patterns/chapter-4/143) for more information.\n\nThere are also the following issues to address:\n\n- In order to be reliable, a service must atomically update its database *and* publish a message/event.\nIt cannot use the traditional mechanism of a distributed transaction that spans the database and the message broker.\nInstead, it must use one of the patterns listed below.\n- A client that initiates the saga, which an asynchronous flow, using a synchronous request (e.g. HTTP `POST /orders`) needs to be able to determine its outcome.\nThere are several options, each with different trade-offs:\n - The service sends back a response once the saga completes, e.g. once it receives an `OrderApproved` or `OrderRejected` event.\n - The service sends back a response (e.g. containing the `orderID` ) after initiating the saga and the client periodically polls (e.g. `GET /orders/{orderID}` ) to determine the outcome\n - The service sends back a response (e.g. containing the `orderID` ) after initiating the saga, and then sends an event (e.g. websocket, web hook, etc) to the client once the saga completes.\n\n- The [Database per Service pattern](database-per-service.html) creates the need for this pattern\n- The following patterns are ways to *atomically* update state *and* publish messages/events:\n - [Event sourcing](event-sourcing.html)\n - [Transactional Outbox](transactional-outbox.html)\n- A choreography-based saga can publish events using [Aggregates](aggregate.html) and [Domain Events](domain-event.html)\n- The [Command-side replica](command-side-replica.html) is an alternative pattern, which can replace saga step that query data\n\n## Learn more\n\n- My book [Microservices patterns](/book) describes this pattern in a lot more detail. The book’s [example application](https://github.com/microservice-patterns/ftgo-application) implements orchestration-based sagas using the [Eventuate Tram Sagas framework](https://github.com/eventuate-tram/eventuate-tram-sagas)\n- Take a look at my [self-paced, online bootcamp](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html) that teaches you how to use the Saga, API Composition, and CQRS patterns to design operations that span multiple services.\n- Read these [articles](/tags/sagas.html) about the Saga pattern\n- My [presentations](/presentations) on sagas and asynchronous microservices.\n\n## Example code\n\nThe following examples implement the customers and orders example in different ways:\n\n- [Choreography-based saga](https://github.com/eventuate-tram/eventuate-tram-examples-customers-and-orders) where the services publish domain events using the [Eventuate Tram framework](https://github.com/eventuate-tram/eventuate-tram-core)\n- [Orchestration-based saga](https://github.com/eventuate-tram/eventuate-tram-sagas-examples-customers-and-orders) where the `Order Service` uses a saga orchestrator implemented using the [Eventuate Tram Sagas framework](https://github.com/eventuate-tram/eventuate-tram-sagas)\n- [Choreography and event sourcing-based saga](https://github.com/eventuate-examples/eventuate-examples-java-customers-and-orders) where the services publish domain events using the [Eventuate event sourcing framework](http://eventuate.io/)\n\n---\n\n[pattern](/tags/pattern) [transaction management](/tags/transaction management) [sagas](/tags/sagas) [service collaboration](/tags/service collaboration) [implementing commands](/tags/implementing commands)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 10840, "slov": 1404, "odkazu": 48, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:05", "sha256": "b40bacd786c8e6ec76600ef1ad42d4e4176d1aa9f879e5b53c99347db22124a7", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "https://livebook.manning.com/book/microservices-patterns/chapter-4/143", "https://github.com/microservice-patterns/ftgo-application", "https://github.com/eventuate-tram/eventuate-tram-sagas", "https://github.com/eventuate-tram/eventuate-tram-examples-customers-and-orders", "https://github.com/eventuate-tram/eventuate-tram-core", "https://github.com/eventuate-tram/eventuate-tram-sagas-examples-customers-and-orders", "https://github.com/eventuate-examples/eventuate-examples-java-customers-and-orders", "http://eventuate.io/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/data/shared-database.html", "titulek": "Pattern: Shared database", "h1": "Pattern: Shared database", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Shared database", "og:url": "http://microservices.io/patterns/data/shared-database.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/data/shared-database.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Shared database", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Shared database"}, "url": "http://microservices.io/patterns/data/shared-database.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Shared database"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Shared database\n\n[pattern](/tags/pattern)\n\n---\n\n## Context\n\nLet’s imagine you are developing an online store application using the [Microservice architecture pattern](/patterns/microservices.html).\nMost services need to persist data in some kind of database.\nFor example, the `Order Service` stores information about orders and the `Customer Service` stores information about customers.\n\n## Problem\n\nWhat’s the database architecture in a microservices application?\n\n## Forces\n\n- Services must be loosely coupled so that they can be developed, deployed and scaled independently\n- Some business transactions must enforce invariants that span multiple services.\nFor example, the `Place Order` use case must verify that a new Order will not exceed the customer’s credit limit.\nOther business transactions, must update data owned by multiple services.\n- Some business transactions need to query data that is owned by multiple services.\nFor example, the `View Available Credit` use must query the Customer to find the `creditLimit` and Orders to calculate the total amount of the open orders.\n- Some queries must join data that is owned by multiple services.\nFor example, finding customers in a particular region and their recent orders requires a join between customers and orders.\n- Databases must sometimes be replicated and sharded in order to scale. See the [Scale Cube](/articles/scalecube.html).\n- Different services have different data storage requirements.\nFor some services, a relational database is the best choice.\nOther services might need a NoSQL database such as MongoDB, which is good at storing complex, unstructured data, or Neo4J, which is designed to efficiently store and query graph data.\n\nUse a (single) database that is shared by multiple services.\nEach service freely accesses data owned by other services using local ACID transactions.\n\nThe `OrderService` and `CustomerService` freely access each other’s tables.\nFor example, the `OrderService` can use the following ACID transaction ensure that a new order will not violate the customer’s credit limit.\n\n```\nBEGIN TRANSACTION\n…\nSELECT ORDER_TOTAL\n FROM ORDERS WHERE CUSTOMER_ID = ?\n…\nSELECT CREDIT_LIMIT\nFROM CUSTOMERS WHERE CUSTOMER_ID = ?\n…\nINSERT INTO ORDERS …\n…\nCOMMIT TRANSACTION\n```\n\nThe database will guarantee that the credit limit will not be exceeded even when simultaneous transactions attempt to create orders for the same customer.\n\nThe benefits of this pattern are:\n\n- A developer uses familiar and straightforward ACID transactions to enforce data consistency\n- A single database is simpler to operate\n\nThe drawbacks of this pattern are:\n\n- Development time coupling - a developer working on, for example, the `OrderService` will need to coordinate schema changes with the developers of other services that access the same tables.\nThis coupling and additional coordination will slow down development.\n- Runtime coupling - because all services access the same database they can potentially interfere with one another.\nFor example, if long running `CustomerService` transaction holds a lock on the `ORDER` table then the `OrderService` will be blocked.\n- Single database might not satisfy the data storage and access requirements of all services.\n- [Database per Service](database-per-service.html) is an alternative approach\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 6546, "slov": 864, "odkazu": 30, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:30", "sha256": "0daf3e67e31ea37ba19650612945d6ae14432af94f90fa9f5664253e6b2c3e9d", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/data/transaction-log-tailing.html", "titulek": "Pattern: Transaction log tailing", "h1": "Pattern: Transaction log tailing", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Transaction log tailing", "og:url": "http://microservices.io/patterns/data/transaction-log-tailing.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/data/transaction-log-tailing.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Transaction log tailing", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Transaction log tailing"}, "url": "http://microservices.io/patterns/data/transaction-log-tailing.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Transaction log tailing"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Example"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "Learn more"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Transaction log tailing\n\n[pattern](/tags/pattern) [transactional messaging](/tags/transactional messaging) [inter-service communication](/tags/inter-service communication)\n\n---\n\n## Context\n\nYou have applied the [Transactional Outbox](transactional-outbox.html) pattern.\n\n## Problem\n\nHow to publish messages/events into the *outbox* in the database to the message broker?\n\n## Forces\n\n## Solution\n\nTail the database transaction log and publish each message/event inserted into the *outbox* to the message broker.\n\nThe mechanism for trailing the transaction log depends on the database:\n\n- MySQL binlog\n- Postgres WAL\n- AWS DynamoDB table streams\n\n## Example\n\n- [Eventuate Tram framework](https://github.com/eventuate-tram/eventuate-tram-core) implements transaction log tailing.\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- No 2PC\n- Guaranteed to be accurate\n\nThis pattern has the following drawbacks:\n\n- Relatively obscure although becoming increasing common\n- Requires database specific solutions\n- Tricky to avoid duplicate publishing\n\n- The [Transactional Outbox](transactional-outbox.html) pattern creates the need for this pattern\n- The [Polling publisher](polling-publisher.html) pattern is an alternative solution\n\n## Learn more\n\n- My book [Microservices patterns](/book) describes this pattern in a lot more detail.\n- The [Eventuate Tram framework](https://github.com/eventuate-tram/eventuate-tram-core) implements this pattern\n\n---\n\n[pattern](/tags/pattern) [transactional messaging](/tags/transactional messaging) [inter-service communication](/tags/inter-service communication)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4829, "slov": 561, "odkazu": 32, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:36", "sha256": "b07942a1b6f79e480f5ea7c49fd702763756487001fa1d7b7e1bcacaaeedcc87", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://github.com/eventuate-tram/eventuate-tram-core", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/data/transactional-outbox.html", "titulek": "Pattern: Transactional outbox", "h1": "Pattern: Transactional outbox", "popis": "First, write the message/event to a database OUTBOX table as part of the transaction that updates business objects, and then publish it to a message broker.", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Transactional outbox", "og:image": "http://microservices.io/i/patterns/data/ReliablePublication.png", "og:url": "http://microservices.io/patterns/data/transactional-outbox.html", "og:description": "First, write the message/event to a database OUTBOX table as part of the transaction that updates business objects, and then publish it to a message broker."}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/data/transactional-outbox.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Transactional outbox", "description": "A pattern language for microservices", "primaryImageOfPage": {"@type": "ImageObject", "contentUrl": "http://microservices.io/i/patterns/data/ReliablePublication.png", "representativeOfPage": "True"}, "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Transactional outbox", "description": "First, write the message/event to a database OUTBOX table as part of the transaction that updates business objects, and then publish it to a message broker.", "image": {"@type": "ImageObject", "name": "Transactional outbox", "width": "735", "height": "428", "url": "http://microservices.io/i/patterns/data/ReliablePublication.png"}}, "url": "http://microservices.io/patterns/data/transactional-outbox.html"}, {"@context": "http://schema.org", "@type": "Question", "name": "How to reliably/atomically update the database and publish messages/events?", "acceptedAnswer": {"@type": "Answer", "text": "First, write the message/event to a database OUTBOX table as part of the transaction that updates business objects, and then publish it to a message broker."}}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Transactional outbox"}, {"uroven": 2, "text": "Also known as"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Result context"}, {"uroven": 2, "text": "Learn more"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Transactional outbox\n\n[pattern](/tags/pattern) [transactional messaging](/tags/transactional messaging) [service design](/tags/service design) [inter-service communication](/tags/inter-service communication)\n\n---\n\n## Also known as\n\nApplication events\n\n## Context\n\nA service command typically needs to create/update/delete [aggregates](aggregate.html) in the database **and** send messages/events to a message broker.\nFor example, a service that participates in a [saga](/patterns/data/saga.html) needs to update business entities and send messages/events.\nSimilarly, a service that publishes a [domain event](domain-event.html) must update an [aggregate](aggregate.html) and publish an event.\n\nThe command must atomically update the database and send messages in order to avoid data inconsistencies and bugs.\nHowever, it is not viable to use a traditional distributed transaction (2PC) that spans the database and the message broker\nThe database and/or the message broker might not support 2PC.\nAnd even if they do, it’s often undesirable to couple the service to both the database and the message broker.\n\nBut without using 2PC, sending a message in the middle of a transaction is not reliable.\nThere’s no guarantee that the transaction will commit.\nSimilarly, if a service sends a message after committing the transaction there’s no guarantee that it won’t crash before sending the message.\n\nIn addition, messages must be sent to the message broker in the order they were sent by the service.\nThey must usually be delivered to each consumer in the same order although that’s outside the scope of this pattern.\nFor example, let’s suppose that an aggregate is updated by a series of transactions `T1`, `T2`, etc.\nThis transactions might be performed by the same service instance or by different service instances.\nEach transaction publishes a corresponding event: `T1 -> E1`, `T2 -> E2`, etc.\nSince `T1` precedes `T2`, event `E1` must be published before `E2`.\n\n## Problem\n\nHow to atomically update the database and send messages to a message broker?\n\n## Forces\n\n- 2PC is not an option. The database and/or the message broker might not support 2PC. Also, it’s often undesirable to couple the service to both the database and the message broker.\n- If the database transaction commits then the messages must be sent. Conversely, if the database rolls back, the messages must not be sent\n- Messages must be sent to the message broker in the order they were sent by the service. This ordering must be preserved across multiple service instances that update the same aggregate.\n\n## Solution\n\nThe solution is for the service that sends the message to first store the message in the database as part of the transaction that updates the business entities.\nA separate process then sends the messages to the message broker.\n\nThe participants in this pattern are:\n\n- Sender - the service that sends the message\n- Database - the database that stores the business entities and message outbox\n- Message outbox - if it’s a relational database, this is a table that stores the messages to be sent. Otherwise, if it’s a NoSQL database, the outbox is a property of each database record (e.g. document or item)\n- Message relay - sends the messages stored in the outbox to the message broker\n\n## Result context\n\nThis pattern has the following benefits:\n\n- 2PC is not used\n- Messages are guaranteed to be sent if and only if the database transaction commits\n- Messages are sent to the message broker in the order they were sent by the application\n\nThis pattern has the following drawbacks:\n\n- Potentially error prone since the developer might forget to publish the message/event after updating the database.\n\nThis pattern also has the following issues:\n\n- The Message relay might publish a message more than once.\nIt might, for example, crash after publishing a message but before recording the fact that it has done so.\nWhen it restarts, it will then publish the message again.\nAs a result, a message consumer must be idempotent, perhaps by tracking the IDs of the messages that it has already processed.\nFortunately, since message Consumers usually need to be idempotent (because a message broker can deliver messages more than once) this is typically not a problem.\n\n- The [Saga](saga.html) and [Domain event](domain-event.html) patterns create the need for this pattern.\n- The [Event sourcing](event-sourcing.html) is an alternative solution\n- There are two patterns for implementing the Message relay:\n - The [Transaction log tailing](transaction-log-tailing.html) pattern\n - The [Polling publisher](polling-publisher.html) pattern\n\n## Learn more\n\n- My book [Microservices patterns](/book) describes this pattern in a lot more detail.\n- The [Eventuate Tram framework](https://github.com/eventuate-tram/eventuate-tram-core) implements this pattern\n\n---\n\n[pattern](/tags/pattern) [transactional messaging](/tags/transactional messaging) [service design](/tags/service design) [inter-service communication](/tags/inter-service communication)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 8204, "slov": 1122, "odkazu": 38, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:38", "sha256": "4a86d3fb29ea43f67802cbe0ed94763ab0691684525e394d8e6619842b8cc3a5", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://github.com/eventuate-tram/eventuate-tram-core", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/decomposition/decompose-by-business-capability.html", "titulek": "Pattern: Decompose by business capability", "h1": "Pattern: Decompose by business capability", "popis": "Decompose an application into services by defining services corresponding to business capabilities.", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Decompose by business capability", "og:image": "http://microservices.io/i/successtriangle.png", "og:url": "http://microservices.io/patterns/decomposition/decompose-by-business-capability.html", "og:description": "Decompose an application into services by defining services corresponding to business capabilities."}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/decomposition/decompose-by-business-capability.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Decompose by business capability", "description": "A pattern language for microservices", "primaryImageOfPage": {"@type": "ImageObject", "contentUrl": "http://microservices.io/i/successtriangle.png", "representativeOfPage": "True"}, "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Decompose by business capability", "description": "Decompose an application into services by defining services corresponding to business capabilities.", "image": {"@type": "ImageObject", "name": "Microservices enable continuous delivery/deployment", "width": "735", "height": "428", "url": "http://microservices.io/i/successtriangle.png"}}, "url": "http://microservices.io/patterns/decomposition/decompose-by-business-capability.html"}, {"@context": "http://schema.org", "@type": "Question", "name": "How to decompose an application into services?", "acceptedAnswer": {"@type": "Answer", "text": "Decompose an application into services by defining services corresponding to business capabilities."}}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Decompose by business capability"}, {"uroven": 1, "text": "Context"}, {"uroven": 1, "text": "Problem"}, {"uroven": 1, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting Context"}, {"uroven": 2, "text": "Issues"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Decompose by business capability\n\n[pattern](/tags/pattern)\n\n---\n\n# Context\n\nYou are developing a large, complex application and want to use the [microservice architecture](../microservices.html).\nThe microservice architecture structures an application as a set of loosely coupled services.\nThe goal of the microservice architecture is to accelerate software development by enabling continuous delivery/deployment.\n\nThe microservice architecture does this in two ways:\n\n1. Simplifies testing and enables components to deployed independently\n2. Structures the engineering organization as a collection of small (6-10 members), autonomous teams, each of which is responsible for one or more services\n\nThese benefits are not automatically guaranteed.\nInstead, they can only be achieved by the careful functional decomposition of the application into services.\n\nA service must be small enough to be developed by a small team and to be easily tested.\nA useful guideline from object-oriented design (OOD) is the Single Responsibility Principle ([SRP](http://www.objectmentor.com/resources/articles/srp.pdf)).\nThe SRP defines a responsibility of a class as a reason to change, and states that a class should only have one reason to change.\nIt make sense to apply the SRP to service design as well and design services that are cohesive and implement a small set of strongly related functions.\n\nThe application also be decomposed in a way so that most new and changed requirements only affect a single service.\nThat is because changes that affect multiple services requires coordination across multiple teams, which slows down development.\nAnother useful principle from OOD is the Common Closure Principle (CCP), which states that classes that change for the same reason should be in the same package.\nPerhaps, for instance, two classes implement different aspects of the same business rule.\nThe goal is that when that business rule changes developers, only need to change code in a small number - ideally only one - of packages.\nThis kind of thinking makes sense when designing services since it will help ensure that each change should impact only one service.\n\n# Problem\n\nHow to decompose an application into services?\n\n# Forces\n\n- The architecture must be stable\n- Services must be cohesive.\nA service should implement a small set of strongly related functions.\n- Services must conform to the Common Closure Principle - things that change together should be packaged together - to ensure that each change affect only one service\n- Services must be loosely coupled - each service as an API that encapsulates its implementation.\nThe implementation can be changed without affecting clients\n- A service should be testable\n- Each service be small enough to be developed by a “two pizza” team, i.e. a team of 6-10 people\n- Each team that owns one or more services must be autonomous.\nA team must be able to develop and deploy their services with minimal collaboration with other teams.\n\n## Solution\n\nDefine services corresponding to business capabilities.\nA business capability is a concept from business architecture modeling.\nIt is something that a business does in order to generate value.\nA business capability often corresponds to a business object, e.g.\n\n- *Order Management* is responsible for orders\n- *Customer Management* is responsible for customers\n\nBusiness capabilities are often organized into a multi-level hierarchy.\nFor example, an enterprise application might have top-level categories such as *Product/Service development*, *Product/Service delivery*, *Demand generation*, etc.\n\n## Examples\n\nThe business capabilities of an online store include:\n\n- Product catalog management\n- Inventory management\n- Order management\n- Delivery management\n- …\n\nThe corresponding microservice architecture would have services corresponding to each of these capabilities.\n\n## Resulting Context\n\nThis pattern has the following benefits:\n\n- Stable architecture since the business capabilities are relatively stable\n- Development teams are cross-functional, autonomous, and organized around delivering business value rather than technical features\n- Services are cohesive and loosely coupled\n\n## Issues\n\nThere are the following issues to address:\n\n- **How to identify business capabilities?**\nIdentifying business capabilities and hence services requires an understanding of the business.\nAn organization’s business capabilities are identified by analyzing the organization’s purpose, structure, business processes, and areas of expertise.\nBounded contexts are best identified using an iterative process.\nGood starting points for identifying business capabilities are:\n - organization structure - different groups within an organization might correspond to business capabilities or business capability groups.\n - high-level domain model - business capabilities often correspond to domain objects\n\n- The [Decompose by subdomain](decompose-by-subdomain.html) pattern is an alternative pattern\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 8193, "slov": 1089, "odkazu": 30, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:29", "sha256": "ee4d0c9fa57c7c10392a5b8b58099d5156c13669b134d67fd0f8a7bd898aed2d", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "http://www.objectmentor.com/resources/articles/srp.pdf", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/decomposition/decompose-by-subdomain.html", "titulek": "Pattern: Decompose by subdomain", "h1": "Pattern: Decompose by subdomain", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Decompose by subdomain", "og:url": "http://microservices.io/patterns/decomposition/decompose-by-subdomain.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/decomposition/decompose-by-subdomain.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Decompose by subdomain", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Decompose by subdomain"}, "url": "http://microservices.io/patterns/decomposition/decompose-by-subdomain.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Decompose by subdomain"}, {"uroven": 1, "text": "Context"}, {"uroven": 1, "text": "Problem"}, {"uroven": 1, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting Context"}, {"uroven": 2, "text": "Issues"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Decompose by subdomain\n\n[pattern](/tags/pattern)\n\n---\n\n# Context\n\nYou are developing a large, complex application and want to use the [microservice architecture](../microservices.html).\nThe microservice architecture structures an application as a set of loosely coupled services.\nThe goal of the microservice architecture is to accelerate software development by enabling continuous delivery/deployment.\n\nThe microservice architecture does this in two ways:\n\n1. Simplifies testing and enables components to deployed independently\n2. Structures the engineering organization as a collection of small (6-10 members), autonomous teams, each of which is responsible for one or more services\n\nThese benefits are not automatically guaranteed.\nInstead, they can only be achieved by the careful functional decomposition of the application into services.\n\nA service must be small enough to be developed by a small team and to be easily tested.\nA useful guideline from object-oriented design (OOD) is the Single Responsibility Principle ([SRP](http://www.objectmentor.com/resources/articles/srp.pdf)).\nThe SRP defines a responsibility of a class as a reason to change, and states that a class should only have one reason to change.\nIt make sense to apply the SRP to service design as well and design services that are cohesive and implement a small set of strongly related functions.\n\nThe application also be decomposed in a way so that most new and changed requirements only affect a single service.\nThat is because changes that affect multiple services requires coordination across multiple teams, which slows down development.\nAnother useful principle from OOD is the Common Closure Principle (CCP), which states that classes that change for the same reason should be in the same package.\nPerhaps, for instance, two classes implement different aspects of the same business rule.\nThe goal is that when that business rule changes developers, only need to change code in a small number - ideally only one - of packages.\nThis kind of thinking makes sense when designing services since it will help ensure that each change should impact only one service.\n\n# Problem\n\nHow to decompose an application into services?\n\n# Forces\n\n- The architecture must be stable\n- Services must be cohesive.\nA service should implement a small set of strongly related functions.\n- Services must conform to the Common Closure Principle - things that change together should be packaged together - to ensure that each change affect only one service\n- Services must be loosely coupled - each service as an API that encapsulates its implementation.\nThe implementation can be changed without affecting clients\n- A service should be testable\n- Each service be small enough to be developed by a “two pizza” team, i.e. a team of 6-10 people\n- Each team that owns one or more services must be autonomous.\nA team must be able to develop and deploy their services with minimal collaboration with other teams.\n\n## Solution\n\nDefine services corresponding to Domain-Driven Design (DDD) subdomains.\nDDD refers to the application’s problem space - the business - as the domain.\nA domain is consists of multiple subdomains.\nEach subdomain corresponds to a different part of the business.\n\nSubdomains can be classified as follows:\n\n- Core - key differentiator for the business and the most valuable part of the application\n- Supporting - related to what the business does but not a differentiator. These can be implemented in-house or outsourced.\n- Generic - not specific to the business and are ideally implemented using off the shelf software\n\n## Examples\n\nThe subdomains of an online store include:\n\n- Product catalog\n- Inventory management\n- Order management\n- Delivery management\n- …\n\nThe corresponding microservice architecture would have services corresponding to each of these subdomains.\n\n## Resulting Context\n\nThis pattern has the following benefits:\n\n- Stable architecture since the subdomains are relatively stable\n- Development teams are cross-functional, autonomous, and organized around delivering business value rather than technical features\n- Services are cohesive and loosely coupled\n\n## Issues\n\nThere are the following issues to address:\n\n- **How to identify the subdomains?**\nIdentifying subdomains and hence services requires an understanding of the business.\nLike business capabilities, subdomains are identified by analyzing the business and its organizational structure and identifying the different areas of expertise.\nSubdomains are best identified using an iterative process.\nGood starting points for identifying subdomains are:\n- organization structure - different groups within an organization might correspond to subdomains\n- high-level domain model - subdomains often have a key domain object\n\n- The [Decompose by business capability](decompose-by-business-capability.html) pattern is an alternative pattern\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 8101, "slov": 1092, "odkazu": 30, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:31", "sha256": "fa56f5a827801924cf47163241064424eb3ab952e08d510b9b9ecc57bcd2db4f", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "http://www.objectmentor.com/resources/articles/srp.pdf", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/decomposition/self-contained-service.html", "titulek": "Self-contained service", "h1": "Self-contained service", "popis": "Design a service so that it can respond to a synchronous request without waiting for the response from any other service.", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Self-contained service", "og:image": "http://microservices.io/i/Order-Service-asynchronous.png", "og:url": "http://microservices.io/patterns/decomposition/self-contained-service.html", "og:description": "Design a service so that it can respond to a synchronous request without waiting for the response from any other service."}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/decomposition/self-contained-service.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Self-contained service", "description": "A pattern language for microservices", "primaryImageOfPage": {"@type": "ImageObject", "contentUrl": "http://microservices.io/i/Order-Service-asynchronous.png", "representativeOfPage": "True"}, "mainEntity": {"@type": "Intangible", "name": "Pattern: Self-contained service", "description": "Design a service so that it can respond to a synchronous request without waiting for the response from any other service.", "image": {"@type": "ImageObject", "name": "Designing highly available service", "width": "735", "height": "428", "url": "http://microservices.io/i/Order-Service-asynchronous.png"}}, "url": "http://microservices.io/patterns/decomposition/self-contained-service.html"}, {"@context": "http://schema.org", "@type": "Question", "name": "How should a service collaborate with other services when handling a synchronous request?", "acceptedAnswer": {"@type": "Answer", "text": "Design a service so that it can respond to a synchronous request without waiting for the response from any other service."}}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Self-contained service"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Example"}, {"uroven": 2, "text": "Resulting Context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Self-contained service\n\n[pattern](/tags/pattern) [loose coupling](/tags/loose coupling)\n\n---\n\n## Context\n\nConsider, the FTGO application, which is an online food delivery application.\nA client of application creates an order by making an HTTP `POST /orders` request and expects a response, say, within 600ms.\nBecause the FTGO application uses the [microservice architecture](/patterns/microservices.html), the responsibilities that implement order creation are scattered across multiple services.\nThe `POST` request is first routed to the `Order Service`, which must then collaborate with the following services:\n\n- `Restaurant Service` - knows the restaurant’s menu and prices\n- `Consumer Service` - knows the state of the `Consumer` that places the order\n- `Kitchen Service` - creates a `Ticket` , which tells the chef what to cook\n- `Accounting Service` - authorizes the consumer’s credit card\n\nThe `Order Service` could invoke each of these services using synchronous request/response.\nIt might, for example, implement the inter-service communication using REST or gRPC.\n\nHowever, a key drawback of using synchronous request/response is that it reduces availability.\nThat’s because if any of the `Order Sevice`’s collaborators are unavailable, it will not be able to create the order and must return an error to the client.\n\nAn alternative approach is to eliminate all synchronous communication between the `Order Service` and its collaborators by using the CQRS and Saga patterns.\nThe `Order Service` can use the [CQRS pattern](/patterns/data/cqrs.html) to maintain a replica of the restaurant menu’s and there by eliminate the need to synchronously fetch data from the `Restaurant Service`.\nIt can validate the order asynchronously by using the [Saga pattern](/patterns/data/saga.html).\nThe `Order Service` creates an `Order` in a `PENDING` state and sends back a response to the `POST /order`.\nIt then completes the creation of the order by communicating asynchronously with the other services.\n\nA key benefit of this approach is that it improves availability.\nThe `Order Service` always respond to a `POST /orders` request even when one of the other services is unavailable.\nOne drawback, however, of using a saga to complete the creation of the order is that the response to the `POST` doesn’t tell the client whether the order was approved.\nThe client must find out by periodically invoking `GET /orders/{orderId}`.\n\n## Problem\n\nHow should a service collaborate with other services when handling a synchronous request?\n\n## Forces\n\n- The microservice architecture often distributes the responsibility of handling a request amongst multiple services\n- An operation is typically required to be highly available with a low response time\n- The availability of an operation is the product of the availabilities of the services that are invoked while handling a request: serviceAvailability numberOfSynchronouslyCollaboratingServices\n- A service can retry a request to a failed collaborator but this increases response time.\n\n## Solution\n\nDesign a service so that it can respond to a synchronous request without waiting for the response from any other service.\n\nOne way to make a service self-contained is to implement needed functionality as a service module rather than a separate service.\nWe could, for example, merge the `Order Service` and `Restaurant Service`.\n\nAnother way to make a service self-contained is for it to collaborate with other services using the [CQRS](/patterns/data/cqrs.html) and the [Saga](/patterns/data/saga.html) patterns.\nA self-contained service uses the Saga pattern to asynchronously maintain data consistency.\nIt uses the CQRS pattern to maintain a replica of data owned by other services.\n\n## Example\n\nThe `Order Service` in the FTGO application described earlier is an example of a self-contained service.\nThe `createOrder()` operation, for example, queries a CQRS replica of data owned by the `Restaurant Service` to validate and price the order, and then initiates a saga to finish the creation of the order.\n\n## Resulting Context\n\nThis pattern has the following benefits:\n\n- Improved availability and response time\n\nThis pattern has the following drawbacks:\n\n- Increased cost and complexity of using CQRS\n- Increased complexity of using sagas\n- Less straightforward API when using sagas\n- Larger service due to functionality being implemented in the service instead of as a separate service\n\n- [Microservice architecture](/patterns/microservices.html) - creates the need for this pattern\n- [Saga](/patterns/data/saga.html) - used by a service self-contained to asynchronously maintain data consistency\n- [CQRS](/patterns/data/cqrs.html) - used by a service self-contained to maintain a replica of data owned by other services\n\n---\n\n[pattern](/tags/pattern) [loose coupling](/tags/loose coupling)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 7985, "slov": 1077, "odkazu": 31, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:06", "sha256": "9d9d755b3364f63f148a7c92a18f0c4fe9cec1924a007bd342de2e8464b307e6", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/decomposition/service-per-team.html", "titulek": "Service per team", "h1": "Service per team", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Service per team", "og:url": "http://microservices.io/patterns/decomposition/service-per-team.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/decomposition/service-per-team.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Service per team", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Service per team"}, "url": "http://microservices.io/patterns/decomposition/service-per-team.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Service per team"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Service per team\n\n[pattern](/tags/pattern) [service granularity](/tags/service granularity)\n\n---\n\n## Context\n\nA high performance development organization consist of multiple teams.\nEach team is long-lived, small (typically 5-9 people), loosely coupled, autonomous, and cross-functional.\n[Conway’s law](https://en.wikipedia.org/wiki/Conway%27s_law)\nsays an architecture mirrors the communication structure of the organization that builds it.\nConsequently, an organization consisting of loosely coupled teams needs a loosely coupled architecture.\n\nOne such loosely coupled architecture is the [microservice architecture](/patterns/microservices.html).\nIt’s an application style that structures an application as a loosely coupled set of services.\n[Decompose by Subdomain](decompose-by-subdomain.html) and [Decompose by business capability](decompose-by-business-capability.html) are patterns for identifying services and organizing them around business functionality.\nBut what’s the relationship between services and teams?\n\nOne approach is a shared ownership model where multiple teams to work on each service as necessary.\nFor example, each team might be responsible for implementing features that span multiple services.\nOn the one hand, this approach aligns teams with the user experience.\nBut on the other hand, it increases the amount of coordination needed between the teams.\nAlso, the lack of code ownership increases the risk of poor code quality.\n\nA better approach, which increases team autonomy and loose coupling, is a code/service ownership model.\nThe team, which is responsible for a business function/capability owns a code base, which they deploy as one of more services.\nAs a result, the team can freely develop, test, deploy and scale its services.\nThey primarily interact with other teams in order to negotiate APIs.\n\nA team should ideally own just one service since that’s sufficient to ensure team autonomy and loose coupling and each additional service adds complexity and overhead.\nA team should only deploy its code as multiple services if it solves a tangible problem, such as significantly reducing lead time or improving scalability or fault tolerance.\n\nSince a team must be small, its cognitive capacity is limited.\nIn order for the team to be productive, its code base should be scoped to not exceed the team’s cognitive capacity.\nIn other words, it must ‘fit’ in the team’s heads.\nAs a result, there is an upper bound on the size and/or complexity of a service.\n\n## Problem\n\nWhat’s the relationship between teams and services?\n\n## Forces\n\n- A team should be small, e.g. 5-9 people\n- A team should be autonomous and loosely coupled\n- The size and complexity of the team’s code base must not exceed the team’s cognitive capacity.\n- Finer-grained service decomposition improves *-ilities* including maintainability, testability, deployability\n- Finer-grained service decomposition adds complexity\n\n## Solution\n\nEach service is owned by a team, which has sole responsibility for making changes.\nIdeally each team has only one service:\n\nEach team is responsible for one or more business functions (e.g. business capabilities).\nA team owns (has sole responsibility for changing) a code base consisting of one or more modules.\nIts code base is sized so as to not exceed the cognitive capacity of team.\nThe team deploys its code as one or more services.\nA team should have exactly one service unless there is a proven need to have multiple services.\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- Enables each team to be autonomous and work with minimal coordination with other teams\n- Enables the teams to be loosely coupled\n- Achieves team autonomy and loose coupling with the minimum number of services\n- Improves code quality due to long term code ownership\n\nThis pattern has the following drawbacks:\n\n- Teams are not necessarily aligned with end user features\n- Implementing features that span services is more complicated and requires teams to collaborate\n\n- [Microservice architecture](/patterns/microservices.html) - creates the need for this pattern\n- [Decompose by Subdomain](decompose-by-subdomain.html) and [Decompose by business capability](decompose-by-business-capability.html) are patterns for identifying services\n\n---\n\n[pattern](/tags/pattern) [service granularity](/tags/service granularity)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 7564, "slov": 1008, "odkazu": 32, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:24", "sha256": "0b37a9fab201023d2e55d68125a3642a2f6d443a0d2cffffeebba8249ab62496", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://en.wikipedia.org/wiki/Conway's_law", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/deployment/language-specific-packaging.html", "titulek": "", "h1": "Microservice architecture", "popis": "", "klicova_slova": "renamed-pattern", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [], "markdown": "Redirect to renamed pattern \nIf your browser doesn't automatically go there within a few seconds,\nyou may want to go to\n[the destination](multiple-services-per-host.html)\nmanually.", "znaku_textu": 180, "slov": 27, "odkazu": 4, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:39", "sha256": "3004b4f8a6ecbe2d97acf3af155a925308994f9c33d09cce0b45c0a18789039d", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://github.com/yourusername", "https://twitter.com/yourusername"]} {"url": "http://microservices.io/patterns/deployment/multiple-services-per-host.html", "titulek": "Pattern: Multiple service instances per host", "h1": "Pattern: Multiple service instances per host", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Multiple service instances per host", "og:url": "http://microservices.io/patterns/deployment/multiple-services-per-host.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/deployment/multiple-services-per-host.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Multiple service instances per host", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Multiple service instances per host"}, "url": "http://microservices.io/patterns/deployment/multiple-services-per-host.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Multiple service instances per host"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Multiple service instances per host\n\n[pattern](/tags/pattern) [deployment](/tags/deployment)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](/patterns/microservices.html) and architected your system as a set of services.\nEach service is deployed as a set of service instances for throughput and availability.\n\n## Problem\n\nHow are services packaged and deployed?\n\n## Forces\n\n- Services are written using a variety of languages, frameworks, and framework versions\n- Each service consists of multiple service instances for throughput and availability\n- Service must be independently deployable and scalable\n- Service instances need to be isolated from one another\n- You need to be able to quickly build and deploy a service\n- You need to be able to constrain the resources (CPU and memory) consumed by a service\n- You need to monitor the behavior of each service instance\n- You want deployment to reliable\n- You must deploy the application as cost-effectively as possible\n\n## Solution\n\nRun multiple instances of different services on a host (Physical or Virtual machine).\n\nThere are various ways of deploying a service instance on a shared host including:\n\n- Deploy each service instance as a JVM process. For example, a Tomcat or Jetty instances per service instance.\n- Deploy multiple service instances in the same JVM. For example, as web applications or OSGI bundles.\n\n## Examples\n\n## Resulting context\n\nThe benefits of this pattern include:\n\n- More efficient resource utilization than the [Service Instance per host pattern](single-service-per-host.html)\n\nThe drawbacks of this approach include:\n\n- Risk of conflicting resource requirements\n- Risk of conflicting dependency versions\n- Difficult to limit the resources consumed by a service instance\n- If multiple services instances are deployed in the same process then its difficult to monitor the resource consumption of each service instance.\nIts also impossible to isolate each instance\n\n- The [Single Service Instance per Host pattern](single-service-per-host.html) is an alternative solution.\n- The [Serverless deployment pattern](/patterns/deployment/serverless-deployment.html) is an alternative solution.\n\n---\n\n[pattern](/tags/pattern) [deployment](/tags/deployment)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 5477, "slov": 691, "odkazu": 31, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:00", "sha256": "d8edb235b82dd62d2cd7865ae0074ddc0b1a061149b946f917487fb49ca9e5a5", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/deployment/serverless-deployment.html", "titulek": "Pattern: Serverless deployment", "h1": "Pattern: Serverless deployment", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Serverless deployment", "og:url": "http://microservices.io/patterns/deployment/serverless-deployment.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/deployment/serverless-deployment.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Serverless deployment", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Serverless deployment"}, "url": "http://microservices.io/patterns/deployment/serverless-deployment.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Serverless deployment"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Serverless deployment\n\n[pattern](/tags/pattern) [deployment](/tags/deployment)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](/patterns/microservices.html) and architected your system as a set of services.\nEach service is deployed as a set of service instances for throughput and availability.\n\n## Problem\n\nHow are services packaged and deployed?\n\n## Forces\n\n- Services are written using a variety of languages, frameworks, and framework versions\n- Each service consists of multiple service instances for throughput and availability\n- Service must be independently deployable and scalable\n- Service instances need to be isolated from one another\n- You need to be able to quickly build and deploy a service\n- You need to be able to constrain the resources (CPU and memory) consumed by a service\n- You need to monitor the behavior of each service instance\n- You want deployment to reliable\n- You must deploy the application as cost-effectively as possible\n\n## Solution\n\nUse a deployment infrastructure that hides any concept of servers (i.e. reserved or preallocated resources)- physical or virtual hosts, or containers.\nThe infrastructure takes your service’s code and runs it.\nYou are charged for each request based on the resources consumed.\n\nTo deploy your service using this approach, you package the code (e.g. as a ZIP file), upload it to the deployment infrastructure and describe the desired performance characteristics.\n\nThe deployment infrastructure is a utility operated by a public cloud provider.\nIt typically uses either containers or virtual machines to isolate the services.\nHowever, these details are hidden from you.\nNeither you nor anyone else in your organization is responsible for managing any low-level infrastructure such as operating systems, virtual machines, etc.\n\n## Examples\n\nThere are a few different serverless deployment environments:\n\n- [AWS Lambda](https://aws.amazon.com/lambda/)\n- [Google Cloud Functions](https://cloud.google.com/functions/docs)\n- [Azure Functions](https://azure.microsoft.com/en-us/services/functions/)\n\nThey offer similar functionality but AWS Lambda has the richest feature set.\nAn AWS Lambda function is a stateless component that is invoked to handle events.\nTo create an AWS Lambda function you package your the NodeJS, Java or Python code for your service in a ZIP file, and upload it to AWS Lambda.\nYou also specify the name of function that handles events as well as resource limits.\n\nWhen an event occurs, AWS Lambda finds an idle instance of your function, launching one if none are available and invokes the handler function.\nAWS Lambda runs enough instances of your function to handle the load.\nUnder the covers, it uses containers to isolate each instance of a lambda function.\nAs you might expect, AWS Lambda runs the containers on EC2 instances.\n\nThere are four ways to invoke a lambda function.\nOne option is to configure your lambda function to be invoked in response to an event generated by an AWS service such as S3, DynamoDB or Kinesis.\nExamples of events include the following:\n\n- an object being created in a S3 bucket\n- an item is created, updated or deleted in a DynamoDB table\n- a message is available to read from a Kinesis stream\n- an email being received via the Simple email service.\n\nAnother way to invoke a lambda function is to configure the AWS Lambda Gateway to route HTTP requests to your lambda.\nAWS Gateway transforms an HTTP request into an event object, invokes the lambda function, and generates a HTTP response from the lambda function’s result.\n\nYou can also explicitly invoke your lambda function using the AWS Lambda Web Service API.\nYour application that invokes the lambda function supplies a JSON object, which is passed to the lambda function.\nThe web service call returns the value returned by the lambda.\n\nThe fourth way to invoke a lambda function is periodically using a cron-like mechanism.\nYou can, for example, tell AWS to invoke you lambda function every five minutes.\n\nThe cost of each invocation is a function of the duration of the invocation, which is measured in 100 millisecond increments, and the memory consumed.\n\n## Resulting context\n\nThe benefits of using serverless deployment include:\n\n- It eliminates the need to spend time on the undifferentiated heavy lifting of managing low-level infrastructure.\nInstead, you can focus on your code.\n- The serverless deployment infrastructure is extremely elastic.\nIt automatically scales your services to handle the load.\n- You pay for each request rather than provisioning what might be under utilized virtual machines or containers.\n\nThe drawbacks of serverless deployment include:\n\n- Significant limitation and constraints -\nA serverless deployment environment typically has far more constraints that a VM-based or Container-based infrastructure.\nFor example, AWS Lambda only supports a few languages.\nIt is only suitable for deploying stateless applications that run in response to a request.\nYou cannot deploy a long running stateful application such as a database or message broker.\n- Limited “input sources” - lambdas can only respond to requests from a limited set of input sources.\nAWS Lambda is not intended to run services that, for example, subscribe to a message broker such as RabbitMQ.\n- Applications must startup quickly - serverless deployment is not a good fit your service takes a long time to start\n- Risk of high latency - the time it takes for the infrastructure to provision an instance of your function and for the function to initialize might result in significant latency.\nMoreover, a serverless deployment infrastructure can only react to increases in load.\nYou cannot proactively pre-provision capacity.\nAs a result, your application might initially exhibit high latency when there are sudden, massive spikes in load.\n\nThe deployment infrastructure will internally deploy your application using one of the other patterns.\nIt will most likely use [Service Service per Host pattern](single-service-per-host.html).\n\n- The [Multiple Service Instances per Host pattern](multiple-services-per-host.html) is an alternative deployment solution\n- The [Single Service per Host pattern](single-service-per-host.html) is an alternative deployment solution\n\n---\n\n[pattern](/tags/pattern) [deployment](/tags/deployment)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 9520, "slov": 1327, "odkazu": 34, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:13", "sha256": "bfedbda29ce91bb562a4983ba950bc845978a82c4e1134e03af14ed59a92561f", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://aws.amazon.com/lambda/", "https://cloud.google.com/functions/docs", "https://azure.microsoft.com/en-us/services/functions/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/deployment/service-deployment-platform.html", "titulek": "Pattern: Service deployment platform", "h1": "Pattern: Service deployment platform", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Service deployment platform", "og:url": "http://microservices.io/patterns/deployment/service-deployment-platform.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/deployment/service-deployment-platform.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Service deployment platform", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Service deployment platform"}, "url": "http://microservices.io/patterns/deployment/service-deployment-platform.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Service deployment platform"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Service deployment platform\n\n[pattern](/tags/pattern) [deployment](/tags/deployment)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](/patterns/microservices.html) and architected your system as a set of services.\nEach service is deployed as a set of service instances for throughput and availability.\n\n## Problem\n\nHow are services packaged and deployed?\n\n## Forces\n\n- Services are written using a variety of languages, frameworks, and framework versions\n- Each service consists of multiple service instances for throughput and availability\n- Service must be independently deployable and scalable\n- Service instances need to be isolated from one another\n- You need to be able to quickly build and deploy a service\n- You need to be able to constrain the resources (CPU and memory) consumed by a service\n- You need to monitor the behavior of each service instance\n- You want deployment to reliable\n- You must deploy the application as cost-effectively as possible\n\n## Solution\n\nUse a deployment platform, which is automated infrastructure for application deployment.\nIt provides a service abstraction, which is a named, set of highly available (e.g. load balanced) service instances.\n\n## Examples\n\n- Docker orchestration frameworks including [Docker swarm mode](https://docs.docker.com/engine/swarm/) and [Kubernetes](http://kubernetes.io/)\n- [Serverless platforms](serverless-deployment.html) such as AWS Lambda\n- PaaS including [Cloud Foundry](https://www.cloudfoundry.org/) and [AWS Elastic Beanstalk](https://aws.amazon.com/elasticbeanstalk/)\n\n- Some deployment platforms provide a [Service Registry](../service-registry.html) and [Server-Side discovery](../server-side-discovery.html)\n- Internally, a deployment platform might use use [containers](../deployment/service-per-container.html) or [virtual machines](../deployment/service-per-vm.html) to deploy a service.\nDocker orchestration frameworks are, of course, explicitly [container-based](../deployment/service-per-container.html)\n\n---\n\n[pattern](/tags/pattern) [deployment](/tags/deployment)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 5312, "slov": 625, "odkazu": 38, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:17", "sha256": "3e82b41c68191b89d52787758f707ca81691d3b3ef2eb7885b6a9c3cc7cc35c1", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://docs.docker.com/engine/swarm/", "http://kubernetes.io/", "https://www.cloudfoundry.org/", "https://aws.amazon.com/elasticbeanstalk/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/deployment/service-mesh.html", "titulek": "Pattern: Service mesh", "h1": "Pattern: Service mesh", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Service mesh", "og:url": "http://microservices.io/patterns/deployment/service-mesh.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/deployment/service-mesh.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Service mesh", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Service mesh"}, "url": "http://microservices.io/patterns/deployment/service-mesh.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Service mesh"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Service mesh\n\n[pattern](/tags/pattern) [deployment](/tags/deployment)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](/patterns/microservices.html) and architected your system as a set of services.\n\n## Problem\n\nYou must implement numerous cross-cutting concerns including:\n\n- Externalized configuration - includes credentials, and network locations of external services such as databases and message brokers\n- Logging - configuring of a logging framework such as log4j or logback\n- Health checks - a url that a monitoring service can “ping” to determine the health of the application\n- Metrics - measurements that provide insight into what the application is doing and how it is performing\n- [Distributed tracing](observability/distributed-tracing.html) - instrument services with code that assigns each external request an unique identifier that is passed between services.\n\n## Forces\n\n## Solution\n\nUse a service mesh that mediates all communication in and out of each service.\n\n## Examples\n\n## Resulting context\n\n- The [Microservice chassis pattern](/patterns/multiple-services-per-host.html) is a way to implement some cross-cutting concerns.\n- A service mesh is often implemented using the [Sidecar pattern](sidecar.html) .\n\n---\n\n[pattern](/tags/pattern) [deployment](/tags/deployment)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4546, "slov": 546, "odkazu": 32, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:21", "sha256": "b6e3a5b7fc0df6f9acdcdcf1a7c2ee9ce151ee5c4a0cf561821545403a6460ca", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/deployment/service-per-container.html", "titulek": "Pattern: Service instance per container", "h1": "Pattern: Service instance per container", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Service instance per container", "og:url": "http://microservices.io/patterns/deployment/service-per-container.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/deployment/service-per-container.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Service instance per container", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Service instance per container"}, "url": "http://microservices.io/patterns/deployment/service-per-container.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Service instance per container"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Service instance per container\n\n[pattern](/tags/pattern) [deployment](/tags/deployment) [docker](/tags/docker)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](/patterns/microservices.html) and architected your system as a set of services.\nEach service is deployed as a set of service instances for throughput and availability.\n\n## Problem\n\nHow are services packaged and deployed?\n\n## Forces\n\n- Services are written using a variety of languages, frameworks, and framework versions\n- Each service consists of multiple service instances for throughput and availability\n- Service must be independently deployable and scalable\n- Service instances need to be isolated from one another\n- You need to be able to quickly build and deploy a service\n- You need to be able to constrain the resources (CPU and memory) consumed by a service\n- You need to monitor the behavior of each service instance\n- You want deployment to reliable\n- You must deploy the application as cost-effectively as possible\n\n## Solution\n\nPackage the service as a (Docker) container image and deploy each service instance as a container\n\n## Examples\n\nDocker is becoming an extremely popular way of packaging and deploying services.\nEach service is packaged as a Docker image and each service instance is a Docker container.\nThere are several Docker clustering frameworks including:\n\n- [Kubernetes](http://kubernetes.io/)\n- [Marathon/Mesos](https://mesosphere.github.io/marathon/)\n- [Amazon EC2 Container Service](http://aws.amazon.com/ecs/)\n\n## Resulting context\n\nThe benefits of this approach include:\n\n- It is straightforward to scale up and down a service by changing the number of container instances.\n- The container encapsulates the details of the technology used to build the service. All services are, for example, started and stopped in exactly the same way.\n- Each service instance is isolated\n- A container imposes limits on the CPU and memory consumed by a service instance\n- Containers are extremely fast to build and start.\nFor example, it’s 100x faster to package an application as a Docker container than it is to package it as an AMI.\nDocker containers also start much faster than a VM since only the application process starts rather than an entire OS.\n\nThe drawbacks of this approach include:\n\n- The infrastructure for deploying containers is not as rich as the infrastructure for deploying virtual machines.\n\n- This pattern is a refinement of the [Service Instance per Host pattern](single-service-per-host.html)\n- The [Service Instance per VM pattern](service-per-vm.html) is an alternative solution\n- The [Serverless deployment pattern](serverless-deployment.html) is an alternative solution.\n\n---\n\n[pattern](/tags/pattern) [deployment](/tags/deployment) [docker](/tags/docker)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 6008, "slov": 766, "odkazu": 36, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:22", "sha256": "9136530b64a8420fca0f1406d9ccc473edc9c0f714122d4d7e5fff688dbbca1f", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "http://kubernetes.io/", "https://mesosphere.github.io/marathon/", "http://aws.amazon.com/ecs/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/deployment/service-per-vm.html", "titulek": "Pattern: Service Instance per VM", "h1": "Pattern: Service Instance per VM", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Service Instance per VM", "og:url": "http://microservices.io/patterns/deployment/service-per-vm.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/deployment/service-per-vm.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Service Instance per VM", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Service Instance per VM"}, "url": "http://microservices.io/patterns/deployment/service-per-vm.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Service Instance per VM"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Service Instance per VM\n\n[pattern](/tags/pattern) [deployment](/tags/deployment)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](/patterns/microservices.html) and architected your system as a set of services.\nEach service is deployed as a set of service instances for throughput and availability.\n\n## Problem\n\nHow are services packaged and deployed?\n\n## Forces\n\n- Services are written using a variety of languages, frameworks, and framework versions\n- Each service consists of multiple service instances for throughput and availability\n- Service must be independently deployable and scalable\n- Service instances need to be isolated from one another\n- You need to be able to quickly build and deploy a service\n- You need to be able to constrain the resources (CPU and memory) consumed by a service\n- You need to monitor the behavior of each service instance\n- You want deployment to reliable\n- You must deploy the application as cost-effectively as possible\n\n## Solution\n\nPackage the service as a virtual machine image and deploy each service instance as a separate VM\n\n## Examples\n\n- Netflix packages each service as an EC2 AMI and deploys each service instance as a EC2 instance.\n\n## Resulting context\n\nThe benefits of this approach include:\n\n- Its straightforward to scale the service by increasing the number of instances. Amazon Autoscaling Groups can even do this automatically based on load.\n- The VM encapsulates the details of the technology used to build the service. All services are, for example, started and stopped in exactly the same way.\n- Each service instance is isolated\n- A VM imposes limits on the CPU and memory consumed by a service instance\n- IaaS solutions such as AWS provide a mature and feature rich infrastructure for deploying and managing virtual machines. For example,\n - Elastic Load Balancer -\n - Autoscaling groups\n - …\n\nThe drawbacks of this approach include:\n\n- Building a VM image is slow and time consuming\n\n- This pattern is a refinement of the [Single Service per Host pattern](single-service-per-host.html)\n- The [Service Instance per Container pattern](service-per-container.html) is an alternative solution\n- The [Serverless deployment pattern](/patterns/deployment/serverless-deployment.html) is an alternative solution.\n\n---\n\n[pattern](/tags/pattern) [deployment](/tags/deployment)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 5569, "slov": 716, "odkazu": 32, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:25", "sha256": "e18ac8f4de4dd094807fec8d0052ac030d5fe03b210a953cac417882b5e64c88", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/deployment/sidecar.html", "titulek": "Pattern: Sidecar", "h1": "Pattern: Sidecar", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Sidecar", "og:url": "http://microservices.io/patterns/deployment/sidecar.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/deployment/sidecar.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Sidecar", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Sidecar"}, "url": "http://microservices.io/patterns/deployment/sidecar.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Sidecar"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Sidecar\n\n[pattern](/tags/pattern) [deployment](/tags/deployment)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](/patterns/microservices.html) and architected your system as a set of services.\n\n## Problem\n\n## Forces\n\n## Solution\n\nImplement cross-cutting concerns in a sidecar process or container that runs alongside the service instance.\n\n## Examples\n\n## Resulting context\n\n---\n\n[pattern](/tags/pattern) [deployment](/tags/deployment)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 3712, "slov": 432, "odkazu": 29, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:32", "sha256": "4e91e61300a80c1f4294cdfd3b0bcf2973af6fbf053b46313fee82e538f76686", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/deployment/single-service-per-host.html", "titulek": "Pattern: Single Service Instance per Host", "h1": "Pattern: Single Service Instance per Host", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Single Service Instance per Host", "og:url": "http://microservices.io/patterns/deployment/single-service-per-host.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/deployment/single-service-per-host.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Single Service Instance per Host", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Single Service Instance per Host"}, "url": "http://microservices.io/patterns/deployment/single-service-per-host.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Single Service Instance per Host"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Single Service Instance per Host\n\n[pattern](/tags/pattern) [deployment](/tags/deployment)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](/patterns/microservices.html) and architected your system as a set of services.\nEach service is deployed as a set of service instances for throughput and availability.\n\n## Problem\n\nHow are services packaged and deployed?\n\n## Forces\n\n- Services are written using a variety of languages, frameworks, and framework versions\n- Each service consists of multiple service instances for throughput and availability\n- Service must be independently deployable and scalable\n- Service instances need to be isolated from one another\n- You need to be able to quickly build and deploy a service\n- You need to be able to constrain the resources (CPU and memory) consumed by a service\n- You need to monitor the behavior of each service instance\n- You want deployment to reliable\n- You must deploy the application as cost-effectively as possible\n\n## Solution\n\nDeploy each single service instance on its own host\n\n## Examples\n\n## Resulting context\n\nThe benefits of this approach include:\n\n- Services instances are isolated from one another\n- There is no possibility of conflicting resource requirements or dependency versions\n- A service instance can only consume at most the resources of a single host\n- Its straightforward to monitor, manage, and redeploy each service instance\n\nThe drawbacks of this approach include:\n\n- Potentially less efficient resource utilization compared to [Multiple Services per Host](multiple-services-per-host.html) because there are more hosts\n\n- The [Multiple Service Instances per Host pattern](multiple-services-per-host.html) is an alternative solution\n- The [Service Instance per VM pattern](service-per-vm.html) is a refinement of this pattern\n- The [Service Instance per Container pattern](service-per-container.html) is a refinement of this pattern\n- The [Serverless deployment pattern](/patterns/deployment/serverless-deployment.html) is an alternative solution.\n\n---\n\n[pattern](/tags/pattern) [deployment](/tags/deployment)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 5335, "slov": 665, "odkazu": 33, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:33", "sha256": "865b93b6210cd8fbbf8b9b1b629c6b7abf8839272530fec8d0b627ff41791945", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/externalized-configuration.html", "titulek": "Pattern: Externalized configuration", "h1": "Pattern: Externalized configuration", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Externalized configuration", "og:url": "http://microservices.io/patterns/externalized-configuration.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/externalized-configuration.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Externalized configuration", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Externalized configuration"}, "url": "http://microservices.io/patterns/externalized-configuration.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Externalized configuration"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting Context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Externalized configuration\n\n[pattern](/tags/pattern) [service design](/tags/service design)\n\n---\n\n## Context\n\nAn application typically uses one or more infrastructure and 3rd party services.\nExamples of infrastructure services include: a [Service registry](service-registry.html), a message broker and a database server.\nExamples of 3rd party services include: payment processing, email and messaging, etc.\n\n## Problem\n\nHow to enable a service to run in multiple environments without modification?\n\n## Forces\n\n- A service must be provided with configuration data that tells it how to connect to the external/3rd party services. For example, the database network location and credentials\n- A service must run in multiple environments - dev, test, qa, staging, production - without modification and/or recompilation\n- Different environments have different instances of the external/3rd party services, e.g. QA database vs. production database, test credit card processing account vs. production credit card processing account\n\n## Solution\n\nExternalize all application configuration including the database credentials and network location.\nOn startup, a service reads the configuration from an external source, e.g. OS environment variables, etc.\n\n## Examples\n\n[Spring Boot externalized configuration](https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html) reads values from a variety of sources including operating system environment variables, property files and command line arguments.\nThese values are available within the Spring application context.\n\n`RegistrationServiceProxy` from the [Microservices Example application](https://github.com/cer/microservices-examples) is an example of a component, which is written in Scala, is configured with the variable `user_registration_url`:\n\n```\n @Component class RegistrationServiceProxy @Autowired()(restTemplate: RestTemplate) extends RegistrationService { @Value(\"${user_registration_url}\") var userRegistrationUrl: String = _ \n```\n\nThe `docker-compose.yml` file supplies its value as an operating system environment variable:\n\n```\nweb: image: sb_web ports: - \"8080:8080\" links: - eureka environment: USER_REGISTRATION_URL: http://REGISTRATION-SERVICE/user \n```\n\n`REGISTRATION-SERVICE` is the logical name of the service.\nIt is resolved using [Client-side discovery](client-side-discovery.html).\n\n## Resulting Context\n\nThis pattern has the following benefits:\n\n- The application runs in multiple environments without modification and/or recompilation\n\nThere are the following issues with this pattern:\n\n- How to ensure that when an application is deployed the supplied configuration matches what is expected?\n\n- The service discovery patterns, [Server-side service discovery](server-side-discovery.html) and [Client-side service discovery](client-side-discovery.html) , solve the related problem of how a service knows the network location of other application services\n\n---\n\n[pattern](/tags/pattern) [service design](/tags/service design)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 6242, "slov": 744, "odkazu": 33, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:45", "sha256": "898c287c6529db884ac6936e2cd4bb0b18a710366bda02b4c42253d4498a51e7", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html", "https://github.com/cer/microservices-examples", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/index.html", "titulek": "A pattern language for microservices", "h1": "A pattern language for microservices", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: A pattern language for microservices", "og:url": "http://microservices.io/patterns/"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "A pattern language for microservices", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: A pattern language for microservices"}, "url": "http://microservices.io/patterns/"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "A pattern language for microservices"}, {"uroven": 2, "text": "Architectural style"}, {"uroven": 2, "text": "Service boundaries"}, {"uroven": 2, "text": "Refactoring to services"}, {"uroven": 2, "text": "Service collaboration"}, {"uroven": 2, "text": "Transactional messaging"}, {"uroven": 2, "text": "Testing"}, {"uroven": 2, "text": "Deployment"}, {"uroven": 2, "text": "Cross-cutting concerns"}, {"uroven": 2, "text": "Communication styles"}, {"uroven": 2, "text": "External API"}, {"uroven": 2, "text": "Service discovery"}, {"uroven": 2, "text": "Reliability"}, {"uroven": 2, "text": "Security"}, {"uroven": 2, "text": "Observability"}, {"uroven": 2, "text": "UI design"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# A pattern language for microservices\n\n[pattern](/tags/pattern)\n\n---\n\nThe beginnings of a [pattern language](http://en.wikipedia.org/wiki/Pattern_language) for microservice architectures.\n\n[点击这里,访问本系列文章的中文翻译](cn/index.html)\n\n[Click here for Chinese translation of the patterns](cn/index.html)\n\n[Click here for PDF](../i/MicroservicePatternLanguage.pdf)\n\n## Architectural style\n\nWhich architectural style should you choose for an application?\n\n- [Monolithic architecture](monolithic.html) - architect an application as a single deployable unit\n- [Microservice architecture](microservices.html) - architect an application as a collection of independently deployable, loosely coupled services\n\n## Service boundaries\n\nHow to decompose an application into services?\n\n- [Decompose by business capability](decomposition/decompose-by-business-capability.html) - define services corresponding to business capabilities\n- [Decompose by subdomain](decomposition/decompose-by-subdomain.html) - define services corresponding to DDD subdomains\n- [Self-contained Service](decomposition/self-contained-service.html) - design services to handle synchronous requests without waiting for other services to respond new\n- [Service per team](/patterns/decomposition/service-per-team.html) new\n\n## Refactoring to services\n\n- [Strangler Application](/patterns/refactoring/strangler-application.html)\n- [Anti-corruption layer](/patterns/refactoring/anti-corruption-layer.html)\n\n## Service collaboration\n\nHow to implement operations that span multiple services?\n\n- [Database per Service](data/database-per-service.html) - each service has its own private database\n- [Shared database](data/shared-database.html) - services share a database\n- [Saga](data/saga.html) - use sagas, which a sequences of local transactions, to maintain data consistency across services\n- [Command-side replica](data/command-side-replica.html) - maintain a queryable replica of data in a service that implements a command\n- [API Composition](data/api-composition.html) - implement queries by invoking the services that own the data and performing an in-memory join\n- [CQRS](data/cqrs.html) - implement queries by maintaining one or more materialized views that can be efficiently queried\n- [Domain event](/patterns/data/domain-event.html) - publish an event whenever data changes\n- [Event sourcing](data/event-sourcing.html) - persist aggregates as a sequence of events\n\n## Transactional messaging\n\nHow to send messages as part of a database transaction?\n\n- [Transactional outbox](data/transactional-outbox.html)\n- [Transaction log tailing](data/transaction-log-tailing.html)\n- [Polling publisher](data/polling-publisher.html)\n\n## Testing\n\nHow to test services?\n\n- [Consumer-driven contract test](testing/service-integration-contract-test.html) - a test suite for a service that is written by the developers of another service that consumes it\n- [Consumer-side contract test](testing/service-integration-contract-test.html) - a test suite for a service client (e.g. another service) that verifies that it can communicate with the service\n- [Service component sest](testing/service-component-test.html) - a test suite that tests a service in isolation using test doubles for any services that it invokes\n\n## Deployment\n\nHow to deploy an application’s services?\n\n- [Multiple service instances per host](deployment/multiple-services-per-host.html) - deploy multiple service instances on a single host\n- [Service instance per host](deployment/single-service-per-host.html) - deploy each service instance in its own host\n- [Service instance per VM](deployment/service-per-vm.html) - deploy each service instance in its VM\n- [Service instance per Container](deployment/service-per-container.html) - deploy each service instance in its container\n- [Serverless deployment](/patterns/deployment/serverless-deployment.html) - deploy a service using serverless deployment platform\n- [Service deployment platform](/patterns/deployment/service-deployment-platform.html) - deploy services using a highly automated deployment platform that provides a service abstraction\n\n## Cross-cutting concerns\n\nHow to handle cross cutting concerns?\n\n- [Microservice chassis](/patterns/microservice-chassis.html) - a framework that handles cross-cutting concerns and simplifies the development of services\n- [Externalized configuration](/patterns/externalized-configuration.html) - externalize all configuration such as database location and credentials\n- [Service Template](/patterns/service-template.html) - a template that implements standard cross cutting concerns and is intended to be copied by a developer in order to quickly start developing a new service\n\n## Communication styles\n\nWhich mechanisms do services use to communicate with each other and their external clients?\n\n- [Remote Procedure Invocation](communication-style/rpi.html) - use an RPI-based protocol for inter-service communication\n- [Messaging](communication-style/messaging.html) - use asynchronous messaging for inter-service communication\n- [Domain-specific protocol](communication-style/domain-specific.html) - use a domain-specific protocol\n- [Idempotent Consumer](/patterns/communication-style/idempotent-consumer.html) - ensure that message consumers can cope with being invoked multiple times with the same message\n\n## External API\n\nHow do external clients communicate with the services?\n\n- [API gateway](apigateway.html) - a service that provides each client with unified interface to services\n- [Backend for front-end](apigateway.html) - a separate API gateway for each kind of client\n\n## Service discovery\n\nHow does the client of an RPI-based service discover the network location of a service instance?\n\n- [Client-side discovery](client-side-discovery.html) - client queries a service registry to discover the locations of service instances\n- [Server-side discovery](server-side-discovery.html) - router queries a service registry to discover the locations of service instances\n- [Service registry](service-registry.html) - a database of service instance locations\n- [Self registration](self-registration.html) - service instance registers itself with the service registry\n- [3rd party registration](3rd-party-registration.html) - a 3rd party registers a service instance with the service registry\n\n## Reliability\n\nHow to prevent a network or service failure from cascading to other services?\n\n- [Circuit Breaker](reliability/circuit-breaker.html) - invoke a remote service via a proxy that fails immediately when the failure rate of the remote call exceeds a threshold\n\n## Security\n\nHow to communicate the identity of the requestor to the services that handle the request?\n\n- [Access Token](security/access-token.html) - a token that securely stores information about user that is exchanged between services\n\n## Observability\n\nHow to understand the behavior of an application and troubleshoot problems?\n\n- [Log aggregation](observability/application-logging.html) - aggregate application logs\n- [Application metrics](observability/application-metrics.html) - instrument a service’s code to gather statistics about operations\n- [Audit logging](observability/audit-logging.html) - record user activity in a database\n- [Distributed tracing](observability/distributed-tracing.html) - instrument services with code that assigns each external request an unique identifier that is passed between services.\nRecord information (e.g. start time, end time) about the work (e.g. service requests) performed when handling the external request in a centralized service\n- [Exception tracking](observability/exception-tracking.html) - report all exceptions to a centralized exception tracking service that aggregates and tracks exceptions and notifies developers.\n- [Health check API](observability/health-check-api.html) - service API (e.g. HTTP endpoint) that returns the health of the service and is intended to be pinged, for example, by a monitoring service\n- [Log deployments and changes](/patterns/observability/log-deployments-and-changes.html)\n\n## UI design\n\nHow to implement a UI screen or page that displays data from multiple services?\n\n- [Server-side page fragment composition](ui/server-side-page-fragment-composition.html) - build a webpage on the server by composing HTML fragments generated by multiple, business capability/subdomain-specific web applications\n- [Client-side UI composition](ui/client-side-ui-composition.html) - Build a UI on the client by composing UI fragments rendered by multiple, business capability/subdomain-specific UI components\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 11631, "slov": 1363, "odkazu": 81, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:35", "sha256": "e627c155f35b94b27b44e81d693c359b2fd5d129d56cd3b02f4d3db3f0c74491", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "http://en.wikipedia.org/wiki/Pattern_language", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/microservice-chassis.html", "titulek": "Pattern: Microservice chassis", "h1": "Pattern: Microservice chassis", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Microservice chassis", "og:url": "http://microservices.io/patterns/microservice-chassis.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/microservice-chassis.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Microservice chassis", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Microservice chassis"}, "url": "http://microservices.io/patterns/microservice-chassis.html"}], "drobecky": [], "osnova": [{"uroven": 1, "text": "Pattern: Microservice chassis"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Want to learn more about this pattern?"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "See also"}, {"uroven": 2, "text": "Learn more"}], "markdown": "# Pattern: Microservice chassis\n\n[pattern](/tags/pattern) [service design](/tags/service design) [microservice chassis](/tags/microservice chassis)\n\n---\n\n## Context\n\n## Want to learn more about this pattern?\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\nWhen you start the development of an application you often spend a significant amount of time writing the build logic and putting in place the mechanisms to handle cross-cutting concerns.\nThe build logic builds, and tests the application and also packages into a production-ready format, such as a Docker container image.\nFor example, the majority of the build logic for a Java application is implemented using Gradle or Maven.\nIt might also consist of configuration scripts for build automation tool, such as CircleCI or Github Actions.\nOn the surface, the build logic appears to be quite simple.\nHowever, even defining a carefully curated set of dependencies can be remarkably challenging.\n\nIn addition to the build logic, you need to handle cross cutting concerns.\nExamples of cross-cutting concerns include:\n\n- Security - for example, REST APIs must be secured by requiring an [Access Token](/security/access-token.html)\n- [Externalized configuration](/patterns/externalized-configuration.html) - includes credentials, and network locations of external services such as databases and message brokers\n- [Logging](/patterns/observability/application-logging.html) - configuring of a logging framework such as log4j or logback\n- [Health check](/patterns/observability/health-check-api.html) - a url that a monitoring service can “ping” to determine the health of the application\n- [Metrics](/patterns/observability/application-metrics.html) - measurements that provide insight into what the application is doing and how it is performing\n- [Distributed tracing](/patterns/observability/distributed-tracing.html) - instrument services with code that assigns each external request an unique identifier that is passed between services.\n\nAs well as these generic cross-cutting concerns, there are also cross-cutting concerns that are specific to the technologies that an application uses.\nApplications that use infrastructure services such as databases or a message brokers require boilerplate configuration in order to do that.\nFor example, applications that use a relational database must be configured with a connection pool.\nWeb applications that process HTTP requests also need boilerplate configuration.\n\nIt is common to spend one or two days, sometimes even longer, writing the build logic and implementing cross-cutting concerns.\nIf you going to spend months or years developing a monolithic application then the upfront investment is insignificant.\nThe situation is very different, however, if you are developing an application that has the [microservice architecture](microservices.html).\nThere are tens or hundreds of services.\nYou will frequently create new services, each of which will only take days or weeks to develop.\nYou cannot afford to spend a few days setting up every service.\nWhat is even worse is that in a microservice architecture there are additional cross-cutting concerns that you have to deal with including service registration and discovery, and circuit breakers for reliably handling partial failure.\n\nOne solution is to create a [Service Template](service-template.html), which is a source code template that a developer can copy in order to quickly start developing a new service.\nThe drawback, however, of a Service Template is that it’s a form of copy/paste programming: when the build logic and cross-cutting concerns logic needs to change, each service must be updated individually.\n\n## Problem\n\nHow can a team quickly create and setup a maintainable code base for a production-ready service so they can start developing its business logic?\n\n## Forces\n\n- A service must implement\n - Build logic that builds, and tests the application and also packages into a production-ready format, such as a Docker container image.\n - Cross-cutting concerns such as externalized configuration, logging, health checks, metrics, service registration and discovery, circuit breakers. There are also cross-cutting concerns that are specific to the technologies that the microservices uses.\n- Creating a new microservice should be fast and easy\n- It should be fast and straightforward to update existing services when the requirements for build logic and cross-cutting concerns change.\n\nCreate a microservice chassis framework that can be foundation for developing your microservices.\nThe chassis implements\n\n- Reusable build logic that builds, and tests a service. This includes, for example, Gradle Plugins.\n- Mechanisms that handle cross-cutting concerns. The chassis typically assembles and configures a collection of frameworks and libraries that implement this functionality.\n\nThe [Service Template](service-template.html) is a sample service that uses the microservice chassis.\n\nExamples of frameworks that are the starting point for creating a microservice chassis:\n\n- Java\n - [Spring Boot](http://projects.spring.io/spring-boot/) and [Spring Cloud](http://cloud.spring.io/)\n - [Dropwizard](https://dropwizard.github.io/)\n- Go\n - [Gizmo](http://open.blogs.nytimes.com/2015/12/17/introducing-gizmo/?_r=2)\n - [Micro](https://github.com/micro)\n - [Go kit](https://github.com/go-kit/kit)\n\n## Resulting context\n\nThe main benefit of a microservice chassis is that it’s faster and easier to keep the dependencies, build logic and cross-cutting concern logic up to date.\nYou simply release a new version of the microservice chassis framework that contains the needed changes, and update each service to the use new version.\n\nOne issue is that you need a microservice chassis for each programming language/framework that you want to use.\nThis can be an obstacle to adopting a new programming language or framework.\n\nThere are the following related patterns:\n\n- [Service Template](service-template.html) - a template for a service that developers can copy to create a new application. It’s either an alternative to the Microservice Chassis pattern; or it uses a Microservice Chassis and simply contains the code and configuration that doesn’t belong in the chassis\n- [Microservices](microservices.html) - this pattern motivates the need for the Microservice Chassis pattern\n- [Self Registration](self-registration.html) - the microservice chassis is often responsible for registering the service with the service registry\n- [Client-side discovery](client-side-discovery.html) - the microservice chassis is often responsible for client-side service discovery\n- [Circuit Breaker](reliability/circuit-breaker.html) - the microservice chassis framework might implement this pattern\n- [Distributed tracing](observability/distributed-tracing.html) - the microservice chassis framework might instrument the code\n- [Service Template](service-template.html) often uses a Microservice Chassis\n\n## See also\n\n- This excellent [Service Template blog post](https://blog.thepete.net/blog/2020/09/25/service-templates-service-chassis/) by [@ph1](https://twitter.com/ph1)\n\n## Learn more\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.", "znaku_textu": 7362, "slov": 987, "odkazu": 49, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:55", "sha256": "b53a0d91b0ab83db580a4dbb0a99ceba1c5eedbb7948cf62dbbfdba5956e6ed2", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "http://projects.spring.io/spring-boot/", "http://cloud.spring.io/", "https://dropwizard.github.io/", "http://open.blogs.nytimes.com/2015/12/17/introducing-gizmo/?_r=2", "https://github.com/micro", "https://github.com/go-kit/kit", "https://blog.thepete.net/blog/2020/09/25/service-templates-service-chassis/", "https://twitter.com/ph1", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/microservices.html", "titulek": "Microservice Architecture pattern", "h1": "Microservice Architecture pattern", "popis": "The microservice architecture structures an application as a set of loosely coupled, deployable/executable components organized around business capabilities", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Microservice Architecture pattern", "og:image": "http://microservices.io/i/Microservice_Architecture.png", "og:url": "http://microservices.io/patterns/microservices.html", "og:description": "The microservice architecture structures an application as a set of loosely coupled, deployable/executable components organized around business capabilities"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/microservices.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Microservice Architecture pattern", "description": "A pattern language for microservices", "primaryImageOfPage": {"@type": "ImageObject", "contentUrl": "http://microservices.io/i/Microservice_Architecture.png", "representativeOfPage": "True"}, "mainEntity": {"@type": "Intangible", "name": "Pattern: Microservice Architecture pattern", "description": "The microservice architecture structures an application as a set of loosely coupled, deployable/executable components organized around business capabilities", "image": {"@type": "ImageObject", "name": "The microservice architecture", "width": "735", "height": "428", "url": "http://microservices.io/i/Microservice_Architecture.png"}}, "url": "http://microservices.io/patterns/microservices.html"}, {"@context": "http://schema.org", "@type": "Question", "name": "What are microservices?", "acceptedAnswer": {"@type": "Answer", "text": "The microservice architecture structures an application as a set of loosely coupled, deployable/executable components organized around business capabilities"}}], "drobecky": [], "osnova": [{"uroven": 1, "text": "Microservice Architecture pattern"}, {"uroven": 1, "text": "Pattern: Microservice Architecture"}, {"uroven": 2, "text": "Want to learn how to design a microservice architecture?"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 3, "text": "Fictitious e-commerce application"}, {"uroven": 3, "text": "Show me the code"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 3, "text": "Benefits"}, {"uroven": 3, "text": "Drawbacks"}, {"uroven": 3, "text": "Issues"}, {"uroven": 4, "text": "Designing a good (monolithic or microservice) architecture with Assemblage"}, {"uroven": 4, "text": "Designing distributed operations"}, {"uroven": 2, "text": "Known uses"}, {"uroven": 1, "text": "Examples"}, {"uroven": 1, "text": "See also"}], "markdown": "# Microservice Architecture pattern\n\n[pattern](/tags/pattern) [application architecture](/tags/application architecture) [microservice architecture](/tags/microservice architecture)\n\n---\n\n# Pattern: Microservice Architecture\n\n## Want to learn how to design a microservice architecture?\n\nTake a look at [Assemblage, a microservice architecture definition process](/post/architecture/2023/02/09/assemblage-architecture-definition-process.html).\n\nIn my workshop, you will learn about to use Assemblage to design a microsevice architecture for your application.\n\nUpcoming public workshop: [Designing Microservices: Responsibilities, APIs and Collaborations](https://exploreddd.com/workshops/designing-microservices.html) at Explore DDD 2026.\n\n## Context\n\nYou are developing a business-critical enterprise application.\nYou need to deliver changes rapidly, frequently and reliably - as measured by the [DORA metrics](/articles/glossary#dora-metrics) - in order for your business to thrive in today’s volatile, uncertain, complex and ambiguous world.\nConsequently, your engineering organization is organized into small, loosely coupled, cross-functional teams as described by [Team Topologies](/tags/team%20topologies).\nEach team delivers software using DevOps practices as defined by the [DevOps handbook](/tags/devops).\nIn particular, it practices continuous deployment.\nThe team delivers a stream of small, frequent changes that are tested by an automated deployment pipeline and deployed into production.\n\nA team is responsible for one or more subdomains.\nA subdomain is an implementable model of a slice of business functionality, a.k.a. business capability.\nIt consists of business logic, which consists of business entities (a.k.a. DDD aggregates) that implement business rules, and adapters, which communicate with the outside world.\nA Java-based subdomain, for example, consists of classes organized into packages that’s compiled into a JAR file.\n\nThe subdomains implement the application’s behavior, which consists of a set of (system) operations.\nAn operation is invoked in one of three ways: synchronous and asynchronous requests from clients; events published by other applications and services; and the passing of time.\nIt mutates and queries business entities in one or more subdomains.\n\n## Problem\n\nHow to organize the subdomains into one or more deployable/executable components?\n\n## Forces\n\nThere are five [dark energy forces](/post/microservices/2021/11/30/dark-matter-dark-energy.html):\n\n- [Simple components](/articles/dark-energy-dark-matter/dark-energy/simple-components.html) - simple components consisting of few subdomains are easier to understand and maintain than complex components\n- [Team autonomy](/articles/dark-energy-dark-matter/dark-energy/team-autonomy.html) - a team needs to be able to develop, test and deploy their software independently of other teams\n- [Fast deployment pipeline](/articles/dark-energy-dark-matter/dark-energy/fast-deployment-pipeline.html) - fast feedback and high deployment frequency are essential and are enabled by a fast deployment pipeline, which in turn requires components that are fast to build and test.\n- [Support multiple technology stacks](/articles/dark-energy-dark-matter/dark-energy/multiple-technology-stacks.html) - subdomains are sometimes implemented using a variety of technologies; and developers need to evolve the application’s technology stack, e.g. use current versions of languages and frameworks\n- [Segregate by characteristics](/articles/dark-energy-dark-matter/dark-energy/segregate-by-characteristics.html) - e.g. resource requirements to improve scalability, their availability requirements to improve availability, their security requirements to improve security, etc.\n\nThere are five [dark matter forces](/post/microservices/2021/11/30/dark-matter-dark-energy.html):\n\n- [Simple interactions](/articles/dark-energy-dark-matter/dark-matter/simple-interactions.html) - an operation that’s local to a component or consists of a few simple interactions between components is easier to understand and troubleshoot than a distributed operation, especially one consisting of complex interactions\n- [Efficient interactions](/articles/dark-energy-dark-matter/dark-matter/efficient-interactions.html) - a distributed operation that involves lots of network round trips and large data transfers can be too inefficient\n- [Prefer ACID over BASE](/articles/dark-energy-dark-matter/dark-matter/prefer-acid-over-base.html) - it’s easier to implement an operation as an ACID transaction rather than, for example, eventually consistent sagas\n- [Minimize runtime coupling](/articles/dark-energy-dark-matter/dark-matter/minimize-runtime-coupling.html) - to maximize the availability and reduce the latency of an operation\n- [Minimize design time coupling](/articles/dark-energy-dark-matter/dark-matter/minimize-design-time-coupling.html) - reduce the likelihood of changing services in lockstep, which reduces productivity\n\n## Solution\n\nDesign an architecture that structures the application as a set of two or more [independently deployable](/post/architecture/2022/05/04/microservice-architecture-essentials-deployability.html), [loosely coupled](/post/architecture/2023/03/28/microservice-architecture-essentials-loose-coupling.html), [components, a.k.a. services](/post/microservices/general/2019/02/16/whats-a-service-part-1.html).\nEach service consists of one or more subdomains.\nEach subdomain is part of a single service except for shared library subdomains that are used by multiple services.\nA service is owned by the team (or teams) that owns the (non-library) subdomains.\n\nAn [API gateway](/patterns/apigateway.html) is typically the application’s entry point.\nSome system operations will be local to a single service, while others will be distributed across multiple services.\nA distributed system operation is implemented using the [service collaboration patterns](/post/patterns/2023/07/29/service-collaboration-patterns.html).\n\nIn order to be independently deployable each service typically has its own source code repository and its own deployment pipeline, which builds, tests and deploys the service.\n\n## Examples\n\n### Fictitious e-commerce application\n\nLet’s imagine that you are building an e-commerce application that takes orders from customers, verifies inventory and available credit, and ships them.\nThe application consists of several components including the StoreFrontUI, which implements the user interface, along with some backend services for checking credit,\nmaintaining inventory and shipping orders.\nThe application consists of a set of services.\n\n### Show me the code\n\nPlease see the [example applications developed by Chris Richardson](http://eventuate.io/exampleapps.html).\nThese examples on Github illustrate various aspects of the microservice architecture.\n\n## Resulting context\n\n### Benefits\n\nThis solution has a number of benefits:\n\n- Simple services - each service consists of a small number of subdomains - possibly just one - and so is easier to understand and maintain\n- Team autonomy - a team can develop, test and deploy their service independently of other teams\n- Fast deployment pipeline - each service is fast to test since it’s relatively small, and can be deployed independently\n- Support multiple technology stacks - different services can use different technology stacks and can be upgraded independently\n- Segregate subdomains by their characteristics - subdomains can be segregated by their characteristics into separate services in order to improve scalability, availability, security etc\n\n### Drawbacks\n\nThis solution has a number of (**potential**) drawbacks:\n\n- Some distributed operations might be complex, and difficult to understand and troubleshoot\n- Some distributed operations might be potentially inefficient\n- Some operations might need to be implemented using complex, eventually consistent (non-ACID) transaction management since loose coupling requires each [service to have its own database](/patterns/data/database-per-service.html) .\n- Some distributed operations might involve tight runtime coupling between services, which reduces their availability.\n- Risk of tight design-time coupling between services, which requires time consuming lockstep changes\n\n### Issues\n\nThere are many issues that you must address when designing an architecture.\n\n#### Designing a good (monolithic or microservice) architecture with Assemblage\n\nThere are two key issues that you must address.\nThe first issue is whether to use the monolithic or microservice architecture.\nAnd then, if you choose to use the microservice architecture, the next key challenge is to define a good [service architecture](/post/architecture/2023/09/19/assemblage-part-3-whats-a-service-architecture.html).\nYou must avoid (or at least minimize) the potential drawbacks: complex, inefficient interactions; complex eventually consistent transactions; and tight runtime coupling.\n\n[Assemblage](/post/architecture/2023/02/09/assemblage-architecture-definition-process.html), is an architecture definition process that uses the [dark energy and dark matter forces](/post/architecture/2023/03/26/dark-energy-dark-matter-force-descriptions.html) to group the subdomains in a way that results in good microservice architecture.\n\nThe result of applying Assemblage is either a monolithic architecture or a microservice architecture.\n\nThe [dark energy and dark matter forces](/post/architecture/2023/03/26/dark-energy-dark-matter-force-descriptions.html) play a major role in shaping the service architecture and also heavily influence the design of the distributed operations mentioned below.\n\n#### Designing distributed operations\n\nAnother key design challenge when using microservices, is implementing distributed operations, which span multiple services.\nThis is especially challenging since each [service has its own database](/patterns/data/database-per-service.html).\nThe solution is to use the [service collaboration patterns](/post/patterns/2023/07/29/service-collaboration-patterns.html), which implement distributed operations as a series of local transactions:\n\nThere are four service collaboration patterns:\n\n- [Saga](/patterns/data/saga.html) , which implements a distributed command as a series of local transactions\n- [Command-side replica](/patterns/data/cqrs.html) , which replicas read-only data to the service that implements a command\n- [API composition](/patterns/data/api-composition.html) , which implements a distributed query as a series of local queries\n- [CQRS](/patterns/data/cqrs.html) , which implements a distributed query as a series of local queries\n\nThe Saga, Command-side replica and CQRS patterns use asynchronous messaging.\nServices typically need to use the [Transaction Outbox pattern](/patterns/data/transactional-outbox.html) to atomically update persistent business entities and send a message.\n\nThere are many patterns related to the Microservices architecture pattern. The [Monolithic architecture](monolithic.html) is an alternative to the microservice architecture.\nThe other patterns in the Microservice architecture architecture pattern address issues that you will encounter when applying this pattern.\n\n- Sservice collaboration patterns:\n - [Saga](/patterns/data/saga.html) , which implements a distributed command as a series of local transactions\n - [Command-side replica](/patterns/data/cqrs.html) , which replicas read-only data to the service that implements a command\n - [API composition](/patterns/data/api-composition.html) , which implements a distributed query as a series of local queries\n - [CQRS](/patterns/data/cqrs.html) , which implements a distributed query as a series of local queries\n- The [Messaging](/patterns/communication-style/messaging.html) and [Remote Procedure Invocation](/patterns/communication-style/rpi.html) patterns are two different ways that services can communicate.\n- The [Database per Service pattern](data/database-per-service.html) describes how each service has its own database in order to ensure loose coupling.\n- The [API Gateway pattern](apigateway.html) defines how clients access the services in a microservice architecture.\n- The [Client-side Discovery](client-side-discovery.html) and [Server-side Discovery](server-side-discovery.html) patterns are used to route requests for a client to an available service instance in a microservice architecture.\n- Testing patterns: [Service Component Test](testing/service-component-test.html) and [Service Integration Contract Test](testing/service-integration-contract-test.html)\n- [Circuit Breaker](/patterns/reliability/circuit-breaker.html)\n- [Access Token](/patterns/security/access-token.html)\n- Observability patterns:\n - [Log aggregation](/patterns/observability/application-logging.html)\n - [Application metrics](/patterns/observability/application-metrics.html)\n - [Audit logging](/patterns/observability/audit-logging.html)\n - [Distributed tracing](/patterns/observability/distributed-tracing.html)\n - [Exception tracking](/patterns/observability/exception-tracking.html)\n - [Health check API](/patterns/observability/health-check-api.html)\n - [Log deployments and changes](/patterns/observability/log-deployments-and-changes.html)\n- UI patterns:\n - [Server-side page fragment composition](/patterns/ui/server-side-page-fragment-composition.html)\n - [Client-side UI composition](/patterns/ui/client-side-ui-composition.html)\n- The [Single Service per Host](deployment/single-service-per-host.html) and [Multiple Services per Host](deployment/multiple-services-per-host.html) patterns are two different deployment strategies.\n- Cross-cutting concerns patterns: [Microservice chassis pattern](/patterns/microservice-chassis.html) and [Externalized configuration](/patterns/externalized-configuration.html)\n\n## Known uses\n\nMost large scale web sites including [Netflix](http://techblog.netflix.com/), [Amazon](http://highscalability.com/blog/2007/9/18/amazon-architecture.html)\nand [eBay](http://www.addsimplicity.com/downloads/eBaySDForum2006-11-29.pdf) have evolved from a monolithic architecture to a microservice architecture.\n\nNetflix, which is a very popular video streaming service that’s responsible for up to 30% of Internet traffic, has a large scale, service-oriented architecture.\nThey handle over a billion calls per day to their video streaming API from over 800 different kinds of devices.\nEach API call fans out to an average of six calls to backend services.\n\nAmazon.com originally had a two-tier architecture.\nIn order to scale they migrated to a service-oriented architecture consisting of hundreds of backend services.\nSeveral applications call these services including the applications that implement the Amazon.com website and the web service API.\nThe Amazon.com website application calls 100-150 services to get the data that used to build a web page.\n\nThe auction site ebay.com also evolved from a monolithic architecture to a service-oriented architecture.\nThe application tier consists of multiple independent applications.\nEach application implements the business logic for a specific function area such as buying or selling.\nEach application uses X-axis splits and some applications such as search use Z-axis splits.\nEbay.com also applies a combination of X-, Y- and Z-style scaling to the database tier.\n\nThere are [numerous other examples](../articles/whoisusingmicroservices.html) of companies using the microservice architecture.\n\n# Examples\n\nChris Richardson has [examples](http://eventuate.io/exampleapps.html) of microservices-based applications.\n\n# See also\n\n- [Jfokus 2020 - Cubes, Hexagons, Triangles, and More - Understanding Microservices](/microservices/2020/02/04/jfokus-geometry-of-microservices.html) - provides a good introduction to the microservice architecture.\n- [Microservices patterns](/book)", "znaku_textu": 15667, "slov": 1881, "odkazu": 86, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:57", "sha256": "552c9ed68d6858f01d4c9f37a9896ce8e721e79b506d18650e37ca004ef89ac6", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://exploreddd.com/workshops/designing-microservices.html", "http://eventuate.io/exampleapps.html", "http://techblog.netflix.com/", "http://highscalability.com/blog/2007/9/18/amazon-architecture.html", "http://www.addsimplicity.com/downloads/eBaySDForum2006-11-29.pdf", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/monolithic.html", "titulek": "Pattern: Monolithic Architecture", "h1": "Pattern: Monolithic Architecture", "popis": "The monolithic architecture structures an application as a single deployable/executable component", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Monolithic Architecture", "og:image": "http://microservices.io/i/DecomposingApplications.011.jpg", "og:url": "http://microservices.io/patterns/monolithic.html", "og:description": "The monolithic architecture structures an application as a single deployable/executable component"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/monolithic.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Monolithic Architecture", "description": "A pattern language for microservices", "primaryImageOfPage": {"@type": "ImageObject", "contentUrl": "http://microservices.io/i/DecomposingApplications.011.jpg", "representativeOfPage": "True"}, "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Monolithic Architecture", "description": "The monolithic architecture structures an application as a single deployable/executable component", "image": {"@type": "ImageObject", "name": "The Monolithic architecture", "width": "735", "height": "428", "url": "http://microservices.io/i/DecomposingApplications.011.jpg"}}, "url": "http://microservices.io/patterns/monolithic.html"}, {"@context": "http://schema.org", "@type": "Question", "name": "What is a monolithic architecture?", "acceptedAnswer": {"@type": "Answer", "text": "The monolithic architecture structures an application as a single deployable/executable component"}}], "drobecky": [], "osnova": [{"uroven": 1, "text": "Pattern: Monolithic Architecture"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Example"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 3, "text": "Benefits"}, {"uroven": 3, "text": "Drawbacks"}, {"uroven": 3, "text": "Issues"}, {"uroven": 2, "text": "Known uses"}], "markdown": "# Pattern: Monolithic Architecture\n\n[pattern](/tags/pattern) [application architecture](/tags/application architecture)\n\n---\n\n## Context\n\nYou are developing a business-critical enterprise application.\nYou need to deliver changes rapidly, frequently and reliably - as measured by the [DORA metrics](/articles/glossary#dora-metrics) - in order for your business to thrive in today’s volatile, uncertain, complex and ambiguous world.\nConsequently, your engineering organization is organized into small, loosely coupled, cross-functional teams as described by [Team Topologies](/tags/team%20topologies).\nEach team delivers software using DevOps practices as defined by the [DevOps handbook](/tags/devops).\nIn particular, it practices continuous deployment.\nThe team delivers a stream of small, frequent changes that are tested by an automated deployment pipeline and deployed into production.\n\nA team is responsible for one or more subdomains.\nA subdomain is an implementable model of a slice of business functionality, a.k.a. business capability.\nIt consists of business logic, which consists of business entities (a.k.a. DDD aggregates) that implement business rules, and adapters, which communicate with the outside world.\nA Java-based subdomain, for example, consists of classes organized into packages that’s compiled into a JAR file.\n\nThe subdomains implement the application’s behavior, which consists of a set of (system) operations.\nAn operation is invoked in one of three ways: synchronous and asynchronous requests from clients; events published by other applications and services; and the passing of time.\nIt mutates and queries business entities in one or more subdomains.\n\n## Problem\n\nHow to organize the subdomains into one or more deployable/executable components?\n\n## Forces\n\nThere are five [dark energy forces](/post/microservices/2021/11/30/dark-matter-dark-energy.html):\n\n- [Simple components](/articles/dark-energy-dark-matter/dark-energy/simple-components.html) - simple components consisting of few subdomains are easier to understand and maintain than complex components\n- [Team autonomy](/articles/dark-energy-dark-matter/dark-energy/team-autonomy.html) - a team needs to be able to develop, test and deploy their software independently of other teams\n- [Fast deployment pipeline](/articles/dark-energy-dark-matter/dark-energy/fast-deployment-pipeline.html) - fast feedback and high deployment frequency are essential and are enabled by a fast deployment pipeline, which in turn requires components that are fast to build and test.\n- [Support multiple technology stacks](/articles/dark-energy-dark-matter/dark-energy/multiple-technology-stacks.html) - subdomains are sometimes implemented using a variety of technologies; and developers need to evolve the application’s technology stack, e.g. use current versions of languages and frameworks\n- [Segregate by characteristics](/articles/dark-energy-dark-matter/dark-energy/segregate-by-characteristics.html) - e.g. resource requirements to improve scalability, their availability requirements to improve availability, their security requirements to improve security, etc.\n\nThere are five [dark matter forces](/post/microservices/2021/11/30/dark-matter-dark-energy.html):\n\n- [Simple interactions](/articles/dark-energy-dark-matter/dark-matter/simple-interactions.html) - an operation that’s local to a component or consists of a few simple interactions between components is easier to understand and troubleshoot than a distributed operation, especially one consisting of complex interactions\n- [Efficient interactions](/articles/dark-energy-dark-matter/dark-matter/efficient-interactions.html) - a distributed operation that involves lots of network round trips and large data transfers can be too inefficient\n- [Prefer ACID over BASE](/articles/dark-energy-dark-matter/dark-matter/prefer-acid-over-base.html) - it’s easier to implement an operation as an ACID transaction rather than, for example, eventually consistent sagas\n- [Minimize runtime coupling](/articles/dark-energy-dark-matter/dark-matter/minimize-runtime-coupling.html) - to maximize the availability and reduce the latency of an operation\n- [Minimize design time coupling](/articles/dark-energy-dark-matter/dark-matter/minimize-design-time-coupling.html) - reduce the likelihood of changing services in lockstep, which reduces productivity\n\n## Solution\n\nDesign an architecture that structures the application as a single deployable/executable component that uses a single database.\nThe component contains all of the application’s subdomains.\nSince there’s a single component, all operations are local.\n\n## Example\n\nLet’s imagine that you are building an e-commerce application that takes orders from customers, verifies inventory and available credit, and ships them.\nThe application consists of several components including the StoreFrontUI, which implements the user interface, along with some backend services for checking credit,\nmaintaining inventory and shipping orders.\n\nThe application is deployed as a single monolithic application.\nFor example, a Java web application consists of a single WAR file that runs on a web container such as Tomcat.\nA Rails application consists of a single directory hierarchy deployed using either, for example, Phusion Passenger on Apache/Nginx or JRuby on Tomcat.\nYou can run multiple instances of the application behind a load balancer in order to scale and improve availability.\n\n## Resulting context\n\n### Benefits\n\nSince the application consists of a single component and all operations are local this solution has a number of benefits.\nSpecifically, the dark energy forces are resolved as follows:\n\n- Simple interactions - all interactions are generally easier to understand and troubleshoot. However, interactions between subdomains could potentially be complex.\n- Efficient interactions - interactions are typically more efficient since all communication is local.\n- Prefer ACID over Base - operations can be implemented as ACID transactions (usually)\n- Minimize runtime coupling - there’s no runtime coupling between components\n- Minimize design time coupling - these’s no design time coupling between components. There can, however, be design time coupling between subdomains within the monolith.\n\n### Drawbacks\n\nThis solution has a number of (**potential**) drawbacks.\nSpecifically, an architecture might fail to resolve the dark energy forces:\n\n- Simple components - since there’s only a single component it is potentially difficult to understand and maintain due its size and complexity\n- Team autonomy - there’s potentially less team autonomy since all teams are contributing to the same code base and they need to coordinate their work more often\n- Fast deployment pipeline - the deployment pipeline is potentially slow since there’s a single large application that needs to be built and tested\n- Multiple technology stacks - the application uses a single technology stack, which might not be ideal for all subdomains. Also, if the application is large upgrading the technology stack might be very time consuming\n- Segregate by characteristics - there’s no possibility of segregating subdomains by their characteristics, which might reduce scalability, availability, security etc\n\nThese drawbacks become more severe as the application grows in size and complexity and the number of teams developing it increases.\n\n### Issues\n\nA key challenge with the monolithic architecture is minimizing the potential drawbacks, especially as the application grows in size and complexity and the number of teams developing it increases.\nThere are a few solutions that can reduce some of the drawbacks:\n\n- Increase maintainability and team autonomy by [modularizing the monolith](/post/architecture/2023/07/31/how-modular-can-your-monolith-go-part-1.html). Instead of the traditional layered architecture, the subdomains are organized into vertical slices consisting of presentation, business and persistent logic.\n- Accelerate the deployment pipeline by\n - apply [physical design principles](/post/architecture/2023/09/12/how-modular-can-your-monolith-go-part-4-physical-design.html) to the modular monolith in order to reduce build time coupling\n - implementing an automated merge queue\n - using a build tool that supports incremental building and testing\n - parallelizing and clustering the build and test steps.\n\nThe [microservice architecture](microservices.html) is an alternative pattern that addresses the limitations of the monolithic architecture.\n\n## Known uses\n\nWell known internet services such as Netflix, Amazon.com and eBay initially had a monolithic architecture.\nMost web applications developed by the author prior to 2012 had a monolithic architecture.", "znaku_textu": 8608, "slov": 1141, "odkazu": 45, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:59", "sha256": "805e2c7d63610f203b92d48ee4f91fe810fac39219e88711cb78cd4050579005", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/observability/application-logging.html", "titulek": "Pattern: Log aggregation", "h1": "Pattern: Log aggregation", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Log aggregation", "og:url": "http://microservices.io/patterns/observability/application-logging.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/observability/application-logging.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Log aggregation", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Log aggregation"}, "url": "http://microservices.io/patterns/observability/application-logging.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Log aggregation"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting Context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Log aggregation\n\n[pattern](/tags/pattern) [observability](/tags/observability) [service design](/tags/service design)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\nThe application consists of multiple services and service instances that are running on multiple machines.\nRequests often span multiple service instances.\n\nEach service instance generates writes information about what it is doing to a log file in a standardized format.\nThe log file contains errors, warnings, information and debug messages.\n\n## Problem\n\nHow to understand the behavior of an application and troubleshoot problems?\n\n## Forces\n\n- Any solution should have minimal runtime overhead\n\n## Solution\n\nUse a centralized logging service that aggregates logs from each service instance.\nThe users can search and analyze the logs.\nThey can configure alerts that are triggered when certain messages appear in the logs.\n\n## Examples\n\n- [AWS Cloud Watch](https://aws.amazon.com/cloudwatch/)\n\n## Resulting Context\n\nThis pattern has the following issues:\n\n- handling a large volume of logs requires substantial infrastructure\n\n- [Distributed tracing](distributed-tracing.html) - include the external request id in each log message\n- [Exception tracking](exception-tracking.html) - as well as logging exceptions, report them to an exception tracking service\n\n---\n\n[pattern](/tags/pattern) [observability](/tags/observability) [service design](/tags/service design)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4713, "slov": 561, "odkazu": 33, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:09", "sha256": "8bb5bbb7434f3bc6b182a2c12b40d309cccc2b90a13292e2ce6c1ef64e8e27e0", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://aws.amazon.com/cloudwatch/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/observability/application-metrics.html", "titulek": "Pattern: Application metrics", "h1": "Pattern: Application metrics", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Application metrics", "og:url": "http://microservices.io/patterns/observability/application-metrics.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/observability/application-metrics.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Application metrics", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Application metrics"}, "url": "http://microservices.io/patterns/observability/application-metrics.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Application metrics"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Application metrics\n\n[pattern](/tags/pattern) [observability](/tags/observability) [service design](/tags/service design)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\n\n## Problem\n\nHow to understand the behavior of an application and troubleshoot problems?\n\n## Forces\n\n- Any solution should have minimal runtime overhead\n\n## Solution\n\nInstrument a service to gather statistics about individual operations.\nAggregate metrics in centralized metrics service, which provides reporting and alerting.\nThere are two models for aggregating metrics:\n\n- push - the service pushes metrics to the metrics service\n- pull - the metrics services pulls metrics from the service\n\n## Examples\n\n- Instrumentation libraries:\n - Coda Hale/Yammer [Java Metrics Library](http://metrics.dropwizard.io/3.1.0/)\n - [Prometheus client libraries](https://prometheus.io/docs/instrumenting/clientlibs/)\n- Metrics aggregation services\n - [Prometheus](https://prometheus.io/docs/introduction/overview/)\n - [AWS Cloud Watch](https://aws.amazon.com/cloudwatch/)\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- It provides deep insight into application behavior\n\nThis pattern has the following drawbacks:\n\n- Metrics code is intertwined with business logic making it more complicated\n\nThis pattern has the following issues:\n\n- Aggregating metrics can require significant infrastructure\n\n---\n\n[pattern](/tags/pattern) [observability](/tags/observability) [service design](/tags/service design)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4747, "slov": 536, "odkazu": 34, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:11", "sha256": "bd42d54d801574c1ac52381036b83751578983f1e122bd9fad8248f3c312a9a9", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "http://metrics.dropwizard.io/3.1.0/", "https://prometheus.io/docs/instrumenting/clientlibs/", "https://prometheus.io/docs/introduction/overview/", "https://aws.amazon.com/cloudwatch/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/observability/audit-logging", "titulek": "Pattern: Audit logging", "h1": "Pattern: Audit logging", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Audit logging", "og:url": "http://microservices.io/patterns/observability/audit-logging.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/observability/audit-logging.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Audit logging", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Audit logging"}, "url": "http://microservices.io/patterns/observability/audit-logging.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Audit logging"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting Context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Audit logging\n\n[pattern](/tags/pattern) [observability](/tags/observability) [service design](/tags/service design)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\n\n## Problem\n\nHow to understand the behavior of users and the application and troubleshoot problems?\n\n## Forces\n\n- It is useful to know what actions a user has recently performed: customer support, compliance, security, etc.\n\n## Solution\n\nRecord user activity in a database.\n\n## Examples\n\nThis pattern is widely used.\n\n## Resulting Context\n\nThis pattern has the following benefits:\n\n- Provides a record of user actions\n\nThis pattern has the following drawbacks:\n\n- The auditing code is intertwined with the business logic, which makes the business logic more complicated\n\n- [Event Sourcing](../data/event-sourcing.html) is a reliable way to implement auditing\n\n---\n\n[pattern](/tags/pattern) [observability](/tags/observability) [service design](/tags/service design)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4218, "slov": 499, "odkazu": 31, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:37", "sha256": "50a39df4bb5ed310f290d10e7c03497389db0e69324e46e43b988594aa98653e", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/observability/audit-logging.html", "titulek": "Pattern: Audit logging", "h1": "Pattern: Audit logging", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Audit logging", "og:url": "http://microservices.io/patterns/observability/audit-logging.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/observability/audit-logging.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Audit logging", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Audit logging"}, "url": "http://microservices.io/patterns/observability/audit-logging.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Audit logging"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting Context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Audit logging\n\n[pattern](/tags/pattern) [observability](/tags/observability) [service design](/tags/service design)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\n\n## Problem\n\nHow to understand the behavior of users and the application and troubleshoot problems?\n\n## Forces\n\n- It is useful to know what actions a user has recently performed: customer support, compliance, security, etc.\n\n## Solution\n\nRecord user activity in a database.\n\n## Examples\n\nThis pattern is widely used.\n\n## Resulting Context\n\nThis pattern has the following benefits:\n\n- Provides a record of user actions\n\nThis pattern has the following drawbacks:\n\n- The auditing code is intertwined with the business logic, which makes the business logic more complicated\n\n- [Event Sourcing](../data/event-sourcing.html) is a reliable way to implement auditing\n\n---\n\n[pattern](/tags/pattern) [observability](/tags/observability) [service design](/tags/service design)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4218, "slov": 499, "odkazu": 31, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/observability/audit-logging", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:13", "sha256": "50a39df4bb5ed310f290d10e7c03497389db0e69324e46e43b988594aa98653e", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/observability/distributed-tracing.html", "titulek": "Pattern: Distributed tracing", "h1": "Pattern: Distributed tracing", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Distributed tracing", "og:url": "http://microservices.io/patterns/observability/distributed-tracing.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/observability/distributed-tracing.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Distributed tracing", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Distributed tracing"}, "url": "http://microservices.io/patterns/observability/distributed-tracing.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Distributed tracing"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting Context"}, {"uroven": 3, "text": "See also"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Distributed tracing\n\n[pattern](/tags/pattern) [observability](/tags/observability) [service design](/tags/service design)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\nRequests often span multiple services.\nEach service handles a request by performing one or more operations, e.g. database queries, publishes messages, etc.\n\n## Problem\n\nHow to understand the behavior of an application and troubleshoot problems?\n\n## Forces\n\n- External monitoring only tells you the overall response time and number of invocations - no insight into the individual operations\n- Any solution should have minimal runtime overhead\n- Log entries for a request are scattered across numerous logs\n\n## Solution\n\nInstrument services with code that\n\n- Assigns each external request a unique external request id\n- Passes the external request id to all services that are involved in handling the request\n- Includes the external request id in all [log messages](application-logging.html)\n- Records information (e.g. start time, end time) about the requests and operations performed when handling a external request in a centralized service\n\nThis instrumentation might be part of the functionality provided by a [Microservice Chassis framework](../microservice-chassis.html).\n\n## Examples\n\nThe [Microservices Example application](https://github.com/cer/microservices-examples) is an example of an application that uses client-side service discovery.\nIt is written in Scala and uses Spring Boot and Spring Cloud as the [Microservice chassis](../microservice-chassis.html).\nThey provide various capabilities including [Spring Cloud Sleuth](https://cloud.spring.io/spring-cloud-sleuth/), which provides support for distributed tracing.\nIt instruments Spring components to gather trace information and can delivers it to a Zipkin Server, which gathers and displays traces.\n\nThe following Spring Cloud Sleuth dependencies are configured in `build.gradle`:\n\n```\ndependencies { compile \"org.springframework.cloud:spring-cloud-sleuth-stream\" compile \"org.springframework.cloud:spring-cloud-starter-sleuth\" compile \"org.springframework.cloud:spring-cloud-stream-binder-rabbit\" \n```\n\nRabbitMQ is used to deliver traces to Zipkin.\n\nThe services are deployed with various Spring Cloud Sleuth-related environment variables set in the `docker-compose.yml`:\n\n```\nenvironment:\n SPRING_RABBITMQ_HOST: rabbitmq\n SPRING_SLEUTH_ENABLED: \"true\"\n SPRING_SLEUTH_SAMPLER_PERCENTAGE: 1\n SPRING_SLEUTH_WEB_SKIPPATTERN: \"/api-docs.*|/autoconfig|/configprops|/dump|/health|/info|/metrics.*|/mappings|/trace|/swagger.*|.*\\\\.png|.*\\\\.css|.*\\\\.js|/favicon.ico|/hystrix.stream\"\n```\n\nThis properties enable Spring Cloud Sleuth and configure it to sample all requests.\nIt also tells Spring Cloud Sleuth to deliver traces to Zipkin via RabbitMQ running on the host called `rabbitmq`.\n\nThe Zipkin server is a simple, Spring Boot application:\n\n```\n@SpringBootApplication @EnableZipkinStreamServer public class ZipkinServer { public static void main(String[] args) { SpringApplication.run(ZipkinServer.class, args); } } \n```\n\nIt is deployed using Docker:\n\n```\nzipkin: image: java:openjdk-8u91-jdk working_dir: /app volumes: - ./zipkin-server/build/libs:/app command: java -jar /app/zipkin-server.jar --server.port=9411 links: - rabbitmq ports: - \"9411:9411\" environment: RABBIT_HOST: rabbitmq \n```\n\n## Resulting Context\n\nThis pattern has the following benefits:\n\n- It provides useful insight into the behavior of the system including the sources of latency\n- It enables developers to see how an individual request is handled by searching across [aggregated logs](application-logging.html) for its external request id\n\nThis pattern has the following issues:\n\n- Aggregating and storing traces can require significant infrastructure\n\n- [Log aggregation](application-logging.html) - the external request id is included in each log message\n\n### See also\n\n- [Open Zipkin](http://zipkin.io/) - service for recording and displaying tracing information\n- [Open Tracing](http://opentracing.io) - standardized API for distributed tracing\n\n---\n\n[pattern](/tags/pattern) [observability](/tags/observability) [service design](/tags/service design)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 7390, "slov": 886, "odkazu": 36, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:33", "sha256": "b5e8a292ce1a072a80164515c0d373bb07e3037ef527e853e4b3f758f29e73dd", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://github.com/cer/microservices-examples", "https://cloud.spring.io/spring-cloud-sleuth/", "http://zipkin.io/", "http://opentracing.io/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/observability/exception-tracking.html", "titulek": "Pattern: Exception tracking", "h1": "Pattern: Exception tracking", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Exception tracking", "og:url": "http://microservices.io/patterns/observability/exception-tracking.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/observability/exception-tracking.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Exception tracking", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Exception tracking"}, "url": "http://microservices.io/patterns/observability/exception-tracking.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Exception tracking"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Resulting Context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Exception tracking\n\n[pattern](/tags/pattern) [observability](/tags/observability) [service design](/tags/service design)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\nThe application consists of multiple services and service instances that are running on multiple machines.\nErrors sometimes occur when handling requests.\nWhen an error occurs, a service instance throws an exception, which contains an error message and a stack trace.\n\n## Problem\n\nHow to understand the behavior of an application and troubleshoot problems?\n\n- Exceptions must be de-duplicated, recorded, investigated by developers and the underlying issue resolved\n- Any solution should have minimal runtime overhead\n\n## Solution\n\nReport all exceptions to a centralized exception tracking service that aggregates and tracks exceptions and notifies developers.\n\n## Resulting Context\n\nThis pattern has the following benefits:\n\n- It is easier to view exceptions and track their resolution\n\nThis pattern has the following drawbacks:\n\n- The exception tracking service is additional infrastructure\n\n- [Log aggregation](application-logging.html) - exceptions should be logged as well as reported to a tracking service\n\n---\n\n[pattern](/tags/pattern) [observability](/tags/observability) [service design](/tags/service design)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4578, "slov": 545, "odkazu": 31, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:42", "sha256": "b7cc689a47f92a3e645b0d13ba2db49a5759455adb32bc7377ab1dee91c92e57", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/observability/health-check-api.html", "titulek": "Pattern: Health Check API", "h1": "Pattern: Health Check API", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Health Check API", "og:url": "http://microservices.io/patterns/observability/health-check-api.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/observability/health-check-api.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Health Check API", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Health Check API"}, "url": "http://microservices.io/patterns/observability/health-check-api.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Health Check API"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting Context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Health Check API\n\n[pattern](/tags/pattern) [observability](/tags/observability) [service design](/tags/service design)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\nSometimes a service instance can be incapable of handling requests yet still be running.\nFor example, it might have ran out of database connections.\nWhen this occurs, the monitoring system should generate a alert.\nAlso, the load balancer or [service registry](../service-registry.html) should not route requests to the failed service instance.\n\n## Problem\n\nHow to detect that a running service instance is unable to handle requests?\n\n## Forces\n\n- An alert should be generated when a service instance fails\n- Requests should be routed to working service instances\n\n## Solution\n\nA service has an health check API endpoint (e.g. HTTP `/health`) that returns the health of the service.\nThe API endpoint handler performs various checks, such as\n\n- the status of the connections to the infrastructure services used by the service instance\n- the status of the host, e.g. disk space\n- application specific logic\n\nA health check client - a monitoring service, [service registry](../service-registry.html) or load balancer - periodically invokes the endpoint to check the health of the service instance.\n\n## Examples\n\nThe [Microservices Example application](https://github.com/cer/microservices-examples) is an example on an application implements a health check API.\nIt is written in Scala and uses Spring Boot and Spring Cloud as the [Microservice chassis](/patterns/microservice-chassis.html).\nThey provide various capabilities including a health check endpoint.\nThe endpoint is implemented by the [Spring Boot Actuator](http://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html) module.\nIt configures a `/health` HTTP endpoint that invokes extensible health check logic.\n\nTo enable a `/health` endpoint, first define actuator as a dependency:\n\n```\ndependencies { compile \"org.springframework.boot:spring-boot-starter-actuator\" \n```\n\nSecond, enable Spring Boot autoconfiguration:\n\n```\n@SpringBootApplication class UserRegistrationConfiguration { \n```\n\nAt this point, your application will have a health check endpoint with default behavior.\n\nYou can customize this behavior by defining one or more Spring beans that implement the `HealthIndicator` interface:\n\n```\nclass UserRegistrationConfiguration { @Bean def discoveryHealthIndicator(discoveryClient : EurekaClient ) : HealthIndicator = new DiscoveryHealthIndicator(discoveryClient) \n```\n\nA `HealthIndicator` must implement a `health()` method, which returns a `Health` value.\n\n## Resulting Context\n\nThis pattern has the following benefits:\n\n- The health check endpoint enables the health of a service instance to be periodically tested\n\nThis pattern has the following drawbacks:\n\n- The health check might not sufficiently comprehensive or the service instance might fail between health checks and so requests might still be routed to a failed service instance\n\n- [Service registry](../service-registry.html) - the service registry invokes the health check endpoint\n\n---\n\n[pattern](/tags/pattern) [observability](/tags/observability) [service design](/tags/service design)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 6465, "slov": 792, "odkazu": 34, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:46", "sha256": "0f1c2bab4164e0b4e1534b71a72a6d2229dd09cbbb8f1e2f775f56310d0f9df6", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://github.com/cer/microservices-examples", "http://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/observability/log-deployments-and-changes.html", "titulek": "Pattern: Log deployments and changes", "h1": "Pattern: Log deployments and changes", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Log deployments and changes", "og:url": "http://microservices.io/patterns/observability/log-deployments-and-changes.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/observability/log-deployments-and-changes.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Log deployments and changes", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Log deployments and changes"}, "url": "http://microservices.io/patterns/observability/log-deployments-and-changes.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Log deployments and changes"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting Context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Log deployments and changes\n\n[pattern](/tags/pattern) [observability](/tags/observability)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\n\n## Problem\n\nHow to understand the behavior of an application and troubleshoot problems?\n\n## Forces\n\n- It useful to see when deployments and other changes occur since issues usually occur immediately after a change\n\n## Solution\n\nLog every deployment and every change to the (production) environment.\n\n## Examples\n\nA deployment tool can, for example, publish [a pseudo-metric](application-metrics.html) whenever it deploys a new version of a service.\nThis metric can then be displayed alongside other metrics enabling changes in application behavior to be correlated with deployments.\nSee [Tracking Every Release by Mike Brittain](https://codeascraft.com/2010/12/08/track-every-release/)\n\n[AWS Cloud Trail](https://aws.amazon.com/cloudtrail/) provides logs of AWS API calls.\n\n## Resulting Context\n\nThis pattern has the following benefits:\n\n- Enables deployments and changes to be easily correlated with issues leading to faster resolution.\n\n---\n\n[pattern](/tags/pattern) [observability](/tags/observability)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4438, "slov": 526, "odkazu": 32, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:51", "sha256": "9b137c45dcd1b98e213eea9d673e7e6fe2fc1793afb17bdf413e79be038dee85", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://codeascraft.com/2010/12/08/track-every-release/", "https://aws.amazon.com/cloudtrail/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/refactoring/anti-corruption-layer.html", "titulek": "Pattern: Anti-corruption layer", "h1": "Pattern: Anti-corruption layer", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Anti-corruption layer", "og:url": "http://microservices.io/patterns/refactoring/anti-corruption-layer.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/refactoring/anti-corruption-layer.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Anti-corruption layer", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Anti-corruption layer"}, "url": "http://microservices.io/patterns/refactoring/anti-corruption-layer.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Anti-corruption layer"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Anti-corruption layer\n\n[pattern](/tags/pattern)\n\n---\n\n## Context\n\n## Problem\n\nHow do you prevent a legacy monolith’s domain model from polluting the domain model of a new service.\n\n## Forces\n\n## Solution\n\nDefine an anti-corruption layer, which translates between the two domain models.\n\n## Examples\n\n## Resulting context\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 3601, "slov": 430, "odkazu": 27, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:04", "sha256": "20626fa232fdc4c065ce7be768b287e4534145214f2caf4434d59f0766ecd1f0", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/refactoring/strangler-application.html", "titulek": "Pattern: Strangler application", "h1": "Pattern: Strangler application", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Strangler application", "og:url": "http://microservices.io/patterns/refactoring/strangler-application.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/refactoring/strangler-application.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Strangler application", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Strangler application"}, "url": "http://microservices.io/patterns/refactoring/strangler-application.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Strangler application"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "Learn more"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Strangler application\n\n[pattern](/tags/pattern) [application architecture](/tags/application architecture) [refactoring to microservices](/tags/refactoring to microservices) [microservices adoption](/tags/microservices adoption)\n\n---\n\n## Context\n\n## Problem\n\nHow do you migrate a legacy monolithic application to a microservice architecture?\n\n## Forces\n\n## Solution\n\nModernize an application by incrementally developing a new (strangler) application around the legacy application.\nIn this scenario, the strangler application has a [microservice architecture](/patterns/microservices.html).\n\nThe strangler application consists of two types of services.\nFirst, there are services that implement functionality that previously resided in the monolith.\nSecond, there are services that implement new features.\nThe latter are particularly useful since they demonstrate to the business the value of using microservices.\n\n## Examples\n\n## Resulting context\n\n## Learn more\n\n- [Refactoring example](/refactoring)\n- [Chapter 13 of my book](/book) describes how to refactor a monolith to microservices\n\n---\n\n[pattern](/tags/pattern) [application architecture](/tags/application architecture) [refactoring to microservices](/tags/refactoring to microservices) [microservices adoption](/tags/microservices adoption)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4542, "slov": 520, "odkazu": 32, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:35", "sha256": "e800e708975dfd2c69c6843550f29613c2fade3aae55d1b421141852ad1d22de", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/reliability/circuit-breaker.html", "titulek": "Pattern: Circuit Breaker", "h1": "Pattern: Circuit Breaker", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Circuit Breaker", "og:url": "http://microservices.io/patterns/reliability/circuit-breaker.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/reliability/circuit-breaker.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Circuit Breaker", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Circuit Breaker"}, "url": "http://microservices.io/patterns/reliability/circuit-breaker.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Circuit Breaker"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Example"}, {"uroven": 2, "text": "Resulting Context"}, {"uroven": 2, "text": "See also"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Circuit Breaker\n\n[pattern](/tags/pattern) [service design](/tags/service design) [resilience](/tags/resilience) [inter-service communication](/tags/inter-service communication)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture](../microservices.html).\nServices sometimes collaborate when handling requests.\nWhen one service synchronously invokes another there is always the possibility that the other service is unavailable or is exhibiting such high latency it is essentially unusable.\nPrecious resources such as threads might be consumed in the caller while waiting for the other service to respond.\nThis might lead to resource exhaustion, which would make the calling service unable to handle other requests.\nThe failure of one service can potentially cascade to other services throughout the application.\n\n## Problem\n\nHow to prevent a network or service failure from cascading to other services?\n\n## Forces\n\n## Solution\n\nA service client should invoke a remote service via a proxy that functions in a similar fashion to an electrical circuit breaker.\nWhen the number of consecutive failures crosses a threshold, the circuit breaker trips, and for the duration of a timeout period all attempts to invoke the remote service will fail immediately.\nAfter the timeout expires the circuit breaker allows a limited number of test requests to pass through.\nIf those requests succeed the circuit breaker resumes normal operation.\nOtherwise, if there is a failure the timeout period begins again.\n\n## Example\n\n`RegistrationServiceProxy` from the [Microservices Example application](https://github.com/cer/microservices-examples) is an example of a component, which is written in Scala, that uses a circuit breaker to handle failures when invoking a remote service.\n\n```\n@Component class RegistrationServiceProxy @Autowired()(restTemplate: RestTemplate) extends RegistrationService { @Value(\"${user_registration_url}\") var userRegistrationUrl: String = _ @HystrixCommand(commandProperties=Array(new HystrixProperty(name=\"execution.isolation.thread.timeoutInMilliseconds\", value=\"800\"))) override def registerUser(emailAddress: String, password: String): Either[RegistrationError, String] = { try { val response = restTemplate.postForEntity(userRegistrationUrl, RegistrationBackendRequest(emailAddress, password), classOf[RegistrationBackendResponse]) response.getStatusCode match { case HttpStatus.OK => Right(response.getBody.id) } } catch { case e: HttpClientErrorException if e.getStatusCode == HttpStatus.CONFLICT => Left(DuplicateRegistrationError) } } } \n```\n\nThe `@HystrixCommand` arranges for calls to `registerUser()` to be executed using a circuit breaker.\n\nThe circuit breaker functionality is enabled using the `@EnableCircuitBreaker` annotation on the `UserRegistrationConfiguration` class.\n\n```\n@EnableCircuitBreaker\nclass UserRegistrationConfiguration {\n```\n\n## Resulting Context\n\nThis pattern has the following benefits:\n\n- Services handle the failure of the services that they invoke\n\nThis pattern has the following issues:\n\n- It is challenging to choose timeout values without creating false positives or introducing excessive latency.\n\n- The [Microservice Chassis](../microservice-chassis.html) might implement this pattern\n- An [API Gateway](../apigateway.html) will use this pattern to invoke services\n- A [Server-side discovery](../server-side-discovery.html) router might use this pattern to invoke services\n\n## See also\n\n- [Netflix Hystrix](https://github.com/Netflix/Hystrix) is an example of a library that implements this pattern\n\n---\n\n[pattern](/tags/pattern) [service design](/tags/service design) [resilience](/tags/resilience) [inter-service communication](/tags/inter-service communication)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 6941, "slov": 815, "odkazu": 36, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:15", "sha256": "baf57ce1183110ad7195203d764fccbde9069161fb465467e9e80dfd785f2d3f", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://github.com/cer/microservices-examples", "https://github.com/Netflix/Hystrix", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/security/access-token.html", "titulek": "Pattern: Access token", "h1": "Pattern: Access token", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Access token", "og:url": "http://microservices.io/patterns/security/access-token.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/security/access-token.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Access token", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Access token"}, "url": "http://microservices.io/patterns/security/access-token.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Access token"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Example"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Access token\n\n[pattern](/tags/pattern) [security](/tags/security) [service design](/tags/service design)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture](../microservices.html) and [API Gateway](../apigateway.html) patterns.\nThe application consists of numerous services.\nThe API gateway is the single entry point for client requests.\nIt authenticates requests, and forwards them to other services, which might in turn invoke other services.\n\n## Problem\n\nHow to communicate the identity of the requestor to the services that handle the request?\n\n## Forces\n\n- Services often need to verify that a user is authorized to perform an operation\n\n## Solution\n\nThe [API Gateway](../apigateway.html) authenticates the request and passes an access token (e.g. [JSON Web Token](https://jwt.io/)) that securely identifies the requestor in each request to the services.\nA service can include the access token in requests it makes to other services.\n\n## Example\n\nSee [JSON Web Token](https://jwt.io/) for usage examples and supporting libraries.\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- The identity of the requestor is securely passed around the system\n- Services can verify that the requestor is authorized to perform an operation\n\n- The [API Gateway](../apigateway.html) uses this pattern.\n\n---\n\n[pattern](/tags/pattern) [security](/tags/security) [service design](/tags/service design)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4659, "slov": 564, "odkazu": 32, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:02", "sha256": "2138728c54a5845e9dc9473faa439a4b3c582d3f95d03950d89978f02584826c", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://jwt.io/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/self-registration.html", "titulek": "Pattern: Self Registration", "h1": "Pattern: Self Registration", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Self Registration", "og:url": "http://microservices.io/patterns/self-registration.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/self-registration.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Self Registration", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Self Registration"}, "url": "http://microservices.io/patterns/self-registration.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Self Registration"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Self Registration\n\n[pattern](/tags/pattern) [inter-service communication](/tags/inter-service communication) [service discovery](/tags/service discovery)\n\n---\n\n## Context\n\nYou have applied either the [Client-side Service Discovery pattern](client-side-discovery.html) or the [Server-side Service Discovery pattern](server-side-discovery.html).\nService instances must be registered with the [service registry](service-registry.html) on startup so that they can be discovered and unregistered on shutdown.\n\n## Problem\n\nHow are service instances registered with and unregistered from the service registry?\n\n## Forces\n\n- Service instances must be registered with the service registry on startup and unregistered on shutdown\n- Service instances that crash must be unregistered from the service registry\n- Service instances that are running but incapable of handling requests must be unregistered from the service registry\n\n## Solution\n\nA service instance is responsible for registering itself with the service registry.\nOn startup the service instance registers itself (host and IP address) with the service registry and makes itself available for discovery.\nThe client must typically periodically renew its registration so that the registry knows it is still alive.\nOn shutdown, the service instance unregisters itself from the service registry.\n\nThis is typically handled by a [Microservice chassis framework](microservice-chassis.html)\n\n## Examples\n\nThe [Microservices Example application](https://github.com/cer/microservices-examples) is an example of an application that uses self-registration.\nIt is written in Scala and uses Spring Boot and Spring Cloud as the [Microservice chassis](microservice-chassis.html).\nThe application uses the [Eureka](https://github.com/Netflix/eureka/wiki/Eureka-at-a-glance) [Service Registry](service-registry.html), which is a [Netflix OSS](http://netflix.github.io/) component.\n\nService registration is configured using the `@EnableEurekaClient` on a Java config class:\n\n```\n@Configuration @EnableEurekaClient class EurekaClientConfiguration { \n```\n\nThis annotation causes the service instance to be registered with Eureka.\n\n## Resulting context\n\nThe benefits of the Self Registration pattern include the following:\n\n- A service instance knows its own state so can implement a state model that’s more complex than UP/DOWN, e.g. STARTING, AVAILABLE, …\n\nThere are also some drawbacks:\n\n- Couples the service to the Service Registry\n- You must implement service registration logic in each programming language/framework that you use to write your services, e.g. NodeJS/JavaScript, Java/Scala, etc.\n- A service instance that is running yet unable to handle requests will often lack the self-awareness to unregister itself from the service registry\n\n- [Service Registry](service-registry.html) - an essential part of service discovery\n- [Client Side Discovery](client-side-discovery.html) - one way that a service instance is discovered\n- [Server Side Discovery](server-side-discovery.html) - another way a service instance is discovered\n- [Microservice chassis](microservice-chassis.html) - self registration is the responsibility the microservice chassis framework\n- [3rd Party Registration](3rd-party-registration.html) is an alternative solution\n\n---\n\n[pattern](/tags/pattern) [inter-service communication](/tags/inter-service communication) [service discovery](/tags/service discovery)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 6633, "slov": 805, "odkazu": 37, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:08", "sha256": "3f14062b7082998e03559d70c59f6c0a79d51147f8b3a3beb2b98aeb1c5b2065", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://github.com/cer/microservices-examples", "https://github.com/Netflix/eureka/wiki/Eureka-at-a-glance", "http://netflix.github.io/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/server-side-discovery.html", "titulek": "Pattern: Server-side service discovery", "h1": "Pattern: Server-side service discovery", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Server-side service discovery", "og:url": "http://microservices.io/patterns/server-side-discovery.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/server-side-discovery.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Server-side service discovery", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Server-side service discovery"}, "url": "http://microservices.io/patterns/server-side-discovery.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Server-side service discovery"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Server-side service discovery\n\n[pattern](/tags/pattern) [inter-service communication](/tags/inter-service communication) [service discovery](/tags/service discovery)\n\n---\n\n## Context\n\nServices typically need to call one another.\nIn a monolithic application, services invoke one another through language-level method or procedure calls.\nIn a traditional distributed system deployment, services run at fixed, well known locations (hosts and ports) and so can easily call one another using HTTP/REST or some RPC mechanism.\nHowever, a modern [microservice-based](microservices.html) application typically runs in a virtualized or containerized environments where the number of instances of a service and their locations changes dynamically.\n\nConsequently, you must implement a mechanism for that enables the clients of service to make requests to a dynamically changing set of ephemeral service instances.\n\n## Problem\n\nHow does the client of a service - the API gateway or another service - discover the location of a service instance?\n\n## Forces\n\n- Each instance of a service exposes a remote API such as HTTP/REST, or Thrift etc. at a particular location (host and port)\n- The number of services instances and their locations changes dynamically.\n- Virtual machines and containers are usually assigned dynamic IP addresses.\n- The number of services instances might vary dynamically. For example, an EC2 Autoscaling Group adjusts the number of instances based on load.\n\n## Solution\n\nWhen making a request to a service, the client makes a request via a router (a.k.a load balancer) that runs at a well known location.\nThe router queries a [service registry](service-registry.html), which might be built into the router, and forwards the request to an available service instance.\n\nThe following diagram shows the structure of this pattern.\n\n## Examples\n\nAn AWS Elastic Load Balancer (ELB) is an example of a server-side discovery router.\nA client makes HTTP(s) requests (or opens TCP connections) to the ELB, which load balances the traffic amongst a set of EC2 instances.\nAn ELB can load balance either external traffic from the Internet or, when deployed in a VPC, load balance internal traffic.\nAn ELB also functions as a [Service Registry](service-registry.html).\nEC2 instances are registered with the ELB either explicitly via an API call or automatically as part of an auto-scaling group.\n\nSome clustering solutions such as [Kubernetes](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/services.md) and [Marathon](https://mesosphere.github.io/marathon/docs/service-discovery-load-balancing.html) run a proxy on each host that functions as a server-side discovery router.\nIn order to access a service, a client connects to the local proxy using the port assigned to that service.\nThe proxy then forwards the request to a service instance running somewhere in the cluster.\n\n## Resulting context\n\nServer-side service discovery has a number of benefits:\n\n- Compared to [client-side discovery](client-side-discovery.html) , the client code is simpler since it does not have to deal with discovery. Instead, a client simply makes a request to the router\n- Some cloud environments provide this functionality, e.g. AWS Elastic Load Balancer\n\nIt also has the following drawbacks:\n\n- Unless it’s part of the cloud environment, the router must is another system component that must be installed and configured. It will also need to be replicated for availability and capacity.\n- The router must support the necessary communication protocols (e.g HTTP, gRPC, Thrift, etc) unless it is TCP-based router\n- More network hops are required than when using [Client Side Discovery](client-side-discovery.html)\n\n- A router uses [Service Registry](service-registry.html)\n- A router might use a [Circuit Breaker](reliability/circuit-breaker.html) to invoke services\n- [Client Side Discovery](client-side-discovery.html) is an alternative solution\n\n---\n\n[pattern](/tags/pattern) [inter-service communication](/tags/inter-service communication) [service discovery](/tags/service discovery)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 7307, "slov": 958, "odkazu": 35, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:10", "sha256": "35e15ea16c0b216c7150af102146e24ed6b1802695db0066a574fc3252a54731", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/services.md", "https://mesosphere.github.io/marathon/docs/service-discovery-load-balancing.html", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/service-registry.html", "titulek": "Pattern: Service registry", "h1": "Pattern: Service registry", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Service registry", "og:url": "http://microservices.io/patterns/service-registry.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/service-registry.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Service registry", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Service registry"}, "url": "http://microservices.io/patterns/service-registry.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Service registry"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Service registry\n\n[pattern](/tags/pattern) [inter-service communication](/tags/inter-service communication) [service discovery](/tags/service discovery)\n\n---\n\n## Context\n\nClients of a service use either [Client-side discovery](client-side-discovery.html) or [Server-side discovery](server-side-discovery.html) to determine the location of a service instance to which to send requests.\n\n## Problem\n\nHow do clients of a service (in the case of [Client-side discovery](client-side-discovery.html)) and/or routers (in the case of [Server-side discovery](server-side-discovery.html)) know about the available instances of a service?\n\n## Forces\n\n- Each instance of a service exposes a remote API such as HTTP/REST, or Thrift etc. at a particular location (host and port)\n- The number of services instances and their locations changes dynamically. Virtual machines and containers are usually assigned a dynamic IP address. An EC2 Autoscaling Group, for example, adjusts the number of instances based on load.\n\n## Solution\n\nImplement a service registry, which is a database of services, their instances and their locations.\nService instances are registered with the service registry on startup and deregistered on shutdown.\nClient of the service and/or routers query the service registry to find the available instances of a service.\nA service registry might invoke a service instance’s [health check API](observability/health-check-api.html) to verify that it is able to handle requests\n\n## Examples\n\nThe [Microservices Example application](https://github.com/cer/microservices-examples) is an example of an application that uses client-side service discovery.\nIt is written in Scala and uses Spring Boot and Spring Cloud as the [Microservice chassis](microservice-chassis.html).\nThey provide various capabilities including a [Netflix Eureka](https://github.com/Netflix/eureka/wiki/Eureka-at-a-glance) service registry.\n\nThe Eureka Server is a small Spring Boot application:\n\n```\n@SpringBootApplication @EnableEurekaServer public class EurekaServer { public static void main(String[] args) { new SpringApplicationBuilder(EurekaServer.class).web(true).run(args); } } \n```\n\nIt is deployed using Docker:\n\n```\neureka: image: java:openjdk-8u91-jdk working_dir: /app volumes: - ./eureka-server/build/libs:/app command: java -jar /app/eureka-server.jar --server.port=8761 ports: - \"8761:8761\" \n```\n\nOther examples of service registries (or technologies that are commonly used as service registries) include:\n\n- [Apache Zookeeper](http://zookeeper.apache.org)\n- [Consul](https://consul.io/)\n- [Etcd](https://github.com/coreos/etcd)\n\nSome systems such as Kubernetes, Marathon and AWS ELB have an implicit service registry.\n\n## Resulting context\n\nThe benefits of the Service Registry pattern include:\n\n- Client of the service and/or routers can discover the location of service instances.\n\nThere are also some drawbacks:\n\n- Unless the service registry is built in to the infrastructure, it is yet another infrastructure component that must be setup, configured and managed.\nMoreover, the service registry is a critical system component.\nAlthough clients should cache data provided by the service registry, if the service registry fails that data will eventually become out of date.\nConsequently, the service registry must be highly available.\n\nYou need to decide how service instances are registered with the service registry.\nThere are two options:\n\n- [Self registration pattern](self-registration.html) - service instances register themselves.\n- [3rd party registration pattern](3rd-party-registration.html) - a 3rd party registers the service instances with the service registry.\n\nThe clients of the service registry need to know the location(s) of the service registry instances.\nService registry instances must be deployed on fixed and well known IP addresses.\nClients are configured with those IP addresses.\n\nFor example, [Netflix Eureka](https://github.com/Netflix/eureka/wiki/Configuring-Eureka-in-AWS-Cloud) service instances are typically deployed using elastic IP addresses.\nThe available pool of Elastic IP addresses is configured using either a properties file or via DNS.\nWhen a Eureka instance starts up it consults the configuration to determine which available Elastic IP address to use.\nA Eureka client is also configured with the pool of Elastic IP addresses.\n\n- [Client-side discovery](client-side-discovery.html) and [Server-side discovery](server-side-discovery.html) create the need for a service registry\n- [Self registration](self-registration.html) and [3rd party registration](3rd-party-registration.html) are two different ways that service instances can be registered with the service registry\n- [Health Check API](observability/health-check-api.html) - the service registry invokes a service instance’s health check API to verify that it is able to handle requests\n\n---\n\n[pattern](/tags/pattern) [inter-service communication](/tags/inter-service communication) [service discovery](/tags/service discovery)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 8216, "slov": 1031, "odkazu": 41, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:28", "sha256": "b5a5ff622607d4c50d518069cdbdfc3d04c7625f969d0f0f52e85a007413eb59", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://github.com/cer/microservices-examples", "https://github.com/Netflix/eureka/wiki/Eureka-at-a-glance", "http://zookeeper.apache.org/", "https://consul.io/", "https://github.com/coreos/etcd", "https://github.com/Netflix/eureka/wiki/Configuring-Eureka-in-AWS-Cloud", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/service-template.html", "titulek": "Pattern: Service Template", "h1": "Pattern: Service Template", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Service Template", "og:url": "http://microservices.io/patterns/service-template.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/service-template.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Service Template", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Service Template"}, "url": "http://microservices.io/patterns/service-template.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Service Template"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Want to learn more about this pattern?"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "See also"}, {"uroven": 2, "text": "Learn more"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Service Template\n\n[pattern](/tags/pattern) [service design](/tags/service design) [service template](/tags/service template)\n\n---\n\n## Context\n\n## Want to learn more about this pattern?\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\nWhen you start the development of an application you often spend a significant amount of time writing the build logic and putting in place the mechanisms to handle cross-cutting concerns.\nThe build logic builds, and tests the application and also packages into a production-ready format, such as a Docker container image.\nFor example, the majority of the build logic for a Java application is implemented using Gradle or Maven.\nIt might also consist of configuration scripts for build automation tool, such as CircleCI or Github Actions.\nOn the surface, the build logic appears to be quite simple.\nHowever, even defining a carefully curated set of dependencies can be remarkably challenging.\n\nIn addition to the build logic, you need to handle cross cutting concerns.\nExamples of cross-cutting concerns include:\n\n- Security - for example, REST APIs must be secured by requiring an [Access Token](/security/access-token.html)\n- [Externalized configuration](/patterns/externalized-configuration.html) - includes credentials, and network locations of external services such as databases and message brokers\n- [Logging](/patterns/observability/application-logging.html) - configuring of a logging framework such as log4j or logback\n- [Health check](/patterns/observability/health-check-api.html) - a url that a monitoring service can “ping” to determine the health of the application\n- [Metrics](/patterns/observability/application-metrics.html) - measurements that provide insight into what the application is doing and how it is performing\n- [Distributed tracing](/patterns/observability/distributed-tracing.html) - instrument services with code that assigns each external request an unique identifier that is passed between services.\n\nAs well as these generic cross-cutting concerns, there are also cross-cutting concerns that are specific to the technologies that an application uses.\nApplications that use infrastructure services such as databases or a message brokers require boilerplate configuration in order to do that.\nFor example, applications that use a relational database must be configured with a connection pool.\nWeb applications that process HTTP requests also need boilerplate configuration.\n\nIt is common to spend one or two days, sometimes even longer, writing the build logic and implementing cross-cutting concerns.\nIf you going to spend months or years developing a monolithic application then the upfront investment is insignificant.\nThe situation is very different, however, if you are developing an application that has the [microservice architecture](microservices.html).\nThere are tens or hundreds of services.\nYou will frequently create new services, each of which will only take days or weeks to develop.\nYou cannot afford to spend a few days setting up every service.\nWhat is even worse is that in a microservice architecture there are additional cross-cutting concerns that you have to deal with including service registration and discovery, and circuit breakers for reliably handling partial failure.\n\n## Problem\n\nHow can a team quickly create and setup a maintainable code base for a production-ready service so they can start developing its business logic?\n\n## Forces\n\n- A service must implement\n - Build logic that builds, and tests the application and also packages into a production-ready format, such as a Docker container image.\n - Cross-cutting concerns such as externalized configuration, logging, health checks, metrics, service registration and discovery, circuit breakers. There are also cross-cutting concerns that are specific to the technologies that the microservices uses.\n- Creating a new microservice should be fast and easy\n- It should be fast and straightforward to update existing services when the requirements for build logic and cross-cutting concerns change.\n\n## Solution\n\nCreate a source code template that a developer can copy in order to quickly start developing a new service.\nA template is a simple runnable service that implements the required build logic and cross cutting concerns along with sample application logic.\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- a developer can quickly and easily start developing a new microservice.\n- it ensures that cross-cutting concerns are implemented in a standardized consistent way\n- it encourages developers to ‘do the right thing’\n\nThis pattern has the following drawbacks:\n\n- it’s a form of copy/paste programming.\nWhen you change the service template due to changing requirements, you must update existing services individually.\nCreating service repositories by forking the service template repository can minimize the work by leveraging Git.\nHowever, there’s a risk that services created at different points in time will diverge.\n\nThis pattern has the following issues:\n\n- you need a service template for each programming language/framework that you want to use.\nThis can be an obstacle to adopting a new programming language or framework.\n\n- [Microservice Chassis](microservice-chassis.html) - it’s either an alternative to the service template pattern; or, perhaps more likely, the service template uses a Microservice Chassis and simply contains the code and configuration that doesn’t belong in the chassis.\n\n## See also\n\n- This excellent [Service Template blog post](https://blog.thepete.net/blog/2020/09/25/service-templates-service-chassis/) by [@ph1](https://twitter.com/ph1)\n\n## Learn more\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n---\n\n[pattern](/tags/pattern) [service design](/tags/service design) [service template](/tags/service template)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 9300, "slov": 1224, "odkazu": 39, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:29", "sha256": "493284ea9e35070943766bbdaa0af15aafc5e0ac8014d143b4a0d10656efc9bf", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://blog.thepete.net/blog/2020/09/25/service-templates-service-chassis/", "https://twitter.com/ph1", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/testing/consumer-side-contract-test.html", "titulek": "Pattern: Consumer-side contract test", "h1": "Pattern: Consumer-side contract test", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Consumer-side contract test", "og:url": "http://microservices.io/patterns/testing/consumer-side-contract-test.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/testing/consumer-side-contract-test.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Consumer-side contract test", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Consumer-side contract test"}, "url": "http://microservices.io/patterns/testing/consumer-side-contract-test.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Consumer-side contract test"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Consumer-side contract test\n\n[pattern](/tags/pattern)\n\n---\n\nVerify that the client of a service can communicate with the service.\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 3429, "slov": 406, "odkazu": 27, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:23", "sha256": "b9ef5d5a9b8f0d852eb421ef97d94d7609e542d2ccd6f0a96406ba724f918e3d", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/testing/service-component-test.html", "titulek": "Pattern: Service Component Test", "h1": "Pattern: Service Component Test", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Service Component Test", "og:url": "http://microservices.io/patterns/testing/service-component-test.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/testing/service-component-test.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Service Component Test", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Service Component Test"}, "url": "http://microservices.io/patterns/testing/service-component-test.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Service Component Test"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "See also"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Service Component Test\n\n[pattern](/tags/pattern)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture](../Microservices.html) pattern.\nThe application consists of numerous services.\nServices often invoke other services.\nYou must write automated tests that verify that a service behaves correctly.\n\n## Problem\n\nHow do you easily test a service?\n\n## Forces\n\n- End to end testing (i.e. tests that launch multiple services) is difficult, slow, brittle, and expensive.\n\n## Solution\n\nA test suite that tests a service in isolation using test doubles for any services that it invokes.\n\n## Examples\n\n[Spring Cloud Contract](https://cloud.spring.io/spring-cloud-contract/) is an open source project that supports this style of testing.\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- Testing a service in isolation is easier, faster, more reliable and cheap\n\nThis pattern has the following drawbacks:\n\n- Tests might pass but the application will fail in production\n\nThis pattern has the following issues:\n\n- How to ensure that the test doubles always correctly emulate the behavior of the invoked services?\n\n- See [Service Integration Contract Test](service-integration-contract-test.html)\n\n## See also\n\n- See [Component Testing](http://martinfowler.com/articles/microservice-testing/#testing-component-introduction)\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4600, "slov": 560, "odkazu": 31, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:16", "sha256": "b9da1c2ef3a0068f8961f8334fa80920264fc38ee36766dca8608ee286f6cdb8", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://cloud.spring.io/spring-cloud-contract/", "http://martinfowler.com/articles/microservice-testing/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/testing/service-integration-contract-test.html", "titulek": "Pattern: Service Integration Contract Test", "h1": "Pattern: Service Integration Contract Test", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Service Integration Contract Test", "og:url": "http://microservices.io/patterns/testing/service-integration-contract-test.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/testing/service-integration-contract-test.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Service Integration Contract Test", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Service Integration Contract Test"}, "url": "http://microservices.io/patterns/testing/service-integration-contract-test.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Service Integration Contract Test"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "See also"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Service Integration Contract Test\n\n[pattern](/tags/pattern)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture](../Microservices.html) pattern.\nThe application consists of numerous services.\nServices often invoke other services.\nYou must write automated tests that verify that a service behaves correctly.\n\n## Problem\n\nHow to easily test that a service provides an API that its clients expect?\n\n## Forces\n\n- End to end testing (i.e. tests that launch multiple services) is difficult, slow, brittle, and expensive.\n\n## Solution\n\nA test suite for a service that is written by the developers of another service that consumes it.\nThe test suite verifies that the service meets the consuming service’s expectations.\n\n## Examples\n\n[Spring Cloud Contract](https://cloud.spring.io/spring-cloud-contract/) is an open source project that supports this style of testing.\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- Testing a service in isolation is easier, faster, more reliable and cheap\n\nThis pattern has the following drawbacks:\n\n- Tests might pass but the application will fail in production\n\nThis pattern has the following issues:\n\n- How to ensure that the consumer provided tests match what the consumer actually requires?\n\n- See [Service Component Test](service-component-test.html)\n\n## See also\n\n- See [Integration Contract Test](http://martinfowler.com/articles/microservice-testing/#testing-contract-introduction)\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4711, "slov": 577, "odkazu": 31, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:20", "sha256": "007fc54c0e9ab39ba1877df66c56b1f2945f7e97c8c30f42f5feb529e5ab7322", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://cloud.spring.io/spring-cloud-contract/", "http://martinfowler.com/articles/microservice-testing/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/ui/client-side-ui-composition.html", "titulek": "Pattern: Client-side UI composition", "h1": "Pattern: Client-side UI composition", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Client-side UI composition", "og:url": "http://microservices.io/patterns/ui/client-side-ui-composition.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/ui/client-side-ui-composition.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Client-side UI composition", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Client-side UI composition"}, "url": "http://microservices.io/patterns/ui/client-side-ui-composition.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Client-side UI composition"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Client-side UI composition\n\n[pattern](/tags/pattern)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\nServices are developed by [business capability](../decomposition/decompose-by-business-capability.html)/[subdomain](../decomposition/decompose-by-subdomain.html)-oriented teams that are also responsible for the user experience.\nSome UI screens/pages display data from multiple service.\nConsider, for example, an Amazon-style product detail page, which displays numerous data items including:\n\n- Basic information about the book such as title, author, price, etc.\n- Your purchase history for the book\n- Availability\n- Buying options\n- Other items that are frequently bought with this book\n- Other items bought by customers who bought this book\n- Customer reviews\n- Sellers ranking\n- …\n\nEach data item corresponds to a separate service and how it is displayed is, therefore, the responsibility of a different team.\n\n## Problem\n\nHow to implement a UI screen or page that displays data from multiple services?\n\n## Forces\n\n## Solution\n\nEach team develops a client-side UI component, such an AngularJS directive, that implements the region of the page/screen for their service.\nA UI team is responsible implementing the page skeletons that build pages/screens by composing multiple, service-specific UI components.\n\n- The [Server-side page fragment composition](server-side-page-fragment-composition.html) pattern is an alternative approach\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4759, "slov": 583, "odkazu": 31, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:11:19", "sha256": "8a9e0ace6388dfa9ad2be3cf55226ef00289ab0c33241137fc9b587b5ace9ad3", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "http://microservices.io/patterns/ui/server-side-page-fragment-composition.html", "titulek": "Pattern: Server-side page fragment composition", "h1": "Pattern: Server-side page fragment composition", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Server-side page fragment composition", "og:url": "http://microservices.io/patterns/ui/server-side-page-fragment-composition.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/ui/server-side-page-fragment-composition.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Server-side page fragment composition", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Server-side page fragment composition"}, "url": "http://microservices.io/patterns/ui/server-side-page-fragment-composition.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Server-side page fragment composition"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Server-side page fragment composition\n\n[pattern](/tags/pattern)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\nServices are developed by [business capability](../decomposition/decompose-by-business-capability.html)/[subdomain](../decomposition/decompose-by-subdomain.html)-oriented teams that are also responsible for the user experience.\nSome UI screens/pages display data from multiple service.\nConsider, for example, an Amazon-style product detail page, which displays numerous data items including:\n\n- Basic information about the book such as title, author, price, etc.\n- Your purchase history for the book\n- Availability\n- Buying options\n- Other items that are frequently bought with this book\n- Other items bought by customers who bought this book\n- Customer reviews\n- Sellers ranking\n- …\n\nEach data item corresponds to a separate service and how it is displayed is, therefore, the responsibility of a different team.\n\n## Problem\n\nHow to implement a UI screen or page that displays data from multiple services?\n\n## Forces\n\n## Solution\n\nEach team developers a web application that generates the HTML fragment that implements the region of the page for their service.\nA UI team is responsible for developing the page templates that build pages by performing server-side aggregation (e.g. server-side include style mechanism) of the service-specific HTML fragments.\n\n- The [Client-side UI composition](client-side-ui-composition.html) pattern is an alternative approach\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4797, "slov": 592, "odkazu": 31, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:11", "sha256": "8b51d617f5dcc71460ff018d7207d1210c668ee8915ef4f7d1ab2002e0d8071c", "hloubka": 1, "zdroj_objevu": "sitemap", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/", "titulek": "What are microservices?", "h1": "Topics", "popis": "Microservices - also known as the microservice architecture - is an architectural style that structures an application as a collection of loosely coupled services, which implement business capabilities. The microservice architecture enables the continuous delivery/deployment of large, complex applications. It also enables an organization to evolve its technology stack.", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "What are microservices?", "og:url": "http://microservices.io/index.html", "og:description": "Microservices - also known as the microservice architecture - is an architectural style that structures an application as a collection of loosely coupled services, which implement business capabilities. The microservice architecture enables the continuous delivery/deployment of large, complex applications. It also enables an organization to evolve its technology stack.", "og:image": "https://microservices.io/i/posts/pattern-thumbnails/thumbnail-microservices.png"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@id": "http://microservices.io#website", "headline": "What are Microservices?", "description": "What are Microservices? Microservices - also known as the microservice architecture - is an architectural style that structures an application as a collection of loosely coupled services, which implement business capabilities. The microservice architecture enables the continuous delivery/deployment of large, complex applications. It also enables an organization to evolve its technology stack.", "about": {"@type": "Intangible", "name": "Microservices", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "sameAs": ["https://groups.google.com/forum/#!forum/microservices", "https://twitter.com/crichardson"], "potentialAction": {"@type": "SearchAction", "target": "http://microservices.io/?s={search_term_string}", "query-input": "required name=search_term_string"}}, {"@context": "http://schema.org", "@type": "Question", "name": "What are Microservices?", "acceptedAnswer": {"@type": "Answer", "text": "Microservices - also known as the microservice architecture - is an architectural style that structures an application as a collection of loosely coupled services, which implement business capabilities. The microservice architecture enables the continuous delivery/deployment of large, complex applications. It also enables an organization to evolve its technology stack."}}, {"@context": "http://schema.org", "@type": "Question", "name": "Where to start with Microservices?", "acceptedAnswer": {"@type": "Answer", "text": "A good starting point is the Monolithic Architecture pattern, which is the traditional architectural style that is still a good choice for many applications. It does, however, have numerous limitations and issues and so a better choice for large/complex applications is the Microservice architecture pattern."}}, {"@context": "http://schema.org", "@type": "Book", "name": "Microservice Patterns", "copyrightHolder": {"@type": "Organization", "name": "Manning Publications"}, "copyrightYear": "2017", "description": "Microservice Patterns teaches enterprise developers and architects how to build applications with the microservice architecture. Rather than simply advocating for the use the microservice architecture, this clearly-written guide takes a balanced, pragmatic approach. You'll discover that the microservice architecture is not a silver bullet and has both benefits and drawbacks. Along the way, you'll learn a pattern language that will enable you to solve the issues that arise when using the microservice architecture. This book also teaches you how to refactor a monolithic application to a microservice architecture.", "genre": "Educational Materials", "inLanguage": "en-US", "isFamilyFriendly": "true", "isbn": "9781617294549", "numberOfPages": "375", "author": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris"}, "publisher": {"@type": "Organization", "name": "Manning Publications"}, "image": {"@type": "ImageObject", "url": "/i/Microservices-Patterns-Cover-published.png"}}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 3, "text": "Recent posts"}, {"uroven": 4, "text": "See all posts"}, {"uroven": 3, "text": "Support microservices.io"}, {"uroven": 2, "text": "What are microservices?"}, {"uroven": 2, "text": "New and notable"}, {"uroven": 2, "text": "Microservices enable fast flow"}, {"uroven": 2, "text": "Design microservices using Assemblage"}, {"uroven": 2, "text": "Dark energy and dark matter shape the architecture"}, {"uroven": 2, "text": "The pattern language is your guide"}, {"uroven": 2, "text": "Incrementally refactor a monolith to microservices"}, {"uroven": 1, "text": "Topics"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n### Recent posts\n\n03 Sep 2026 » [Architecting for uncertainty - part 2: fast flow defined](/post/architecture/2026/09/03/architecting-for-uncertainty-part-2.html)\n\n02 Sep 2026 » [Microservices and GenAI in 2026: my Dear Architects conversation](/post/architecture/2026/09/02/dear-architects-microservices-and-ai.html)\n\n25 Aug 2026 » [Architecting for uncertainty - part 1: thriving in a VUCA world requires frequent deployment](/post/architecture/2026/08/25/architecting-for-uncertainty-part-1.html)\n\n22 Aug 2026 » [Speed limits, GenAI coding agents and Autobahns - part 2: raising the safe speed](/post/architecture/2026/08/22/speed-limits-genai-coding-agents-autobahns-part-2.html)\n\n05 Aug 2026 » [Microservices Platforms: When Team Topologies Meets Microservices Patterns - QCONSF 2025 video](/post/architecture/2026/08/05/microservices-platforms-qconsf-2025-video.html)\n\n04 Aug 2026 » [Speed limits, GenAI coding agents and Autobahns - part 1: how fast should you go?](/post/architecture/2026/08/04/speed-limits-genai-coding-agents-autobahns-part-1.html)\n\n20 Jul 2026 » [Q&A about my Explore DDD designing microservices workshop](/post/architecture/2026/07/20/qa-explore-ddd-microservices-workshop.html)\n\n17 Jul 2026 » [Migrating a Claude Code skill from WebFetch to the new CircleCI CLI: lessons learned about tool and API design](/post/deployment-pipeline/2026/07/17/from-webfetch-to-circleci-cli-lessons-learned.html)\n\n03 Jun 2026 » [Microservices Platforms - part 8: Getting started with platforms](/post/architecture/2026/06/03/qconsf-microservices-platforms-part-8.html)\n\n19 May 2026 » [GenAI-based development platform - part 4: The coding agent sandwich pattern](/post/architecture/2026/05/19/genai-development-platform-part-4-coding-agent-sandwich-pattern.html)\n\n---\n\n#### [See all posts](/all-posts.html)\n\n### Support microservices.io\n\nPremium content is now available for paid subscribers at [premium.microservices.io](https://premium.microservices.io) .\n\n[Contact me](https://chrisrichardson.net/contactus.html) for information about consulting and training at your company.\n\nThe [MEAP for Microservices Patterns 2nd edition](https://microservices.io/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html) is now available\n\n---\n\n---\n\n## What are microservices?\n\nMicroservices - also known as the [microservice architecture](/patterns/microservices.html) - is an architectural style that structures an application as a collection of two or more services that are:\n\n- [Independently deployable](/post/architecture/2022/05/04/microservice-architecture-essentials-deployability.html)\n- [Loosely coupled](/post/architecture/2023/03/28/microservice-architecture-essentials-loose-coupling.html)\n\nServices are typically organized around business capabilities.\nEach service is often owned by a single, small team.\n\n---\n\n## New and notable\n\nMy GenAI development workflow: [Idea to Code](/post/architecture/2026/01/29/about-idea-to-code.html)\n\n---\n\nUpcoming public workshop [Designing Microservices: Responsibilities, APIs and Collaborations](https://exploreddd.com/workshops/designing-microservices.html) at Explore DDD 2026. You will learn a GenAI-assisted, structured, collaborative process for defining a microservice architecture that enables fast flow.\n\n---\n\n## Microservices enable fast flow\n\nFor a business to thrive in today’s volatile, uncertain, complex and ambiguous world, IT must deliver that software rapidly, frequently and reliably.\n\nTo do that for large complex applications you need the [success triangle](/tags/success%20triangle.html).\n\n---\n\n## Design microservices using Assemblage\n\nThe key challenge when using microservices is designing a good service architecture.\n\nIf you get it wrong you risk creating a distributed monolith, which will slow down software delivery.\n\n[Assemblage](/post/architecture/2023/02/09/assemblage-architecture-definition-process.html) is an architecture definition process for grouping subdomains/bounded contexts into services.\n\n---\n\n## Dark energy and dark matter shape the architecture\n\nAssemblage uses the [dark energy and dark matter](/post/architecture/2023/03/26/dark-energy-dark-matter-force-descriptions.html) forces to shape the service architecture.\n\nDark energy forces encourage decomposition into smaller services.\nDark matter forces resist decomposition.\n\nThe balance between these forces shapes the service architecture.\n\n---\n\n## The pattern language is your guide\n\nThe [microservices pattern language](/patterns/index.html) is your guide when designing an architecture: service collaboration, testing, deployment, common crosscutting concerns and more. It’s a collection of patterns that help you make decisions when designing and evolving an architecture.\n\n---\n\n## Incrementally refactor a monolith to microservices\n\nThe monolithic architecture is not an anti-pattern.\nIt’s a good choice for small teams and small projects.\n\nBut if you outgrow your monolithic architecture, you need to [refactor it to services using the Strangler Fig pattern](/tags/refactoring%20to%20microservices).\n\n# Topics\n\nNote: tagging is work-in-process\n\n[Cynefin](/tags/Cynefin) · \n[DDD](/tags/DDD) · \n[GitOps](/tags/GitOps) · \n[Microservices adoption](/tags/Microservices adoption) · \n[ancient lore](/tags/ancient lore) · \n[anti-patterns](/tags/anti-patterns) · \n[api gateway](/tags/api gateway) · \n[application api](/tags/application api) · \n[application architecture](/tags/application architecture) · \n[architecting](/tags/architecting) · \n[architecture](/tags/architecture) · \n[architecture documentation](/tags/architecture documentation) · \n[assemblage](/tags/assemblage) · \n[automation](/tags/automation) · \n[beer](/tags/beer) · \n[books](/tags/books) · \n[build vs buy](/tags/build vs buy) · \n[containers](/tags/containers) · \n[context engineering](/tags/context engineering) · \n[culture](/tags/culture) · \n[dark energy and dark matter](/tags/dark energy and dark matter) · \n[decision making](/tags/decision making) · \n[deliberative design](/tags/deliberative design) · \n[deployability](/tags/deployability) · \n[deployment](/tags/deployment) · \n[deployment pipeline](/tags/deployment pipeline) · \n[design-time coupling](/tags/design-time coupling) · \n[developer experience](/tags/developer experience) · \n[development](/tags/development) · \n[devops](/tags/devops) · \n[docker](/tags/docker) · \n[eventuate platform](/tags/eventuate platform) · \n[evolvability](/tags/evolvability) · \n[experimentation](/tags/experimentation) · \n[fast flow](/tags/fast flow) · \n[genAI development](/tags/genAI development) · \n[generative AI](/tags/generative AI) · \n[glossary](/tags/glossary) · \n[harness engineering](/tags/harness engineering) · \n[health](/tags/health) · \n[hexagonal architecture](/tags/hexagonal architecture) · \n[idea to code](/tags/idea to code) · \n[implementing commands](/tags/implementing commands) · \n[implementing queries](/tags/implementing queries) · \n[infrastructure as code](/tags/infrastructure as code) · \n[inter-service communication](/tags/inter-service communication) · \n[kubernetes](/tags/kubernetes) · \n[loose coupling](/tags/loose coupling) · \n[manning publications](/tags/manning publications) · \n[microservice](/tags/microservice) · \n[microservice architecture](/tags/microservice architecture) · \n[microservice chassis](/tags/microservice chassis) · \n[microservices adoption](/tags/microservices adoption) · \n[microservices platforms](/tags/microservices platforms) · \n[microservices rules](/tags/microservices rules) · \n[microservicesio updates](/tags/microservicesio updates) · \n[modifiability](/tags/modifiability) · \n[modular monolith](/tags/modular monolith) · \n[multi-architecture docker images](/tags/multi-architecture docker images) · \n[observability](/tags/observability) · \n[pattern](/tags/pattern) · \n[pattern language](/tags/pattern language) · \n[patterns](/tags/patterns) · \n[platform strategy](/tags/platform strategy) · \n[refactoring](/tags/refactoring) · \n[refactoring to microservices](/tags/refactoring to microservices) · \n[resilience](/tags/resilience) · \n[runtime coupling](/tags/runtime coupling) · \n[sagas](/tags/sagas) · \n[scripting](/tags/scripting) · \n[security](/tags/security) · \n[service api](/tags/service api) · \n[service architecture](/tags/service architecture) · \n[service blueprint](/tags/service blueprint) · \n[service collaboration](/tags/service collaboration) · \n[service design](/tags/service design) · \n[service discovery](/tags/service discovery) · \n[service granularity](/tags/service granularity) · \n[service template](/tags/service template) · \n[socio-technical architecture](/tags/socio-technical architecture) · \n[software delivery metrics](/tags/software delivery metrics) · \n[success triangle](/tags/success triangle) · \n[survey](/tags/survey) · \n[tacos](/tags/tacos) · \n[team topologies](/tags/team topologies) · \n[technical debt](/tags/technical debt) · \n[testability](/tags/testability) · \n[testing](/tags/testing) · \n[transaction management](/tags/transaction management) · \n[transactional messaging](/tags/transactional messaging) · \n[uncertainty](/tags/uncertainty) · \n[wardley mapping](/tags/wardley mapping)\n\n**[All content](/tags/index.html)**\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .", "znaku_textu": 12356, "slov": 1290, "odkazu": 142, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:10:56", "sha256": "d77eb5f25969f13fafce25bccf41f0314977874561399c928e750980added105", "hloubka": 0, "zdroj_objevu": "seed", "ze_seznamu": true, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://premium.microservices.io/", "https://chrisrichardson.net/contactus.html", "https://exploreddd.com/workshops/designing-microservices.html", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/", "titulek": "A pattern language for microservices", "h1": "A pattern language for microservices", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: A pattern language for microservices", "og:url": "http://microservices.io/patterns/"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "A pattern language for microservices", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: A pattern language for microservices"}, "url": "http://microservices.io/patterns/"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "A pattern language for microservices"}, {"uroven": 2, "text": "Architectural style"}, {"uroven": 2, "text": "Service boundaries"}, {"uroven": 2, "text": "Refactoring to services"}, {"uroven": 2, "text": "Service collaboration"}, {"uroven": 2, "text": "Transactional messaging"}, {"uroven": 2, "text": "Testing"}, {"uroven": 2, "text": "Deployment"}, {"uroven": 2, "text": "Cross-cutting concerns"}, {"uroven": 2, "text": "Communication styles"}, {"uroven": 2, "text": "External API"}, {"uroven": 2, "text": "Service discovery"}, {"uroven": 2, "text": "Reliability"}, {"uroven": 2, "text": "Security"}, {"uroven": 2, "text": "Observability"}, {"uroven": 2, "text": "UI design"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# A pattern language for microservices\n\n[pattern](/tags/pattern)\n\n---\n\nThe beginnings of a [pattern language](http://en.wikipedia.org/wiki/Pattern_language) for microservice architectures.\n\n[点击这里,访问本系列文章的中文翻译](cn/index.html)\n\n[Click here for Chinese translation of the patterns](cn/index.html)\n\n[Click here for PDF](../i/MicroservicePatternLanguage.pdf)\n\n## Architectural style\n\nWhich architectural style should you choose for an application?\n\n- [Monolithic architecture](monolithic.html) - architect an application as a single deployable unit\n- [Microservice architecture](microservices.html) - architect an application as a collection of independently deployable, loosely coupled services\n\n## Service boundaries\n\nHow to decompose an application into services?\n\n- [Decompose by business capability](decomposition/decompose-by-business-capability.html) - define services corresponding to business capabilities\n- [Decompose by subdomain](decomposition/decompose-by-subdomain.html) - define services corresponding to DDD subdomains\n- [Self-contained Service](decomposition/self-contained-service.html) - design services to handle synchronous requests without waiting for other services to respond new\n- [Service per team](/patterns/decomposition/service-per-team.html) new\n\n## Refactoring to services\n\n- [Strangler Application](/patterns/refactoring/strangler-application.html)\n- [Anti-corruption layer](/patterns/refactoring/anti-corruption-layer.html)\n\n## Service collaboration\n\nHow to implement operations that span multiple services?\n\n- [Database per Service](data/database-per-service.html) - each service has its own private database\n- [Shared database](data/shared-database.html) - services share a database\n- [Saga](data/saga.html) - use sagas, which a sequences of local transactions, to maintain data consistency across services\n- [Command-side replica](data/command-side-replica.html) - maintain a queryable replica of data in a service that implements a command\n- [API Composition](data/api-composition.html) - implement queries by invoking the services that own the data and performing an in-memory join\n- [CQRS](data/cqrs.html) - implement queries by maintaining one or more materialized views that can be efficiently queried\n- [Domain event](/patterns/data/domain-event.html) - publish an event whenever data changes\n- [Event sourcing](data/event-sourcing.html) - persist aggregates as a sequence of events\n\n## Transactional messaging\n\nHow to send messages as part of a database transaction?\n\n- [Transactional outbox](data/transactional-outbox.html)\n- [Transaction log tailing](data/transaction-log-tailing.html)\n- [Polling publisher](data/polling-publisher.html)\n\n## Testing\n\nHow to test services?\n\n- [Consumer-driven contract test](testing/service-integration-contract-test.html) - a test suite for a service that is written by the developers of another service that consumes it\n- [Consumer-side contract test](testing/service-integration-contract-test.html) - a test suite for a service client (e.g. another service) that verifies that it can communicate with the service\n- [Service component sest](testing/service-component-test.html) - a test suite that tests a service in isolation using test doubles for any services that it invokes\n\n## Deployment\n\nHow to deploy an application’s services?\n\n- [Multiple service instances per host](deployment/multiple-services-per-host.html) - deploy multiple service instances on a single host\n- [Service instance per host](deployment/single-service-per-host.html) - deploy each service instance in its own host\n- [Service instance per VM](deployment/service-per-vm.html) - deploy each service instance in its VM\n- [Service instance per Container](deployment/service-per-container.html) - deploy each service instance in its container\n- [Serverless deployment](/patterns/deployment/serverless-deployment.html) - deploy a service using serverless deployment platform\n- [Service deployment platform](/patterns/deployment/service-deployment-platform.html) - deploy services using a highly automated deployment platform that provides a service abstraction\n\n## Cross-cutting concerns\n\nHow to handle cross cutting concerns?\n\n- [Microservice chassis](/patterns/microservice-chassis.html) - a framework that handles cross-cutting concerns and simplifies the development of services\n- [Externalized configuration](/patterns/externalized-configuration.html) - externalize all configuration such as database location and credentials\n- [Service Template](/patterns/service-template.html) - a template that implements standard cross cutting concerns and is intended to be copied by a developer in order to quickly start developing a new service\n\n## Communication styles\n\nWhich mechanisms do services use to communicate with each other and their external clients?\n\n- [Remote Procedure Invocation](communication-style/rpi.html) - use an RPI-based protocol for inter-service communication\n- [Messaging](communication-style/messaging.html) - use asynchronous messaging for inter-service communication\n- [Domain-specific protocol](communication-style/domain-specific.html) - use a domain-specific protocol\n- [Idempotent Consumer](/patterns/communication-style/idempotent-consumer.html) - ensure that message consumers can cope with being invoked multiple times with the same message\n\n## External API\n\nHow do external clients communicate with the services?\n\n- [API gateway](apigateway.html) - a service that provides each client with unified interface to services\n- [Backend for front-end](apigateway.html) - a separate API gateway for each kind of client\n\n## Service discovery\n\nHow does the client of an RPI-based service discover the network location of a service instance?\n\n- [Client-side discovery](client-side-discovery.html) - client queries a service registry to discover the locations of service instances\n- [Server-side discovery](server-side-discovery.html) - router queries a service registry to discover the locations of service instances\n- [Service registry](service-registry.html) - a database of service instance locations\n- [Self registration](self-registration.html) - service instance registers itself with the service registry\n- [3rd party registration](3rd-party-registration.html) - a 3rd party registers a service instance with the service registry\n\n## Reliability\n\nHow to prevent a network or service failure from cascading to other services?\n\n- [Circuit Breaker](reliability/circuit-breaker.html) - invoke a remote service via a proxy that fails immediately when the failure rate of the remote call exceeds a threshold\n\n## Security\n\nHow to communicate the identity of the requestor to the services that handle the request?\n\n- [Access Token](security/access-token.html) - a token that securely stores information about user that is exchanged between services\n\n## Observability\n\nHow to understand the behavior of an application and troubleshoot problems?\n\n- [Log aggregation](observability/application-logging.html) - aggregate application logs\n- [Application metrics](observability/application-metrics.html) - instrument a service’s code to gather statistics about operations\n- [Audit logging](observability/audit-logging.html) - record user activity in a database\n- [Distributed tracing](observability/distributed-tracing.html) - instrument services with code that assigns each external request an unique identifier that is passed between services.\nRecord information (e.g. start time, end time) about the work (e.g. service requests) performed when handling the external request in a centralized service\n- [Exception tracking](observability/exception-tracking.html) - report all exceptions to a centralized exception tracking service that aggregates and tracks exceptions and notifies developers.\n- [Health check API](observability/health-check-api.html) - service API (e.g. HTTP endpoint) that returns the health of the service and is intended to be pinged, for example, by a monitoring service\n- [Log deployments and changes](/patterns/observability/log-deployments-and-changes.html)\n\n## UI design\n\nHow to implement a UI screen or page that displays data from multiple services?\n\n- [Server-side page fragment composition](ui/server-side-page-fragment-composition.html) - build a webpage on the server by composing HTML fragments generated by multiple, business capability/subdomain-specific web applications\n- [Client-side UI composition](ui/client-side-ui-composition.html) - Build a UI on the client by composing UI fragments rendered by multiple, business capability/subdomain-specific UI components\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 11631, "slov": 1363, "odkazu": 81, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:10:57", "sha256": "e627c155f35b94b27b44e81d693c359b2fd5d129d56cd3b02f4d3db3f0c74491", "hloubka": 0, "zdroj_objevu": "seed", "ze_seznamu": true, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "http://en.wikipedia.org/wiki/Pattern_language", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/3rd-party-registration.html", "titulek": "Pattern: 3rd Party Registration", "h1": "Pattern: 3rd Party Registration", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: 3rd Party Registration", "og:url": "http://microservices.io/patterns/3rd-party-registration.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/3rd-party-registration.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: 3rd Party Registration", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: 3rd Party Registration"}, "url": "http://microservices.io/patterns/3rd-party-registration.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: 3rd Party Registration"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: 3rd Party Registration\n\n[pattern](/tags/pattern) [inter-service communication](/tags/inter-service communication) [service discovery](/tags/service discovery)\n\n---\n\n## Context\n\nYou have applied either the [Client-side Service Discovery pattern](client-side-discovery.html) or the [Server-side Service Discovery pattern](server-side-discovery.html).\nService instances must be registered with the [service registry](service-registry.html) on startup so that they can be discovered and unregistered on shutdown.\n\n## Problem\n\nHow are service instances registered with and unregistered from the service registry?\n\n## Forces\n\n- Service instances must be registered with the service registry on startup and unregistered on shutdown\n- Service instances that crash must be unregistered from the service registry\n- Service instances that are running but incapable of handling requests must be unregistered from the service registry\n\n## Solution\n\nA 3rd party registrar is responsible for registering and unregistering a service instance with the service registry.\nWhen the service instance starts up, the registrar registers the service instance with the service registry.\nWhen the service instance shuts downs, the registrar unregisters the service instance from the service registry.\n\n## Examples\n\nExamples of the 3rd Party Registration pattern include:\n\n- [Netflix Prana](https://github.com/Netflix/Prana) - a “side car” application that runs along side a non-JVM application and registers the application with Eureka.\n- [AWS Autoscaling Groups](http://aws.amazon.com/autoscaling/) automatically (un)registers EC2 instances with Elastic Load Balancer\n- [Joyent’s Container buddy](https://github.com/joyent/containerbuddy) runs in a Docker container as the parent process for the service and registers it with the registry\n- [Registrator](https://github.com/gliderlabs/registrator) - registers and unregisters Docker containers with various service registries\n- Clustering frameworks such as [Kubernetes](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/services.md) and [Marathon](https://mesosphere.github.io/marathon/docs/service-discovery-load-balancing.html) (un)register service instances with the built-in/implicit registry\n\n## Resulting context\n\nThe benefits of the 3rd Party Registration pattern include:\n\n- The service code is less complex than when using the [Self Registration pattern](self-registration.html) since its not responsible for registering itself\n- The registrar can perform health checks on a service instance and register/unregister the instance based the health check\n\nThere are also some drawbacks:\n\n- The 3rd party registrar might only have superficial knowledge of the state of the service instance, e.g. RUNNING or NOT RUNNING and so might not know whether it can handle requests. However, as mentioned above some registrars such as Netflix Prana perform a health check in order to determine the availability of the service instance.\n- Unless the registrar is part of the infrastructure it’s another component that must be installed, configured and maintained.\nAlso, since it’s a critical system component it needs to be highly available.\n\n- [Service Registry](service-registry.html)\n- [Client Side Discovery](client-side-discovery.html)\n- [Server Side Discovery](server-side-discovery.html)\n- [Self Registration](self-registration.html) is an alternative solution\n\n---\n\n[pattern](/tags/pattern) [inter-service communication](/tags/inter-service communication) [service discovery](/tags/service discovery)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 6766, "slov": 810, "odkazu": 39, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/3rd-party-registration.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:22", "sha256": "d2d4c93cba1ac77e0c9794e00580d22ef3a4c02481581f96a5553613befd55ed", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://github.com/Netflix/Prana", "http://aws.amazon.com/autoscaling/", "https://github.com/joyent/containerbuddy", "https://github.com/gliderlabs/registrator", "https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/services.md", "https://mesosphere.github.io/marathon/docs/service-discovery-load-balancing.html", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/apigateway.html", "titulek": "Pattern: API Gateway / Backends for Frontends", "h1": "Topics", "popis": "An API gateway acts a single entry point into the application, routing and composing requests to services", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: API Gateway / Backends for Frontends", "og:image": "http://microservices.io/i/apigateway.jpg", "og:url": "http://microservices.io/patterns/apigateway.html", "og:description": "An API gateway acts a single entry point into the application, routing and composing requests to services"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/apigateway.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: API Gateway / Backends for Frontends", "description": "A pattern language for microservices", "primaryImageOfPage": {"@type": "ImageObject", "contentUrl": "http://microservices.io/i/apigateway.jpg", "representativeOfPage": "True"}, "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: API Gateway / Backends for Frontends", "description": "An API gateway acts a single entry point into the application, routing and composing requests to services", "image": {"@type": "ImageObject", "name": "The API gateway pattern", "width": "735", "height": "428", "url": "http://microservices.io/i/apigateway.jpg"}}, "url": "http://microservices.io/patterns/apigateway.html"}, {"@context": "http://schema.org", "@type": "Question", "name": "What is an API gateway?", "acceptedAnswer": {"@type": "Answer", "text": "An API gateway acts a single entry point into the application, routing and composing requests to services"}}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Variation: Backends for frontends"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "Known uses"}, {"uroven": 2, "text": "Example application"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}, {"uroven": 1, "text": "Topics"}, {"uroven": 4, "text": "The patterns"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n[pattern](/tags/pattern) [application api](/tags/application api) [inter-service communication](/tags/inter-service communication) [application architecture](/tags/application architecture)\n\n---\n\n## Context\n\nLet’s imagine you are building an online store that uses the [Microservice architecture pattern](microservices.html) and that you are implementing the product details page.\nYou need to develop multiple versions of the product details user interface:\n\n- HTML5/JavaScript-based UI for desktop and mobile browsers - HTML is generated by a server-side web application\n- Native Android and iPhone clients - these clients interact with the server via REST APIs\n\nIn addition, the online store must expose product details via a REST API for use by 3rd party applications.\n\nA product details UI can display a lot of information about a product.\nFor example, the Amazon.com details page for [POJOs in Action](http://www.amazon.com/POJOs-Action-Developing-Applications-Lightweight/dp/1932394583) displays:\n\n- Basic information about the book such as title, author, price, etc.\n- Your purchase history for the book\n- Availability\n- Buying options\n- Other items that are frequently bought with this book\n- Other items bought by customers who bought this book\n- Customer reviews\n- Sellers ranking\n- …\n\nSince the online store uses the Microservice architecture pattern the product details data is spread over multiple services. For example,\n\n- Product Info Service - basic information about the product such as title, author\n- Pricing Service - product price\n- Order service - purchase history for product\n- Inventory service - product availability\n- Review service - customer reviews\n…\n\nConsequently, the code that displays the product details needs to fetch information from all of these services.\n\n## Problem\n\nHow do the clients of a Microservices-based application access the individual services?\n\n## Forces\n\n- The granularity of APIs provided by microservices is often different than what a client needs. Microservices typically provide fine-grained APIs, which means that clients need to interact with multiple services. For example, as described above, a client needing the details for a product needs to fetch data from numerous services.\n- Different clients need different data. For example, the desktop browser version of a product details page desktop is typically more elaborate then the mobile version.\n- Network performance is different for different types of clients. For example, a mobile network is typically much slower and has much higher latency than a non-mobile network. And, of course, any WAN is much slower than a LAN.\nThis means that a native mobile client uses a network that has very difference performance characteristics than a LAN used by a server-side web application. The server-side web application can make multiple requests to backend services without impacting the user experience where as a mobile client can only make a few.\n- The number of service instances and their locations (host+port) changes dynamically\n- Partitioning into services can change over time and should be hidden from clients\n- Services might use a diverse set of protocols, some of which might not be web friendly\n\n## Solution\n\nImplement an API gateway that is the single entry point for all clients.\nThe API gateway handles requests in one of two ways.\nSome requests are simply proxied/routed to the appropriate service.\nIt handles other requests by fanning out to multiple services.\n\nRather than provide a one-size-fits-all style API, the API gateway can expose a different API for each client. For example, the [Netflix API](http://techblog.netflix.com/2012/07/embracing-differences-inside-netflix.html) gateway runs client-specific adapter code that provides each client with an API that’s best suited to its requirements.\n\nThe API gateway might also implement security, e.g. verify that the client is authorized to perform the request\n\n## Variation: Backends for frontends\n\nA variation of this pattern is the Backends for frontends pattern.\nIt defines a separate API gateway for each kind of client.\n\nIn this example, there are three kinds of clients: web application, mobile application, and external 3rd party application.\nThere are three different API gateways.\nEach one is provides an API for its client.\n\n## Examples\n\n- [Netflix API gateway](http://techblog.netflix.com/2013/01/optimizing-netflix-api.html)\n- A simple [Java/Spring API gateway](https://github.com/cer/event-sourcing-examples/tree/master/java-spring/api-gateway-service) from the [Money Transfer example application](https://github.com/cer/event-sourcing-examples) .\n\n## Resulting context\n\nUsing an API gateway has the following benefits:\n\n- Insulates the clients from how the application is partitioned into microservices\n- Insulates the clients from the problem of determining the locations of service instances\n- Provides the optimal API for each client\n- Reduces the number of requests/roundtrips. For example, the API gateway enables clients to retrieve data from multiple services with a single round-trip. Fewer requests also means less overhead and improves the user experience. An API gateway is essential for mobile applications.\n- Simplifies the client by moving logic for calling multiple services from the client to API gateway\n- Translates from a “standard” public web-friendly API protocol to whatever protocols are used internally\n\nThe API gateway pattern has some drawbacks:\n\n- Increased complexity - the API gateway is yet another moving part that must be developed, deployed and managed\n- Increased response time due to the additional network hop through the API gateway - however, for most applications the cost of an extra roundtrip is insignificant.\n\nIssues:\n\n- How implement the API gateway? An event-driven/reactive approach is best if it must scale to scale to handle high loads. On the JVM, NIO-based libraries such as Netty, Spring Reactor, etc. make sense. NodeJS is another option.\n\n- The [Microservice architecture pattern](microservices.html) creates the need for this pattern.\n- The API gateway must use either the [Client-side Discovery pattern](client-side-discovery.html) or [Server-side Discovery pattern](server-side-discovery.html) to route requests to available service instances.\n- The API Gateway may authenticate the user and pass an [Access Token](security/access-token.html) containing information about the user to the services\n- An API Gateway will use a [Circuit Breaker](reliability/circuit-breaker.html) to invoke services\n- An API gateway often implements the [API Composition pattern](/patterns/data/api-composition.html)\n\n## Known uses\n\n- [Netflix API gateway](http://techblog.netflix.com/2012/07/embracing-differences-inside-netflix.html)\n\n## Example application\n\nSee the API Gateway that part of my Microservices pattern’s [example application](https://github.com/microservice-patterns/ftgo-application).\nIt’s implemented using Spring Cloud Gateway.\n\n---\n\n[pattern](/tags/pattern) [application api](/tags/application api) [inter-service communication](/tags/inter-service communication) [application architecture](/tags/application architecture)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)\n\n# Topics\n\nNote: tagging is work-in-process\n\n[Cynefin](/tags/Cynefin) · \n[DDD](/tags/DDD) · \n[GitOps](/tags/GitOps) · \n[Microservices adoption](/tags/Microservices adoption) · \n[ancient lore](/tags/ancient lore) · \n[anti-patterns](/tags/anti-patterns) · \n[api gateway](/tags/api gateway) · \n[application api](/tags/application api) · \n[application architecture](/tags/application architecture) · \n[architecting](/tags/architecting) · \n[architecture](/tags/architecture) · \n[architecture documentation](/tags/architecture documentation) · \n[assemblage](/tags/assemblage) · \n[automation](/tags/automation) · \n[beer](/tags/beer) · \n[books](/tags/books) · \n[build vs buy](/tags/build vs buy) · \n[containers](/tags/containers) · \n[context engineering](/tags/context engineering) · \n[culture](/tags/culture) · \n[dark energy and dark matter](/tags/dark energy and dark matter) · \n[decision making](/tags/decision making) · \n[deliberative design](/tags/deliberative design) · \n[deployability](/tags/deployability) · \n[deployment](/tags/deployment) · \n[deployment pipeline](/tags/deployment pipeline) · \n[design-time coupling](/tags/design-time coupling) · \n[developer experience](/tags/developer experience) · \n[development](/tags/development) · \n[devops](/tags/devops) · \n[docker](/tags/docker) · \n[eventuate platform](/tags/eventuate platform) · \n[evolvability](/tags/evolvability) · \n[experimentation](/tags/experimentation) · \n[fast flow](/tags/fast flow) · \n[genAI development](/tags/genAI development) · \n[generative AI](/tags/generative AI) · \n[glossary](/tags/glossary) · \n[harness engineering](/tags/harness engineering) · \n[health](/tags/health) · \n[hexagonal architecture](/tags/hexagonal architecture) · \n[idea to code](/tags/idea to code) · \n[implementing commands](/tags/implementing commands) · \n[implementing queries](/tags/implementing queries) · \n[infrastructure as code](/tags/infrastructure as code) · \n[inter-service communication](/tags/inter-service communication) · \n[kubernetes](/tags/kubernetes) · \n[loose coupling](/tags/loose coupling) · \n[manning publications](/tags/manning publications) · \n[microservice](/tags/microservice) · \n[microservice architecture](/tags/microservice architecture) · \n[microservice chassis](/tags/microservice chassis) · \n[microservices adoption](/tags/microservices adoption) · \n[microservices platforms](/tags/microservices platforms) · \n[microservices rules](/tags/microservices rules) · \n[microservicesio updates](/tags/microservicesio updates) · \n[modifiability](/tags/modifiability) · \n[modular monolith](/tags/modular monolith) · \n[multi-architecture docker images](/tags/multi-architecture docker images) · \n[observability](/tags/observability) · \n[pattern](/tags/pattern) · \n[pattern language](/tags/pattern language) · \n[patterns](/tags/patterns) · \n[platform strategy](/tags/platform strategy) · \n[refactoring](/tags/refactoring) · \n[refactoring to microservices](/tags/refactoring to microservices) · \n[resilience](/tags/resilience) · \n[runtime coupling](/tags/runtime coupling) · \n[sagas](/tags/sagas) · \n[scripting](/tags/scripting) · \n[security](/tags/security) · \n[service api](/tags/service api) · \n[service architecture](/tags/service architecture) · \n[service blueprint](/tags/service blueprint) · \n[service collaboration](/tags/service collaboration) · \n[service design](/tags/service design) · \n[service discovery](/tags/service discovery) · \n[service granularity](/tags/service granularity) · \n[service template](/tags/service template) · \n[socio-technical architecture](/tags/socio-technical architecture) · \n[software delivery metrics](/tags/software delivery metrics) · \n[success triangle](/tags/success triangle) · \n[survey](/tags/survey) · \n[tacos](/tags/tacos) · \n[team topologies](/tags/team topologies) · \n[technical debt](/tags/technical debt) · \n[testability](/tags/testability) · \n[testing](/tags/testing) · \n[transaction management](/tags/transaction management) · \n[transactional messaging](/tags/transactional messaging) · \n[uncertainty](/tags/uncertainty) · \n[wardley mapping](/tags/wardley mapping)\n\n**[All content](/tags/index.html)**\n\n---\n\n#### The patterns\n\n[How to apply the patterns](/articles/applying.html)\n\nApplication architecture patterns\n\n- [Monolithic architecture](/patterns/monolithic.html)\n- [Microservice architecture](/patterns/microservices.html)\n\nDecomposition\n\n- [Decompose by business capability](/patterns/decomposition/decompose-by-business-capability.html)\n- [Decompose by subdomain](/patterns/decomposition/decompose-by-subdomain.html)\n- [Self-contained Service](/patterns/decomposition/self-contained-service.html) new\n- [Service per team](/patterns/decomposition/service-per-team.html) new\n\nRefactoring to microservicesnew\n\n- [Strangler Application](/patterns/refactoring/strangler-application.html)\n- [Anti-corruption layer](/patterns/refactoring/anti-corruption-layer.html)\n\nData management\n\n- [Database per Service](/patterns/data/database-per-service.html)\n- [Shared database](/patterns/data/shared-database.html)\n- [Saga](/patterns/data/saga.html)\n- [Command-side replica](/patterns/data/command-side-replica.html)\n- [API Composition](/patterns/data/api-composition.html)\n- [CQRS](/patterns/data/cqrs.html)\n- [Domain event](/patterns/data/domain-event.html)\n- [Event sourcing](/patterns/data/event-sourcing.html)\n\nTransactional messaging\n\n- [Transactional outbox](/patterns/data/transactional-outbox.html)\n- [Transaction log tailing](/patterns/data/transaction-log-tailing.html)\n- [Polling publisher](/patterns/data/polling-publisher.html)\n\nTesting\n\n- [Service Component Test](/patterns/testing/service-component-test.html)\n- [Consumer-driven contract test](/patterns/testing/service-integration-contract-test.html)\n- [Consumer-side contract test](/patterns/testing/consumer-side-contract-test.html)\n\nDeployment patterns\n\n- [Multiple service instances per host](/patterns/deployment/multiple-services-per-host.html)\n- [Service instance per host](/patterns/deployment/single-service-per-host.html)\n- [Service instance per VM](/patterns/deployment/service-per-vm.html)\n- [Service instance per Container](/patterns/deployment/service-per-container.html)\n- [Serverless deployment](/patterns/deployment/serverless-deployment.html)\n- [Service deployment platform](/patterns/deployment/service-deployment-platform.html)\n\nCross cutting concerns\n\n- [Microservice chassis](/patterns/microservice-chassis.html)\n- [Service Template](/patterns/service-template.html)\n- [Externalized configuration](/patterns/externalized-configuration.html)\n\nCommunication style\n\n- [Remote Procedure Invocation](/patterns/communication-style/rpi.html)\n- [Messaging](/patterns/communication-style/messaging.html)\n- [Domain-specific protocol](/patterns/communication-style/domain-specific.html)\n- [Idempotent Consumer](/patterns/communication-style/idempotent-consumer.html)\n\nExternal API\n\n- [API gateway](/patterns/apigateway.html)\n- [Backend for front-end](/patterns/apigateway.html)\n\nService discovery\n\n- [Client-side discovery](/patterns/client-side-discovery.html)\n- [Server-side discovery](/patterns/server-side-discovery.html)\n- [Service registry](/patterns/service-registry.html)\n- [Self registration](/patterns/self-registration.html)\n- [3rd party registration](/patterns/3rd-party-registration.html)\n\nReliability\n\n- [Circuit Breaker](/patterns/reliability/circuit-breaker.html)\n\nSecurity\n\n- [Access Token](/patterns/security/access-token.html)\n\nObservability\n\n- [Log aggregation](/patterns/observability/application-logging.html)\n- [Application metrics](/patterns/observability/application-metrics.html)\n- [Audit logging](/patterns/observability/audit-logging.html)\n- [Distributed tracing](/patterns/observability/distributed-tracing.html)\n- [Exception tracking](/patterns/observability/exception-tracking.html)\n- [Health check API](/patterns/observability/health-check-api.html)\n- [Log deployments and changes](/patterns/observability/log-deployments-and-changes.html)\n\nUI patterns\n\n- [Server-side page fragment composition](/patterns/ui/server-side-page-fragment-composition.html)\n- [Client-side UI composition](/patterns/ui/client-side-ui-composition.html)", "znaku_textu": 18384, "slov": 1955, "odkazu": 183, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/apigateway.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:17", "sha256": "3ec9337430c607d6a881386d43835ed779174b6d901f51e1239ee9d5f06b3d72", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "http://www.amazon.com/POJOs-Action-Developing-Applications-Lightweight/dp/1932394583", "http://techblog.netflix.com/2012/07/embracing-differences-inside-netflix.html", "http://techblog.netflix.com/2013/01/optimizing-netflix-api.html", "https://github.com/cer/event-sourcing-examples/tree/master/java-spring/api-gateway-service", "https://github.com/cer/event-sourcing-examples", "https://github.com/microservice-patterns/ftgo-application", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/client-side-discovery.html", "titulek": "Pattern: Client-side service discovery", "h1": "Pattern: Client-side service discovery", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Client-side service discovery", "og:url": "http://microservices.io/patterns/client-side-discovery.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/client-side-discovery.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Client-side service discovery", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Client-side service discovery"}, "url": "http://microservices.io/patterns/client-side-discovery.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Client-side service discovery"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Client-side service discovery\n\n[pattern](/tags/pattern) [inter-service communication](/tags/inter-service communication) [service discovery](/tags/service discovery)\n\n---\n\n## Context\n\nServices typically need to call one another.\nIn a monolithic application, services invoke one another through language-level method or procedure calls.\nIn a traditional distributed system deployment, services run at fixed, well known locations (hosts and ports) and so can easily call one another using HTTP/REST or some RPC mechanism.\nHowever, a modern [microservice-based](microservices.html) application typically runs in a virtualized or containerized environments where the number of instances of a service and their locations changes dynamically.\n\nConsequently, you must implement a mechanism for that enables the clients of service to make requests to a dynamically changing set of ephemeral service instances.\n\n## Problem\n\nHow does the client of a service - the API gateway or another service - discover the location of a service instance?\n\n## Forces\n\n- Each instance of a service exposes a remote API such as HTTP/REST, or Thrift etc. at a particular location (host and port)\n- The number of services instances and their locations changes dynamically.\n- Virtual machines and containers are usually assigned dynamic IP addresses.\n- The number of services instances might vary dynamically. For example, an EC2 Autoscaling Group adjusts the number of instances based on load.\n\n## Solution\n\nWhen making a request to a service, the client obtains the location of a service instance by querying a [Service Registry](service-registry.html), which knows the locations of all service instances.\n\nThe following diagram shows the structure of this pattern.\n\nThis is typically handled by a [Microservice chassis framework](microservice-chassis.html)\n\n## Examples\n\nThe [Microservices Example application](https://github.com/cer/microservices-examples) is an example of an application that uses client-side service discovery.\nIt is written in Scala and uses Spring Boot and Spring Cloud as the [Microservice chassis](microservice-chassis.html).\nThey provide various capabilities including client-side discovery.\n\n`RegistrationServiceProxy` is a component of that application.\nIn order to register a user, it invokes another service using the Spring Framework’s `RestTemplate`:\n\n```\n@Component class RegistrationServiceProxy @Autowired()(restTemplate: RestTemplate) extends RegistrationService { @Value(\"${user_registration_url}\") var userRegistrationUrl: String = _ override def registerUser(emailAddress: String, password: String): Either[RegistrationError, String] = { val response = restTemplate.postForEntity(userRegistrationUrl, RegistrationBackendRequest(emailAddress, password), classOf[RegistrationBackendResponse]) ... } \n```\n\nIt is injected with the RestTemplate and the `user_registration_url`, which specifies the REST endpoint.\n\nWhen the application is deployed `user_registration_url` is set to this URL `http://REGISTRATION-SERVICE/user` - see the `docker-compose.yml` file. `REGISTRATION-SERVICE` is the logical service name that is resolved to a network location using client-side service discovery.\nThe service discovery is implemented using [Netflix OSS](http://netflix.github.io/) components.\nIt provides [Eureka](https://github.com/Netflix/eureka/wiki/Eureka-at-a-glance), which is a [Service Registry](service-registry.html), and [Ribbon](https://github.com/Netflix/ribbon), which is an HTTP client that queries Eureka in order to route HTTP requests to an available service instance.\n\nClient-side service discovery is configured using various Spring Cloud annotations:\n\n```\n@Configuration @EnableEurekaClient @Profile(Array(\"enableEureka\")) class EurekaClientConfiguration { @Bean @LoadBalanced def restTemplate(scalaObjectMapper : ScalaObjectMapper) : RestTemplate = { val restTemplate = new RestTemplate() restTemplate.getMessageConverters foreach { case mc: MappingJackson2HttpMessageConverter => mc.setObjectMapper(scalaObjectMapper) case _ => } restTemplate } \n```\n\nThe `@EnableEurekaClient` annotation enables the Eureka client.\nThe `@LoadBalanced` annotation configures the `RestTemplate` to use Ribbon, which has been configured to use the Eureka client to do service discovery.\nAs a result, the `RestTemplate` will handle requests to the `http://REGISTRATION-SERVICE/user` endpoint by querying Eureka to find the network locations of available service instances.\n\n## Resulting context\n\nClient-side discovery has the following benefits:\n\n- Fewer moving parts and network hops compared to [Server-side Discovery](server-side-discovery.html)\n\nClient-side discovery also has the following drawbacks:\n\n- This pattern couples the client to the [Service Registry](service-registry.html)\n- You need to implement client-side service discovery logic for each programming language/framework used by your application, e.g Java/Scala, JavaScript/NodeJS.\nFor example, [Netflix Prana](https://github.com/Netflix/Prana) provides an HTTP proxy-based approach to service discovery for non-JVM clients.\n\n- [Service Registry](service-registry.html) - an essential part of service discovery\n- [Microservice chassis](microservice-chassis.html) - Client-side service discovery is the responsibility the microservice chassis framework\n- [Server Side Discovery](server-side-discovery.html) is an alternative solution to this problem.\n\n---\n\n[pattern](/tags/pattern) [inter-service communication](/tags/inter-service communication) [service discovery](/tags/service discovery)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 8741, "slov": 1055, "odkazu": 38, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/client-side-discovery.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:19", "sha256": "490cf5d0b24a1f72d5932ed5f359803a6d533508e7a8bea7c76a2d8c20f1a23d", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://github.com/cer/microservices-examples", "http://netflix.github.io/", "https://github.com/Netflix/eureka/wiki/Eureka-at-a-glance", "https://github.com/Netflix/ribbon", "https://github.com/Netflix/Prana", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/cn/3rd-party-registration.html", "titulek": "3rd Party Registration Pattern", "h1": "模式: 第三方注册", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "模式: 第三方注册"}, {"uroven": 2, "text": "背景"}, {"uroven": 2, "text": "问题"}, {"uroven": 2, "text": "需求"}, {"uroven": 2, "text": "方案"}, {"uroven": 2, "text": "示例"}, {"uroven": 2, "text": "结果"}, {"uroven": 2, "text": "相关模式"}, {"uroven": 2, "text": "致谢"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# 模式: 第三方注册\n\n## 背景\n\n如采用[客户端服务发现模式](client-side-discovery.html)或者[服务器端服务发现模式](client-side-discovery.html),各服务实例必须在启动时注册至服务注册表,从而保证其能够被获取,并在关闭时进行注销。\n\n## 问题\n\n如何在服务注册表内注册和注销服务实例?\n\n## 需求\n\n- 各服务实例必须在启动时被注册至服务注册表,并在关闭时进行注销。\n- 崩溃的服务实例必须从服务注册表中注销。\n- ĺœ¨čżčĄŒä˝†ć— ĺŠ›ĺ¤„ç†čŻˇćą‚çš„ćœĺŠĄĺŽžäž‹ĺż…éĄťäťŽćœĺŠĄćł¨ĺ†ŒčĄ¨ä¸­ćł¨é”€ă€‚\n\n## 方案\n\n由第三方注册机制负责各项服务实例在服务注册表中的注册与注销。当该服务实例启动时,其将服务实例注册至服务注册表。而在服务实例关闭时,其将该服务实例从服务注册表中注销。\n\n## 示例\n\n第三方注册模式的示例包括:\n\n- [Netflix Prana](https://github.com/Netflix/Prana) - 这是一款“边车”类应用,可与非JVM应用共同运行并利用Eureka为该应用注册。\n- [AWS Autoscaling Groups](http://aws.amazon.com/autoscaling/) - 能够自动将EC2实例注册(注销)至Elastic Load Balancer。\n- [Joyent的Container buddy](https://github.com/joyent/containerbuddy) 运行在Docker容器当中,作为服务的父进程并将其注册至注册表。\n- [Registrator](https://github.com/gliderlabs/registrator) - 能够将Docker容器注册至多种服务注册表,或者从其注销。\n- [䝼Kubernetes](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/services.md) 与 [Marathon](https://mesosphere.github.io/marathon/docs/service-discovery-load-balancing.html) 为代表的各类集群框架将服务实例注册至内置/隐式的注册表,或者从其注销。\n\n## 结果\n\n第三方注册模式的优势在于:\n\n- 与 [自注册](self-registration.html) ć¨Ąĺźç›¸ćŻ”ďźŒćœĺŠĄäťŁç ĺ¤ć‚ç¨‹ĺşŚć›´ä˝ŽďźŒĺ› ä¸şĺ…ść— éœ€ĺŽžçŽ°č‡ŞĺŠ¨ćł¨ĺ†Œă€‚\n- ćł¨ĺ†ŒĺˇĽĺ…ˇĺŻĺŻšćœĺŠĄĺŽžäž‹ć‰§čĄŒĺĽĺşˇćŁ€ćŸĽďźŒĺšść šćŽćŁ€ćŸĽçť“ćžœćł¨ĺ†Œćˆ–č€…ćł¨é”€čŻĽĺŽžäž‹ă€‚\n\n但第三方注册模式也存在着以下弊端:\n\n- çŹŹä¸‰ć–šćł¨ĺ†Œć¨ĄĺźĺŻčƒ˝ĺŞäş†č§ŁćœĺŠĄĺŽžäž‹çš„ä¸€äş›čĄ¨ĺą‚çŠść€ďźŒäž‹ĺŚ‚ĺ…ść˜ŻĺŚć­Łĺœ¨čżčĄŒďźŒĺ› ć­¤ ć— ćł•äş†č§Łĺ…ść˜ŻĺŚčƒ˝ĺ¤Ÿĺ¤„ç†čŻˇćą‚ă€‚ä¸čż‡ďźŒäš‹ĺ‰ćĺˆ°çš„Netflix Prana等注册工具能够通过执行健康检查来判断当前服务实例的可用性。\n- é™¤éžčŻĽćł¨ĺ†ŒĺˇĽĺ…ˇĺąžäşŽĺŸşçĄ€čŽžć–˝çš„ä¸€éƒ¨ĺˆ†ďźŒĺŚĺˆ™ćˆ‘äťŹéœ€čŚĺŻšĺ…śčż›čĄŒĺŽ‰čŁ…ă€é…ç˝Žä¸Žçť´ćŠ¤ă€‚ĺŚĺ¤–ďźŒĺ› ä¸şĺŽƒć˜Żĺ…łé”ŽçłťçťŸçť„äťśďźŒĺ› ć­¤éœ€čŚäżčŻĺ…śĺ…ˇćœ‰éŤ˜ĺşŚĺŻç”¨ć€§ă€‚\n\n## 相关模式\n\n- [服务注册表](service-registry.html)\n- [客户端服务发现](client-side-discovery.html)\n- [服务器端服务发现](server-side-discovery.html)\n- [自注册](self-registration.html) 是一个备选方案。\n\n## 致谢\n\nä¸şäş†éżĺ…é‡ĺ¤çżťčŻ‘ďźŒćœŹć–‡ć šćŽä¸­ĺ›˝ć™Žĺ…ƒĺ…Źĺ¸ĺŽ‹ć˝‡ć–‡ĺ…ˆç”Ÿçš„[译文](http://blog.csdn.net/xn_sung/article/details/52336777)整理修订,在此向宋潇文先生表示感谢!\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 8069, "slov": 339, "odkazu": 69, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/3rd-party-registration.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:27", "sha256": "eeb3039f2c078672e1f1ae3e325ffad20759e32d3289f52bd7b8469db722e3ed", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://github.com/Netflix/Prana", "http://aws.amazon.com/autoscaling/", "https://github.com/joyent/containerbuddy", "https://github.com/gliderlabs/registrator", "https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/services.md", "https://mesosphere.github.io/marathon/docs/service-discovery-load-balancing.html", "http://blog.csdn.net/xn_sung/article/details/52336777", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/apigateway.html", "titulek": "API gateway pattern", "h1": "模式:API 网关", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "模式:API 网关"}, {"uroven": 2, "text": "背景"}, {"uroven": 2, "text": "问题"}, {"uroven": 2, "text": "需求"}, {"uroven": 2, "text": "方案"}, {"uroven": 2, "text": "示例"}, {"uroven": 2, "text": "结果"}, {"uroven": 2, "text": "相关模式"}, {"uroven": 2, "text": "已知用例"}, {"uroven": 2, "text": "致谢"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# 模式:API 网关\n\n## 背景\n\n假设我们正在利用[微服务模式](microservices.html)构建一套在线商店,并要包含产品细节页面,需要为产品信息用户界面开发出多个版本:\n\n- 基于HTML5/JavaScript的用户界面,用于桌面与移动浏览器 —— HTML由服务器端Web应用生成。\n- 原生Android与iPhone客户端——这些客户端通过REST API与服务器进行交互。\n\n另外,在线商店必须通过REST API发布产品细节,以供第三方应用程序使用。\n\n产品细节UI可以显示出大量产品信息。举例来说,Amazon.com的 POJOs in Action 图书详情页面中会显示:\n\n- ć­¤äšŚçš„ĺŸşćœŹäżĄćŻďźŒĺŚ‚ć ‡é˘˜ă€ä˝œč€…ă€äťˇć źç­‰\n- 书籍的购买记录\n- 库存\n- 购买选项\n- 经常与此书籍搭配购买的货品\n- 买过此书的买家经常购买的其它货品\n- 客户评论\n- 卖家排名\n- ……\n\n在使用微服务模式的在线商店中,产品详情数据会分布在多项服务之间,例如:\n\n- äş§ĺ“äżĄćŻćœĺŠĄâ€”äş§ĺ“çš„ĺŸşćœŹäżĄćŻďźŒĺŚ‚ć ‡é˘˜ä¸Žä˝œč€…ç­‰\n- äťˇć źćœĺŠĄâ€”äş§ĺ“äťˇć ź\n- 订单服务—产品的购买历史\n- 库存服务—当前产品的可购买数量\n- 评论服务—客户评论\n- ……\n\nĺ› ć­¤ďźŒć˜žç¤şäş§ĺ“čŻŚćƒ…çš„äťŁç éœ€čŚäťŽčż™äş›ćœĺŠĄä¸­čŽˇĺ–äżĄćŻă€‚\n\n## 问题\n\n微服务架构的应用客户端如何访问各项服务?\n\n## 需求\n\n- 微服务提供的API粒度通常与客户端需要的有所不同。微服务通常提供的是细粒度API,这意味着客户端需要同多项服务进行交互。举例来说,如之前所提到的,客户端需要从多项服务处获取数据方可获得产品详情。\n- 不同客户端需要不同的数据。举例来说,有产品详情页面的桌面浏览器版本通常较移动版复杂。\n- 不同客户端的网络性能亦有所区别。举例来说,移动网络通常较非移动网络速度更慢且更延迟。当然,广域网速度也必然低于局域网。这意味着原生移动客户端所使用的网络在性能上与服务器端Web应用采用的局域网完全不同。服务器端Web应用能够向后端服务发送多条请求,而且不会影响到用户体验,但移动客户端则只能发送少量请求。\n- 服务实例数量与其位置(主机与端口)会发生动态变化。\n- 服务的划分方式会随时间的推移而改变,且不应被客户端所感知。\n\n## 方案\n\n使用 API 网关作为全部客户端的单一入口点。该 API 网关通过以下两种方式之一处理请求。部分请求会被直接代理/路由至对应的服务,另一部分请求则需要接入多项服务。\n\n相比提供满足所有需求的API,API网关可以针对不同客户端提供出不同的API。举例来说,[Netflix API 网关](http://techblog.netflix.com/2012/07/embracing-differences-inside-netflix.html)čżčĄŒçš„ć˜ŻĺŽ˘ćˆˇçŤŻç‰šĺŽšé€‚é…äťŁç ďźŒčż™ç§äťŁç čƒ˝ĺ¤Ÿä¸şĺ„ĺŽ˘ćˆˇçŤŻćäž›ćœ€çŹŚĺˆĺ…śéœ€ćą‚çš„API。\n\nAPI网关还能够实现安全防护,例如验证当前客户端是否有权执行该请求。\n\n## 示例\n\n[Netflix 的 API 网关](http://techblog.netflix.com/2013/01/optimizing-netflix-api.html)\n\n## 结果\n\nAPI网关有以下优势:\n\n- çĄŽäżĺŽ˘ćˆˇçŤŻć— ćł•ĺŻŸč§‰ĺş”ç”¨ç¨‹ĺşć˜ŻĺŚ‚ä˝•č˘Ťć‹†ĺˆ†ä¸şĺ¤šéĄšĺžŽćœĺŠĄçš„ă€‚\n- 确保客户端不受服务实例的位置的影响。\n- 为每套客户端提供最优API。\n- 降低请求/往返次数。举例来说,API网关能够确保客户端在单次往返中就从多项服务中检索出数据。请求数量更少意味着运行负担更低且用户体验更好。API网关对于移动应用而言是必不可少的。\n- 将从客户端调用多项服务的逻辑转换为从API网关处调用,从而简化整个客户端。\n\nAPI网关模式也有一些弊端:\n\n- 复杂性高—API网关是另外一种需要开发、部署与管理的活动部件。\n- APIç˝‘ĺ…łäźšé€ ćˆĺ¤šä˝™çš„ç˝‘çťœčˇłč˝ŹďźŒäťŽč€Œĺ˘žĺŠ ĺ“ĺş”ć—śé—´â€”ä¸čż‡ĺŻšäşŽĺ¤§ĺ¤šć•°ĺş”ç”¨ç¨‹ĺşč€Œč¨€ďźŒä¸€ćŹĄĺ¤šä˝™çš„ĺž€čż”ĺšśä¸äźšé€ ćˆäť€äšˆĺ˝ąĺ“ă€‚\n\n问题:\n\n- 如何实现API网关?如果需要不断扩展以处理高负载量,那么事件驱动型/响应型方案是最理想的选择。在JVM上,Netty、Spring Reactor等基于NIO的库大有用处。Node.JS也是一个可行的选项。\n\n## 相关模式\n\n- [微服务架构模式](microservices.html) 催生了 API 网关模式。\n- API 网关必须使用 [客户端服务发现模式](client-side-discovery.html) 或 [服务器端服务发现模式](server-side-discovery.html) 将请求路由到可用的服务实例。\n- API ç˝‘ĺ…łĺż…éĄťĺż…éĄťéŞŒčŻç”¨ćˆˇčşŤäť˝ĺšśĺœ¨ćœĺŠĄč°ƒç”¨äš‹é—´äź é€’ĺŒ…ć‹Źç”¨ćˆˇäżĄćŻçš„ [访问令牌](security/access-token.html) 。\n- API 网关对服务的调用都会经过一个 [断路器](reliability/circuit-breaker.html) 。\n\n## 已知用例\n\n- [Netflix 的 API 网关](http://techblog.netflix.com/2012/07/embracing-differences-inside-netflix.html)\n\n## 致谢\n\nä¸şäş†éżĺ…é‡ĺ¤çżťčŻ‘ďźŒćœŹć–‡ć šćŽä¸­ĺ›˝ć™Žĺ…ƒĺ…Źĺ¸ĺŽ‹ć˝‡ć–‡ĺ…ˆç”Ÿçš„[译文](http://blog.csdn.net/xn_sung/article/details/52318969)整理修订,在此向宋潇文先生表示感谢!\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 10129, "slov": 402, "odkazu": 66, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/apigateway.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:21", "sha256": "290da751995531c1b520dfc54c4d7ebb7b24351db4c9edd5277b8a5b799cbdb1", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "http://techblog.netflix.com/2012/07/embracing-differences-inside-netflix.html", "http://techblog.netflix.com/2013/01/optimizing-netflix-api.html", "http://blog.csdn.net/xn_sung/article/details/52318969", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/client-side-discovery.html", "titulek": "Client-side service discovery pattern", "h1": "模式: 客户端服务发现", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "模式: 客户端服务发现"}, {"uroven": 2, "text": "背景"}, {"uroven": 2, "text": "问题"}, {"uroven": 2, "text": "需求"}, {"uroven": 2, "text": "方案"}, {"uroven": 2, "text": "例子"}, {"uroven": 2, "text": "结果"}, {"uroven": 2, "text": "相关模式"}, {"uroven": 2, "text": "致谢"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# 模式: 客户端服务发现\n\n## 背景\n\nä¸ĺŒćœĺŠĄäš‹é—´é€šĺ¸¸éœ€čŚç›¸äş’č°ƒç”¨ă€‚ĺœ¨ĺ•ä˝“ĺş”ç”¨ç¨‹ĺşĺ˝“ä¸­ďźŒćœĺŠĄé—´é€ščż‡čŻ­č¨€ĺą‚çş§çš„ć–šćł•ćˆ–č€…čż‡ç¨‹ĺŽžçŽ°ç›¸äş’č°ƒç”¨ă€‚ĺœ¨äź çťŸçš„ĺˆ†ĺ¸ƒĺźçłťçťŸéƒ¨ç˝˛ä¸‹ďźŒćœĺŠĄĺœ¨ĺ›şĺŽšĺšśä¸”ĺˇ˛çŸĽçš„ä˝ç˝Žďźˆä¸ťćœşä¸ŽçŤŻĺŁďź‰čżčĄŒďźŒäťŽč€ŒçĄŽäżĺ„ćœĺŠĄĺŻĺˆŠç”¨HTTP/REST或者某种RPC机制进行相互调用。然而,现代化[微服务应用程序](microservices.html)ä¸­é€šĺ¸¸ĺœ¨č™šć‹ŸĺŒ–ćˆ–č€…ĺŽšĺ™¨ĺŒ–çŽŻĺ˘ƒä¸­čżčĄŒďźŒĺœ¨čż™ć ˇçš„çŽŻĺ˘ƒä¸­ćœĺŠĄçš„ĺŽžäž‹ć•°é‡ĺ’Œä˝ç˝Žć˜ŻĺŠ¨ć€ĺ˜ĺŒ–çš„ă€‚\n\nĺ› ć­¤ďźŒčŚćƒłĺŽžçŽ°ĺŽ˘ćˆˇçŤŻĺ‘ĺŠ¨ć€ĺ˜ĺŒ–çš„ä¸€çť„ćœĺŠĄçŤŻĺŽžäž‹ĺ‘é€čŻˇćą‚ďźŒćˆ‘äťŹĺż…éĄťé‡‡ç”¨ć–°çš„ćœşĺˆśă€‚\n\n## 问题\n\n服务的客户端——包括API网关或者其它服务——如何才能获取服务端实例的位置?\n\n## 需求\n\n- 每一服务实例都会在特定位置(主机与端口)通过HTTP/REST或者Thrift等方式发布一个远程API。\n- 服务端实例的具体数量及位置会发生动态变化。\n- 虚拟机与容器通常会被分配动态IP地址。\n- 服务实例的数量会发生动态变化。例如,ECč‡ŞĺŠ¨äź¸çźŠçť„äźšć šćŽč´Ÿč˝˝ćƒ…ĺ†ľéšć—śč°ƒć•´ĺŽžäž‹ć•°é‡ă€‚\n\n## 方案\n\n在向某一服务发送请求时,客户端会通过查询 Service Registry,即[服务注册表](service-registry.html),以获取该服务实例的位置。该注册表中包含全部服务的位置。\n\n以下示意图展现了这种模式的结构:\n\n而这正是[微服务基底框架](microservice-chassis.html)的典型处理方式。\n\n## 例子\n\n[Netflix OSS](http://netflix.github.io/) 正是客户端发现机制的典型代表:\n\n- [Eureka](https://github.com/Netflix/eureka/wiki/Eureka-at-a-glance) 充当其中的 [服务注册表](service-registry.html)\n- [Ribbon Client](https://github.com/Netflix/ribbon) 是一套HTTP客户端,负责向 Eureka 发出查询任务并将 HTTP 请求路由至可用的服务实例。\n\n## 结果\n\n客户端发现机制拥有以下优势:\n\n- 相较于 [服务器端服务发现](server-side-discovery.html) ,其活动部件与网络中转数量更少。\n\n客户端发现机制亦存在着以下弊端:\n\n- 这一模式使客户端与 [服务注册表](service-registry.html) 相耦合。\n- 需要为应用程序中使用的每种编程语言/框架建立客户端服务发现逻辑,例如Java/Scala以及JavaScript/Node JS。举例来说, [Netflix Prana](https://github.com/Netflix/Prana) 就为非 JVM 客户端提供了一套基于HTTP代理的服务发现方案。\n\n## 相关模式\n\n- [服务注册表](service-registry.html) - 服务发现的基础\n- [微服务的基底](microservice-chassis.html) - 客户端服务发现是微服务基底模块的职责之一\n- [服务器端服务发现](server-side-discovery.html) 是另一种可选的方案\n\n## 致谢\n\nä¸şäş†éżĺ…é‡ĺ¤çżťčŻ‘ďźŒćœŹć–‡ć šćŽä¸­ĺ›˝ć™Žĺ…ƒĺ…Źĺ¸ĺŽ‹ć˝‡ć–‡ĺ…ˆç”Ÿçš„[译文](http://blog.csdn.net/xn_sung/article/details/52336732)整理修订,在此向宋潇文先生表示感谢!\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 8007, "slov": 325, "odkazu": 67, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/client-side-discovery.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:23", "sha256": "138e5ce084f6377e31081645900bb210a7eb5686e3bd53723cb29f076a1ed80f", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "http://netflix.github.io/", "https://github.com/Netflix/eureka/wiki/Eureka-at-a-glance", "https://github.com/Netflix/ribbon", "https://github.com/Netflix/Prana", "http://blog.csdn.net/xn_sung/article/details/52336732", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/communication-style/domain-specific.html", "titulek": "Domain-specific protocol", "h1": "Pattern: Domain-specific protocol", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Domain-specific protocol"}, {"uroven": 2, "text": "Summary"}, {"uroven": 2, "text": "Examples"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Domain-specific protocol\n\n## Summary\n\nUse a domain-specific protocol for inter-service communication.\n\n- The [Messaging](messaging.html) pattern is an alternative pattern\n- The [RPI](rpi.html) pattern is an alternative pattern\n\n## Examples\n\nThere are numerous domain-specific protocols including:\n\n- Email protocols such as SMTP and IMAP\n- Media streaming protocols such as RTMP, HLS, and HDS\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5444, "slov": 277, "odkazu": 60, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/communication-style/domain-specific.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:20", "sha256": "83625683acae34a8049fce35b4d096707af44664c3e5f97ffeb2d12f952129e4", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/communication-style/messaging.html", "titulek": "Messaging", "h1": "Pattern: Messaging", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Messaging"}, {"uroven": 2, "text": "Summary"}, {"uroven": 2, "text": "Examples"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Messaging\n\n## Summary\n\nUse asynchronous messaging for inter-service communication.\n\n- The [Domain-specific protocol](domain-specific.html) pattern is an alternative pattern\n- The [RPI](rpi.html) pattern is an alternative pattern\n\n## Examples\n\nThere are numerous examples of asynchronous messaging technologies\n\n- [Apache Kafka](http://kafka.apache.org)\n- [RabbitMQ](https://www.rabbitmq.com/)\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5444, "slov": 264, "odkazu": 62, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/communication-style/messaging.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:19", "sha256": "2c1fe2f082656900ad9fa42d6a8ab58235411b459e771d411333a36251c51f72", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "http://kafka.apache.org/", "https://www.rabbitmq.com/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/communication-style/rpi.html", "titulek": "Remote Procedure Invocation (RPI)", "h1": "Pattern: Remote Procedure Invocation (RPI)", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Remote Procedure Invocation (RPI)"}, {"uroven": 2, "text": "Summary"}, {"uroven": 2, "text": "Examples"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Remote Procedure Invocation (RPI)\n\n## Summary\n\nUse RPI for inter-service communication.\n\n- The [Domain-specific protocol](domain-specific.html) is an alternative pattern\n- The [Messaging](messaging.html) is an alternative pattern\n\n## Examples\n\nThere are numerous examples of RPI technologies\n\n- [REST](https://en.wikipedia.org/wiki/Representational_state_transfer)\n- [gRPC](http://www.grpc.io/)\n- [Apache Thrift](https://thrift.apache.org/)\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5491, "slov": 264, "odkazu": 63, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/communication-style/rpi.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:18", "sha256": "09fa30c666304792a89b8ba8ec6c2af2aba4e5b5d7c120d2ad4144d3496397f3", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://en.wikipedia.org/wiki/Representational_state_transfer", "http://www.grpc.io/", "https://thrift.apache.org/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/data/application-events.html", "titulek": "Application publishes events", "h1": "Pattern: Application publishes events", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Application publishes events"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Application publishes events\n\n## Problem\n\nHow to reliably/atomically publish events whenever state changes\n\n## Solution\n\nThe application insert events into an `EVENTS` table as part of the local transaction.\nA separate process polls the `EVENTS` table and publishes the events to a message broker.\n\n- The [Event-driven architecture pattern](event-driven-architecture.html) creates the need for this pattern.\n- The [Event sourcing](event-sourcing.html) is an alternative pattern\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5528, "slov": 289, "odkazu": 60, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/data/application-events.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:58", "sha256": "3e3ba7c6504332b15244dd037a2952248cdbb9e1be2eeb63400e0b871157c8c8", "hloubka": 3, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/data/cqrs.html", "titulek": "Command Query Responsibility Segregation (CQRS)", "h1": "Pattern: Command Query Responsibility Segregation (CQRS)", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Command Query Responsibility Segregation (CQRS)"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Command Query Responsibility Segregation (CQRS)\n\n## Problem\n\nHow to implement queries in a microservice architecture\n\n## Solution\n\nSplit the application into two parts: the command-side and the query-side.\nThe command-side handles create, update, and delete requests and emits events when data changes.\nThe query-side handles queries by executing them against one or more materialized views that are kept up to date by subscribing to the stream of events emitted when data changes.\n\n- The [Database per Service pattern](database-per-service.html) creates the need for this pattern\n- The [Event-driven architecture](event-driven-architecture.html) pattern generates the event stream\n- The [Event sourcing](event-sourcing.html) is often used with CQRS\n\n## Examples\n\n- See the [Eventuate example applications](http://eventuate.io/exampleapps.html) , which use event sourcing and CQRS.\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5930, "slov": 346, "odkazu": 61, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/data/cqrs.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:32", "sha256": "b90a790286f9f872823d469b2b558da8ba002d6ecf62cb1fa6678b63077de1e2", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/data/database-per-service.html", "titulek": "Database per service", "h1": "Pattern: Database per service", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Database per service"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Resulting context"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Database per service\n\n## Context\n\nLet’s imagine you are developing an online store application using the [Microservice architecture pattern](/patterns/microservices.html).\nMost services need to persist data in some kind of database.\nFor example, the `Order Service` stores information about orders and the `Customer Service` stores information about customers.\n\n## Problem\n\nWhat’s the database architecture in a microservices application?\n\n## Forces\n\n- Services must be loosely coupled so that they can be developed, deployed and scaled independently\n- Some business transactions must enforce invariants that span multiple services.\nFor example, the `Place Order` use case must verify that a new Order will not exceed the customer’s credit limit.\nOther business transactions, must update data owned by multiple services.\n- Some business transactions need to query data that is owned by multiple services.\nFor example, the `View Available Credit` use must query the Customer to find the `creditLimit` and Orders to calculate the total amount of the open orders.\n- Some queries must join data that is owned by multiple services.\nFor example, finding customers in a particular region and their recent orders requires a join between customers and orders.\n- Databases must sometimes be replicated and sharded in order to scale. See the [Scale Cube](/articles/scalecube.html).\n- Different services have different data storage requirements.\nFor some services, a relational database is the best choice.\nOther services might need a NoSQL database such as MongoDB, which is good at storing complex, unstructured data, or Neo4J, which is designed to efficiently store and query graph data.\n\n## Solution\n\nKeep each microservice’s persistent data private to that service and accessible only via its API.\nThe following diagram shows the structure of this pattern.\n\nThe service’s database is effectively part of the implementation of that service.\nIt cannot be accessed directly by other services.\n\nThere are a few different ways to keep a service’s persistent data private.\nYou do not need to provision a database server for each service.\nFor example, if you are using a relational database then the options are:\n\n- Private-tables-per-service – each service owns a set of tables that must only be accessed by that service\n- Schema-per-service – each service has a database schema that’s private to that service\n- Database-server-per-service – each service has it’s own database server.\n\nPrivate-tables-per-service and schema-per-service have the lowest overhead.\nUsing a schema per service is appealing since it makes ownership clearer.\nSome high throughput services might need their own database server.\n\nIt is a good idea to create barriers that enforce this modularity.\nYou could, for example, assign a different database user id to each service and use a database access control mechanism such as grants.\nWithout some kind of barrier to enforce encapsulation, developers will always be tempted to bypass a service’s API and access it’s data directly.\n\n## Resulting context\n\nUsing a database per service has the following benefits:\n\n- Helps ensure that the services are loosely coupled.\nChanges to one service’s database does not impact any other services.\n- Each service can use the type of database that is best suited to its needs.\nFor example, a service that does text searches could use ElasticSearch.\nA service that manipulates a social graph could use Neo4j.\n\nUsing a database per service has the following drawbacks:\n\n- Implementing business transactions that span multiple services is not straightforward.\nDistributed transactions are best avoided because of the CAP theorem.\nMoreover, many modern (NoSQL) databases don’t support them.\nThe best solution is to use an [eventually consistent, event-driven architecture](event-driven-architecture.html).\nServices publish events when they update data.\nOther services subscribe to events and update their data in response.\n- Implementing queries that join data that is now in multiple databases is challenging.\nThere are various solutions:\n- Application-side joins - the application performs the join rather than the database.\n For example, a service (or the API gateway) could retrieve a customer and their orders by first retrieving the customer from the customer service and then querying the order service to return the customer’s most recent orders.\n- Command Query Responsibility Segregation (CQRS) - maintain one or more materialized views that contain data from multiple services.\n The views are kept by services that subscribe to events that each services publishes when it updates its data.\n For example, the online store could implement a query that finds customers in a particular region and their recent orders by maintaining a view that joins customers and orders.\n The view is updated by a service that subscribes to customer and order events.\n- Complexity of managing multiple SQL and NoSQL databases\n\n- [Microservice architecture pattern](/patterns/microservices.html) creates the need for this pattern\n- [Event-driven architecture pattern](event-driven-architecture.html) is a useful way to implement eventually consistent transactions\n- The [Command Query Responsibility Segregation (CQRS) pattern](cqrs.html) is a useful way to implement complex queries\n- The [Shared Database anti-pattern](shared-database.html) describes the problems that result from microservices sharing a database\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 10484, "slov": 1033, "odkazu": 63, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/data/database-per-service.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:29", "sha256": "fcd6e1bea7ba647a96ead78603e90a71e47ba95ffd46c8001c005c12d159d94c", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/data/database-triggers.html", "titulek": "Publish events using database triggers", "h1": "Pattern: Publish events using database triggers", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Publish events using database triggers"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Publish events using database triggers\n\n## Problem\n\nHow to reliably/atomically publish events whenever state changes\n\n## Solution\n\nOne or more database triggers insert events into an `EVENTS` table, which is polled by a separate process that publishes the events.\n\n- The [Event-driven architecture pattern](event-driven-architecture.html) creates the need for this pattern.\n- The [Event sourcing](event-sourcing.html) is an alternative pattern\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5496, "slov": 284, "odkazu": 60, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/data/database-triggers.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:34", "sha256": "5460a00235623354a761bd99a096236760aed47dba6cf696271b1bcc2f647ebf", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/data/event-driven-architecture.html", "titulek": "Event-driven architecture", "h1": "Pattern: Event-driven architecture", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Event-driven architecture"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "Example"}, {"uroven": 2, "text": "See also"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Event-driven architecture\n\n## Problem\n\nYou have applied the [Database per Service](database-per-service.html) pattern.\nEach service has its own database.\nSome business transactions, however, span multiple service so you need a mechanism to ensure data consistency across services.\n\nFor example, lets imagine that you are building an e-commerce store where customers have a credit limit.\nThe application must ensure that a new order will not exceed the customer’s credit limit.\nSince Orders and Customers are in different databases the application cannot simply use a local ACID transaction.\nIn theory, it could use a distributed transaction that spans the `Customer Service` and the `Order Service`.\nHowever, for a variety of reasons distributed transactions are not a viable choice for most modern applications.\n\n## Solution\n\nUse an event-driven, eventually consistent approach.\nEach service publishes an event whenever it update its data.\nOther service subscribe to events.\nWhen an event is received, a service updates its data.\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- It enables an application to maintain data consistency across multiple services without using distributed transactions\n\nThis solution has the following drawbacks:\n\n- The programming model is more complex\n\nThere are also the following issues to address:\n\n- In order to be reliable, an application must atomically update its database and publish an event.\nIt cannot use the traditional mechanism of a distributed transaction that spans the database and the message broker.\nInstead, it must use one the patterns listed below.\n\n## Example\n\nAn e-commerce application that uses this approach would work as follows:\n\n1. The `Order Service` creates an Order in a *pending* state and publishes an `OrderCreated` event.\n2. The `Customer Service` receives the event and attempts to reserve credit for that Order. It then publishes either a `Credit Reserved` event or a `CreditLimitExceeded` event.\n3. The `Order Service` receives the event from the `Customer Service` and changes the state of the order to either *approved* or *cancelled*\n\n- The [Database per Service pattern](database-per-service.html) creates the need for this pattern\n- The following patterns are ways to *atomically* update state *and* publish events:\n - [Event sourcing](event-sourcing.html)\n - [Transactional Outbox](/patterns/cn/data/transactional-outbox.html)\n - [Database triggers](database-triggers.html)\n - [Transaction log tailing](transaction-log-tailing.html)\n\n## See also\n\nThe article [Event-Driven Data Management for Microservices](https://www.nginx.com/blog/event-driven-data-management-microservices/) by @crichardson describes this pattern\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 7714, "slov": 605, "odkazu": 63, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/data/event-driven-architecture.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:30", "sha256": "48aab6e294260339c0b4f95a3af52e803f2cbc0a34ddf098c5beee5f749fd95c", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://www.nginx.com/blog/event-driven-data-management-microservices/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/data/event-sourcing.html", "titulek": "Event sourcing", "h1": "Pattern: Event sourcing", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Event sourcing"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Example"}, {"uroven": 2, "text": "Resulting context"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Event sourcing\n\n## Problem\n\nYou have applied the [Event-driven architecture pattern](event-driven-architecture.html).\nIn order to be reliable, services must atomically publish events whenever their state changes.\nIt is not viable to use a distributed transaction that spans the database and the message broker.\nHow to reliably/atomically publish events whenever state changes?\n\n## Solution\n\nA good solution to this problem is to use event sourcing.\nEvent sourcing persists the state of a business entity such an Order or a Customer as a sequence of state-changing events.\nWhenever the state of a business entity changes, a new event is appended to the list of events.\nSince saving an event is a single operation, it is inherently atomic.\nThe application reconstructs an entity’s current state by replaying the events.\n\nApplications persist events in an event store, which is a database of events.\nThe store has an API for adding and retrieving an entity’s events.\nThe event store also behaves like a message broker.\nIt provides an API that enables services to subscribe to events.\nWhen a service saves an event in the event store, it is delivered to all interested subscribers.\n\n## Example\n\nThe following diagram shows how the e-commerce system could use event sourcing to persist orders.\n\nInstead of simply storing the current state of each order as a row in an `ORDERS` table, the application persists each Order as a sequence of events.\nThe `CustomerService` can subscribe to the order events and update its own state.\n\nFor more details, see the [Eventuate Platform](http://eventuate.io), which is an application platform based on event sourcing and CQRS. There are [several example applications](http://eventuate.io/exampleapps.html)\n\n## Resulting context\n\nEvent sourcing has several benefits:\n\n- It solves one of the key problems in implementing an event-driven architecture and makes it possible to reliably publish events whenever state changes.\n- Because it persists events rather than domain objects, it mostly avoids the object‑relational impedance mismatch problem.\n- It provides a 100% reliable audit log of the changes made to a business entity\n- It makes it possible to implement temporal queries that determine the state of an entity at any point in time.\n- Event sourcing-based business logic consists of loosely coupled business entities that exchange events. This makes it a lot easier to migrate from a monolithic application to a microservice architecture.\n\nEvent sourcing also has several drawbacks:\n\n- It is a different and unfamiliar style of programming and so there is a learning curve.\n- The event store is difficult to query since it requires typical queries to reconstruct the state of the business entities. That is likely to be complex and inefficient.\nAs a result, the application must use [Command Query Responsibility Segregation (CQRS)](cqrs.html) to implement queries.\nThis in turn means that applications must handle eventually consistent data.\n\n- The [Event-driven architecture pattern](event-driven-architecture.html) creates the need for this pattern.\n- The [CQRS](cqrs.html) is often used with event sourcing.\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 8185, "slov": 704, "odkazu": 60, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/data/event-sourcing.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:31", "sha256": "7b07ea0d76ca33d25b58a52f283645fc7ceb3574dbd76e39e52bddf51297d3f3", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/data/shared-database.html", "titulek": "Shared database", "h1": "Pattern: Shared database", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Shared database"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 1, "text": "Solution"}, {"uroven": 1, "text": "Example"}, {"uroven": 1, "text": "Resulting context"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Shared database\n\n## Context\n\nLet’s imagine you are developing an online store application using the [Microservice architecture pattern](/patterns/microservices.html).\nMost services need to persist data in some kind of database.\nFor example, the `Order Service` stores information about orders and the `Customer Service` stores information about customers.\n\n## Problem\n\nWhat’s the database architecture in a microservices application?\n\n## Forces\n\n- Services must be loosely coupled so that they can be developed, deployed and scaled independently\n- Some business transactions must enforce invariants that span multiple services.\nFor example, the `Place Order` use case must verify that a new Order will not exceed the customer’s credit limit.\nOther business transactions, must update data owned by multiple services.\n- Some business transactions need to query data that is owned by multiple services.\nFor example, the `View Available Credit` use must query the Customer to find the `creditLimit` and Orders to calculate the total amount of the open orders.\n- Some queries must join data that is owned by multiple services.\nFor example, finding customers in a particular region and their recent orders requires a join between customers and orders.\n- Databases must sometimes be replicated and sharded in order to scale. See the [Scale Cube](/articles/scalecube.html).\n- Different services have different data storage requirements.\nFor some services, a relational database is the best choice.\nOther services might need a NoSQL database such as MongoDB, which is good at storing complex, unstructured data, or Neo4J, which is designed to efficiently store and query graph data.\n\n# Solution\n\nUse a (single) database that is shared by multiple services.\nEach service freely accesses data owned by other services using local ACID transactions.\n\n# Example\n\nThe `OrderService` and `CustomerService` freely access each other’s tables.\nFor example, the `OrderService` can use the following ACID transaction ensure that a new order will not violate the customer’s credit limit.\n\n```\nBEGIN TRANSACTION\n…\nSELECT ORDER_TOTAL\n FROM ORDERS WHERE CUSTOMER_ID = ?\n…\nSELECT CREDIT_LIMIT\nFROM CUSTOMERS WHERE CUSTOMER_ID = ?\n…\nINSERT INTO ORDERS …\n…\nCOMMIT TRANSACTION\n```\n\nThe database will guarantee that the credit limit will not be exceeded even when simultaneous transactions attempt to create orders for the same customer.\n\n# Resulting context\n\nThe benefits of this pattern are:\n\n- A developer uses familiar and straightforward ACID transactions to enforce data consistency\n- A single database is simpler to operate\n\nThe drawbacks of this pattern are:\n\n- Development time coupling - a developer working on, for example, the `OrderService` will need to coordinate schema changes with the developers of other services that access the same tables.\nThis coupling and additional coordination will slow down development.\n- Runtime coupling - because all services access the same database they can potentially interfere with one another.\nFor example, if long running `CustomerService` transaction holds a lock on the `ORDER` table then the `OrderService` will be blocked.\n- Single database might not satisfy the data storage and access requirements of all services.\n\n- [Database per Service](database-per-service.html) is an alternative approach\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 8339, "slov": 704, "odkazu": 61, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/data/shared-database.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:30", "sha256": "39412c0b25149161807d619f9edff3ac1d81992794f6827bc0b822bf9b3f4b7d", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/data/transaction-log-tailing.html", "titulek": "Transaction log tailing", "h1": "Pattern: Transaction log tailing", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Transaction log tailing"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Example"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Transaction log tailing\n\n## Problem\n\nHow to reliably/atomically publish events whenever state changes\n\n## Solution\n\nTail the database transaction log and publish each change as an event.\n\n- The [Event-driven architecture pattern](event-driven-architecture.html) creates the need for this pattern.\n- The [Event sourcing](event-sourcing.html) is an alternative pattern\n\n## Example\n\n- [Eventuate Local](https://blog.eventuate.io/2016/10/06/eventuate-local-event-sourcing-and-cqrs-with-spring-boot-apache-kafka-and-mysql/) uses transaction log tailing.\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5598, "slov": 291, "odkazu": 61, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/data/transaction-log-tailing.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:33", "sha256": "ba1cd07632bf7b9ed53e47a694a188c654df0d635c516a6f7c25c7556fce3600", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://blog.eventuate.io/2016/10/06/eventuate-local-event-sourcing-and-cqrs-with-spring-boot-apache-kafka-and-mysql/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/data/transactional-outbox.html", "titulek": "Redirect to renamed pattern", "h1": "", "popis": "", "klicova_slova": "renamed-pattern", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [], "markdown": "If your browser doesn't automatically go there within a few seconds,\nyou may want to go to\n [the destination](application-events.html) \nmanually.", "znaku_textu": 145, "slov": 21, "odkazu": 1, "kodovani": "utf-8", "kodovani_deklarovane": null, "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/data/transactional-outbox.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:35", "sha256": "780db6ea3c591baa9f13e432c3103a8deb94d86af0831ab14488bfb416732642", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": []} {"url": "https://microservices.io/patterns/cn/decomposition/decompose-by-business-capability.html", "titulek": "Decompose by business capability", "h1": "Pattern: Decompose by business capability", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Decompose by business capability"}, {"uroven": 1, "text": "Context"}, {"uroven": 1, "text": "Problem"}, {"uroven": 1, "text": "Forces"}, {"uroven": 2, "text": "Solution"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Decompose by business capability\n\n# Context\n\nYou are developing a large, complex application and want to use the [microservice architecture](../microservices.html).\nThe microservice architecture structures an application as a set of loosely coupled services.\nThe goal of the microservice architecture is to accelerate software development by enabling continuous delivery/deployment.\n\nThe microservice architecture does this in two ways:\n\n1. Simplifies testing and enables components to deployed independently\n2. Structures the engineering organization as a collection of small (6-10 members), autonomous teams, each of which is responsible for one or more services\n\nThese benefits are not automatically guaranteed.\nInstead, they can only be achieved by the careful functional decomposition of the application into services.\n\nA service must be small enough to be developed by a small team and to be easily tested.\nA useful guideline from object-oriented design (OOD) is the Single Responsibility Principle ([SRP](http://www.objectmentor.com/resources/articles/srp.pdf)).\nThe SRP defines a responsibility of a class as a reason to change, and states that a class should only have one reason to change.\nIt make sense to apply the SRP to service design as well and design services that are cohesive and implement a small set of strongly related functions.\n\nThe application also be decomposed in a way so that most new and changed requirements only affect a single service.\nThat is because changes that affect multiple services requires coordination across multiple teams, which slows down development.\nAnother useful principle from OOD is the Common Closure Principle (CCP), which states that classes that change for the same reason should be in the same package.\nPerhaps, for instance, two classes implement different aspects of the same business rule.\nThe goal is that when that business rule changes developers, only need to change code in a small number - ideally only one - of packages.\nThis kind of thinking makes sense when designing services since it will help ensure that each change should impact only one service.\n\n# Problem\n\nHow to decompose an application into services?\n\n# Forces\n\n- The architecture must be stable\n- Services must be cohesive.\nA service should implement a small set of strongly related functions.\n- Services must conform to the Common Closure Principle - things that change together should be packaged together - to ensure that each change affect only one service\n- Services must be loosely coupled - each service as an API that encapsulates its implementation.\nThe implementation can be changed without affecting clients\n- A service should be testable\n- Each service be small enough to be developed by a “two pizza” team, i.e. a team of 6-10 people\n- Each team that owns one or more services must be autonomous.\nA team must be able to develop and deploy their services with minimal collaboration with other teams.\n\n## Solution\n\nDefine services corresponding to business capabilities\n\n- The [Decompose by subdomain](decompose-by-subdomain.html) pattern is an alternative pattern\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 8138, "slov": 691, "odkazu": 61, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/decomposition/decompose-by-business-capability.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:01", "sha256": "ac4608464fa8840bf8f118e177a27320b7de9fb675cf630631d18ab9b87f8555", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "http://www.objectmentor.com/resources/articles/srp.pdf", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/decomposition/decompose-by-subdomain.html", "titulek": "Decompose by subdomain", "h1": "Pattern: Decompose by subdomain", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Decompose by subdomain"}, {"uroven": 1, "text": "Context"}, {"uroven": 1, "text": "Problem"}, {"uroven": 1, "text": "Forces"}, {"uroven": 2, "text": "Solution"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Decompose by subdomain\n\n# Context\n\nYou are developing a large, complex application and want to use the [microservice architecture](../microservices.html).\nThe microservice architecture structures an application as a set of loosely coupled services.\nThe goal of the microservice architecture is to accelerate software development by enabling continuous delivery/deployment.\n\nThe microservice architecture does this in two ways:\n\n1. Simplifies testing and enables components to deployed independently\n2. Structures the engineering organization as a collection of small (6-10 members), autonomous teams, each of which is responsible for one or more services\n\nThese benefits are not automatically guaranteed.\nInstead, they can only be achieved by the careful functional decomposition of the application into services.\n\nA service must be small enough to be developed by a small team and to be easily tested.\nA useful guideline from object-oriented design (OOD) is the Single Responsibility Principle ([SRP](http://www.objectmentor.com/resources/articles/srp.pdf)).\nThe SRP defines a responsibility of a class as a reason to change, and states that a class should only have one reason to change.\nIt make sense to apply the SRP to service design as well and design services that are cohesive and implement a small set of strongly related functions.\n\nThe application also be decomposed in a way so that most new and changed requirements only affect a single service.\nThat is because changes that affect multiple services requires coordination across multiple teams, which slows down development.\nAnother useful principle from OOD is the Common Closure Principle (CCP), which states that classes that change for the same reason should be in the same package.\nPerhaps, for instance, two classes implement different aspects of the same business rule.\nThe goal is that when that business rule changes developers, only need to change code in a small number - ideally only one - of packages.\nThis kind of thinking makes sense when designing services since it will help ensure that each change should impact only one service.\n\n# Problem\n\nHow to decompose an application into services?\n\n# Forces\n\n- The architecture must be stable\n- Services must be cohesive.\nA service should implement a small set of strongly related functions.\n- Services must conform to the Common Closure Principle - things that change together should be packaged together - to ensure that each change affect only one service\n- Services must be loosely coupled - each service as an API that encapsulates its implementation.\nThe implementation can be changed without affecting clients\n- A service should be testable\n- Each service be small enough to be developed by a “two pizza” team, i.e. a team of 6-10 people\n- Each team that owns one or more services must be autonomous.\nA team must be able to develop and deploy their services with minimal collaboration with other teams.\n\n## Solution\n\nDefine services corresponding to domain-driven design subdomains\n\n- The [Decompose by business capability](decompose-by-business-capability.html) pattern is an alternative pattern\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 8158, "slov": 694, "odkazu": 61, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/decomposition/decompose-by-subdomain.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:04", "sha256": "3cb9ffbe48439f6cf38c560886c5430d3f89600822a6d1767a658197c5ae5290", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "http://www.objectmentor.com/resources/articles/srp.pdf", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/deployment/multiple-services-per-host.html", "titulek": "Multiple service instances per host pattern", "h1": "Pattern: Multiple service instances per host", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Multiple service instances per host"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Multiple service instances per host\n\n## Context\n\nYou have applied the [Microservice architecture pattern](/patterns/microservices.html) and architected your system as a set of services.\nEach service is deployed as a set of service instances for throughput and availability.\n\n## Problem\n\nHow are services packaged and deployed?\n\n## Forces\n\n- Services are written using a variety of languages, frameworks, and framework versions\n- Each service consists of multiple service instances for throughput and availability\n- Service must be independently deployable and scalable\n- Service instances need to be isolated from one another\n- You need to be able to quickly build and deploy a service\n- You need to be able to constrain the resources (CPU and memory) consumed by a service\n- You need to monitor the behavior of each service instance\n- You want deployment to reliable\n- You must deploy the application as cost-effectively as possible\n\n## Solution\n\nRun multiple instances of different services on a host (Physical or Virtual machine).\n\nThere are various ways of deploying a service instance on a shared host including:\n\n- Deploy each service instance as a JVM process. For example, a Tomcat or Jetty instances per service instance.\n- Deploy multiple service instances in the same JVM. For example, as web applications or OSGI bundles.\n\n## Examples\n\n## Resulting context\n\nThe benefits of this pattern include:\n\n- More efficient resource utilization than the [Service Instance per host pattern](single-service-per-host.html)\n\nThe drawbacks of this approach include:\n\n- Risk of conflicting resource requirements\n- Risk of conflicting dependency versions\n- Difficult to limit the resources consumed by a service instance\n- If multiple services instances are deployed in the same process then its difficult to monitor the resource consumption of each service instance.\nIts also impossible to isolate each instance\n\n- The [Single Service Instance per Host pattern](single-service-per-host.html) is an alternative solution.\n- The [Serverless deployment pattern](/patterns/deployment/serverless-deployment.html) is an alternative solution.\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 7149, "slov": 525, "odkazu": 61, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/deployment/multiple-services-per-host.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:06", "sha256": "e57f36805727946f66488e06fe9e226ee441cbda63d2a74e869a26b4a1c47e83", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/deployment/serverless-deployment.html", "titulek": "Serverless deployment", "h1": "Pattern: Serverless deployment", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Serverless deployment"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Serverless deployment\n\n## Context\n\nYou have applied the [Microservice architecture pattern](/patterns/microservices.html) and architected your system as a set of services.\nEach service is deployed as a set of service instances for throughput and availability.\n\n## Problem\n\nHow are services packaged and deployed?\n\n## Forces\n\n- Services are written using a variety of languages, frameworks, and framework versions\n- Each service consists of multiple service instances for throughput and availability\n- Service must be independently deployable and scalable\n- Service instances need to be isolated from one another\n- You need to be able to quickly build and deploy a service\n- You need to be able to constrain the resources (CPU and memory) consumed by a service\n- You need to monitor the behavior of each service instance\n- You want deployment to reliable\n- You must deploy the application as cost-effectively as possible\n\n## Solution\n\nUse a deployment infrastructure that hides any concept of servers (i.e. reserved or preallocated resources)- physical or virtual hosts, or containers.\nThe infrastructure takes your service’s code and runs it.\nYou are charged for each request based on the resources consumed.\n\nTo deploy your service using this approach, you package the code (e.g. as a ZIP file), upload it to the deployment infrastructure and describe the desired performance characteristics.\n\nThe deployment infrastructure is a utility operated by a public cloud provider.\nIt typically uses either containers or virtual machines to isolate the services.\nHowever, these details are hidden from you.\nNeither you nor anyone else in your organization is responsible for managing any low-level infrastructure such as operating systems, virtual machines, etc.\n\n## Examples\n\nThere are a few different serverless deployment environments:\n\n- [AWS Lambda](https://aws.amazon.com/lambda/)\n- [Google Cloud Functions](https://cloud.google.com/functions/docs)\n- [Azure Functions](https://azure.microsoft.com/en-us/services/functions/)\n\nThey offer similar functionality but AWS Lambda has the richest feature set.\nAn AWS Lambda function is a stateless component that is invoked to handle events.\nTo create an AWS Lambda function you package your the NodeJS, Java or Python code for your service in a ZIP file, and upload it to AWS Lambda.\nYou also specify the name of function that handles events as well as resource limits.\n\nWhen an event occurs, AWS Lambda finds an idle instance of your function, launching one if none are available and invokes the handler function.\nAWS Lambda runs enough instances of your function to handle the load.\nUnder the covers, it uses containers to isolate each instance of a lambda function.\nAs you might expect, AWS Lambda runs the containers on EC2 instances.\n\nThere are four ways to invoke a lambda function.\nOne option is to configure your lambda function to be invoked in response to an event generated by an AWS service such as S3, DynamoDB or Kinesis.\nExamples of events include the following:\n\n- an object being created in a S3 bucket\n- an item is created, updated or deleted in a DynamoDB table\n- a message is available to read from a Kinesis stream\n- an email being received via the Simple email service.\n\nAnother way to invoke a lambda function is to configure the AWS Lambda Gateway to route HTTP requests to your lambda.\nAWS Gateway transforms an HTTP request into an event object, invokes the lambda function, and generates a HTTP response from the lambda function’s result.\n\nYou can also explicitly invoke your lambda function using the AWS Lambda Web Service API.\nYour application that invokes the lambda function supplies a JSON object, which is passed to the lambda function.\nThe web service call returns the value returned by the lambda.\n\nThe fourth way to invoke a lambda function is periodically using a cron-like mechanism.\nYou can, for example, tell AWS to invoke you lambda function every five minutes.\n\nThe cost of each invocation is a function of the duration of the invocation, which is measured in 100 millisecond increments, and the memory consumed.\n\n## Resulting context\n\nThe benefits of using serverless deployment include:\n\n- It eliminates the need to spend time on the undifferentiated heavy lifting of managing low-level infrastructure.\nInstead, you can focus on your code.\n- The serverless deployment infrastructure is extremely elastic.\nIt automatically scales your services to handle the load.\n- You pay for each request rather than provisioning what might be under utilized virtual machines or containers.\n\nThe drawbacks of serverless deployment include:\n\n- Significant limitation and constraints -\nA serverless deployment environment typically has far more constraints that a VM-based or Container-based infrastructure.\nFor example, AWS Lambda only supports a few languages.\nIt is only suitable for deploying stateless applications that run in response to a request.\nYou cannot deploy a long running stateful application such as a database or message broker.\n- Limited “input sources” - lambdas can only respond to requests from a limited set of input sources.\nAWS Lambda is not intended to run services that, for example, subscribe to a message broker such as RabbitMQ.\n- Applications must startup quickly - serverless deployment is not a good fit your service takes a long time to start\n- Risk of high latency - the time it takes for the infrastructure to provision an instance of your function and for the function to initialize might result in significant latency.\nMoreover, a serverless deployment infrastructure can only react to increases in load.\nYou cannot proactively pre-provision capacity.\nAs a result, your application might initially exhibit high latency when there are sudden, massive spikes in load.\n\nThe deployment infrastructure will internally deploy your application using one of the other patterns.\nIt will most likely use [Service Service per Host pattern](single-service-per-host.html).\n\n- The [Multiple Service Instances per Host pattern](multiple-services-per-host.html) is an alternative deployment solution\n- The [Single Service per Host pattern](single-service-per-host.html) is an alternative deployment solution\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 11200, "slov": 1161, "odkazu": 64, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/deployment/serverless-deployment.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:14", "sha256": "2bc7368bf89a1a6d54713fb9ea53988875897cd8e4cf68e900e3457398533835", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://aws.amazon.com/lambda/", "https://cloud.google.com/functions/docs", "https://azure.microsoft.com/en-us/services/functions/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/deployment/service-deployment-platform.html", "titulek": "Service deployment platform", "h1": "Pattern: Service deployment platform", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Service deployment platform"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Service deployment platform\n\n## Context\n\nYou have applied the [Microservice architecture pattern](/patterns/microservices.html) and architected your system as a set of services.\nEach service is deployed as a set of service instances for throughput and availability.\n\n## Problem\n\nHow are services packaged and deployed?\n\n## Forces\n\n- Services are written using a variety of languages, frameworks, and framework versions\n- Each service consists of multiple service instances for throughput and availability\n- Service must be independently deployable and scalable\n- Service instances need to be isolated from one another\n- You need to be able to quickly build and deploy a service\n- You need to be able to constrain the resources (CPU and memory) consumed by a service\n- You need to monitor the behavior of each service instance\n- You want deployment to reliable\n- You must deploy the application as cost-effectively as possible\n\n## Solution\n\nUse a deployment platform, which is automated infrastructure for application deployment.\nIt provides a service abstraction, which is a named, set of highly available (e.g. load balanced) service instances.\n\n- Some deployment platforms provide a [Service Registry](../service-registry.html) and [Server-Side discovery](../server-side-discovery.html)\n- Internally, a deployment platform might use use [containers](../deployment/service-per-container.html) or [virtual machines](../deployment/service-per-vm.html) to deploy a service.\nDocker orchestration frameworks are, of course, explicitly [container-based](../deployment/service-per-container.html)\n\n## Examples\n\n- Docker orchestration frameworks including [Docker swarm mode](https://docs.docker.com/engine/swarm/) and [Kubernetes](http://kubernetes.io/)\n- [Serverless platforms](serverless-deployment.html) such as AWS Lambda\n- PaaS including [Cloud Foundry](https://www.cloudfoundry.org/) and [AWS Elastic Beanstalk](https://aws.amazon.com/elasticbeanstalk/)\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 6984, "slov": 459, "odkazu": 68, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/deployment/service-deployment-platform.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:15", "sha256": "bc49ef39b3c597fe719869d106c896f9375f63a3b4b871b5db9a1eba7265ce88", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://docs.docker.com/engine/swarm/", "http://kubernetes.io/", "https://www.cloudfoundry.org/", "https://aws.amazon.com/elasticbeanstalk/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/deployment/service-per-container.html", "titulek": "Service instance per container pattern", "h1": "Pattern: Service instance per container", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Service instance per container"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Service instance per container\n\n## Context\n\nYou have applied the [Microservice architecture pattern](/patterns/microservices.html) and architected your system as a set of services.\nEach service is deployed as a set of service instances for throughput and availability.\n\n## Problem\n\nHow are services packaged and deployed?\n\n## Forces\n\n- Services are written using a variety of languages, frameworks, and framework versions\n- Each service consists of multiple service instances for throughput and availability\n- Service must be independently deployable and scalable\n- Service instances need to be isolated from one another\n- You need to be able to quickly build and deploy a service\n- You need to be able to constrain the resources (CPU and memory) consumed by a service\n- You need to monitor the behavior of each service instance\n- You want deployment to reliable\n- You must deploy the application as cost-effectively as possible\n\n## Solution\n\nPackage the service as a (Docker) container image and deploy each service instance as a container\n\n## Examples\n\nDocker is becoming an extremely popular way of packaging and deploying services.\nEach service is packaged as a Docker image and each service instance is a Docker container.\nThere are several Docker clustering frameworks including:\n\n- [Kubernetes](http://kubernetes.io/)\n- [Marathon/Mesos](https://mesosphere.github.io/marathon/)\n- [Amazon EC2 Container Service](http://aws.amazon.com/ecs/)\n\n## Resulting context\n\nThe benefits of this approach include:\n\n- It is straightforward to scale up and down a service by changing the number of container instances.\n- The container encapsulates the details of the technology used to build the service. All services are, for example, started and stopped in exactly the same way.\n- Each service instance is isolated\n- A container imposes limits on the CPU and memory consumed by a service instance\n- Containers are extremely fast to build and start.\nFor example, it’s 100x faster to package an application as a Docker container than it is to package it as an AMI.\nDocker containers also start much faster than a VM since only the application process starts rather than an entire OS.\n\nThe drawbacks of this approach include:\n\n- The infrastructure for deploying containers is not as rich as the infrastructure for deploying virtual machines.\n\n- This pattern is a refinement of the [Service Instance per Host pattern](single-service-per-host.html)\n- The [Service Instance per VM pattern](service-per-vm.html) is an alternative solution\n- The [Serverless deployment pattern](/patterns/deployment/serverless-deployment.html) is an alternative solution.\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 7657, "slov": 598, "odkazu": 65, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/deployment/service-per-container.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:12", "sha256": "25f112f5e88ace0d71396d267fbf6764edbe8d4022fbc51467bdb5232d004e0d", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "http://kubernetes.io/", "https://mesosphere.github.io/marathon/", "http://aws.amazon.com/ecs/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/deployment/service-per-vm.html", "titulek": "Service Instance per VM pattern", "h1": "Pattern: Service Instance per VM", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Service Instance per VM"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Service Instance per VM\n\n## Context\n\nYou have applied the [Microservice architecture pattern](/patterns/microservices.html) and architected your system as a set of services.\nEach service is deployed as a set of service instances for throughput and availability.\n\n## Problem\n\nHow are services packaged and deployed?\n\n## Forces\n\n- Services are written using a variety of languages, frameworks, and framework versions\n- Each service consists of multiple service instances for throughput and availability\n- Service must be independently deployable and scalable\n- Service instances need to be isolated from one another\n- You need to be able to quickly build and deploy a service\n- You need to be able to constrain the resources (CPU and memory) consumed by a service\n- You need to monitor the behavior of each service instance\n- You want deployment to reliable\n- You must deploy the application as cost-effectively as possible\n\n## Solution\n\nPackage the service as a virtual machine image and deploy each service instance as a separate VM\n\n## Examples\n\n- Netflix packages each service as an EC2 AMI and deploys each service instance as a EC2 instance.\n\n## Resulting context\n\nThe benefits of this approach include:\n\n- Its straightforward to scale the service by increasing the number of instances. Amazon Autoscaling Groups can even do this automatically based on load.\n- The VM encapsulates the details of the technology used to build the service. All services are, for example, started and stopped in exactly the same way.\n- Each service instance is isolated\n- A VM imposes limits on the CPU and memory consumed by a service instance\n- IaaS solutions such as AWS provide a mature and feature rich infrastructure for deploying and managing virtual machines. For example,\n - Elastic Load Balancer -\n - Autoscaling groups\n - …\n\nThe drawbacks of this approach include:\n\n- Building a VM image is slow and time consuming\n\n- This pattern is a refinement of the [Single Service per Host pattern](single-service-per-host.html)\n- The [Service Instance per Container pattern](service-per-container.html) is an alternative solution\n- The [Serverless deployment pattern](/patterns/deployment/serverless-deployment.html) is an alternative solution.\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 7243, "slov": 550, "odkazu": 62, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/deployment/service-per-vm.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:11", "sha256": "da69fb632c458a835da9a59788542073d9a4305fdefd2dfdedbaaa6eff3d5ffe", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/deployment/single-service-per-host.html", "titulek": "Single Service Instance per Host pattern", "h1": "Pattern: Single Service Instance per Host", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Single Service Instance per Host"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Single Service Instance per Host\n\n## Context\n\nYou have applied the [Microservice architecture pattern](/patterns/microservices.html) and architected your system as a set of services.\nEach service is deployed as a set of service instances for throughput and availability.\n\n## Problem\n\nHow are services packaged and deployed?\n\n## Forces\n\n- Services are written using a variety of languages, frameworks, and framework versions\n- Each service consists of multiple service instances for throughput and availability\n- Service must be independently deployable and scalable\n- Service instances need to be isolated from one another\n- You need to be able to quickly build and deploy a service\n- You need to be able to constrain the resources (CPU and memory) consumed by a service\n- You need to monitor the behavior of each service instance\n- You want deployment to reliable\n- You must deploy the application as cost-effectively as possible\n\n## Solution\n\nDeploy each single service instance on its own host\n\n## Examples\n\n## Resulting context\n\nThe benefits of this approach include:\n\n- Services instances are isolated from one another\n- There is no possibility of conflicting resource requirements or dependency versions\n- A service instance can only consume at most the resources of a single host\n- Its straightforward to monitor, manage, and redeploy each service instance\n\nThe drawbacks of this approach include:\n\n- Potentially less efficient resource utilization compared to [Multiple Services per Host](multiple-services-per-host.html) because there are more hosts\n\n- The [Multiple Service Instances per Host pattern](multiple-services-per-host.html) is an alternative solution\n- The [Service Instance per VM pattern](service-per-vm.html) is a refinement of this pattern\n- The [Service Instance per Container pattern](service-per-container.html) is a refinement of this pattern\n- The [Serverless deployment pattern](/patterns/deployment/serverless-deployment.html) is an alternative solution.\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 7007, "slov": 499, "odkazu": 63, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/deployment/single-service-per-host.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:09", "sha256": "30dd2458311746090a85292b304d39188d723f7101f1ec32f6946a3c4a11855f", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/externalized-configuration.html", "titulek": "Externalized configuration", "h1": "模式: 配置信息外部化", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "模式: 配置信息外部化"}, {"uroven": 2, "text": "问题"}, {"uroven": 2, "text": "方案"}, {"uroven": 2, "text": "示例"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# 模式: 配置信息外部化\n\n## 问题\n\nĺş”ç”¨é€šĺ¸¸éœ€čŚĺœ¨ä¸ĺŒçš„çŽŻĺ˘ƒä¸‹čżčĄŒďźŒäž‹ĺŚ‚ćľ‹čŻ•ă€é˘„ĺ‘ĺ¸ƒďźŒç”Ÿäş§çŽŻĺ˘ƒç­‰ç­‰ďźŒĺ› ć­¤éœ€čŚä¸Žäš‹ĺŻšĺş”çš„ĺ¤šĺĽ—é…ç˝Žć–‡äťśă€‚\n\n## 方案\n\n将应用程序所有相关的配置信息,包括数据库、网络连接等等保存在外部。在应用启动时,从外部(例如操作系统环境变量)读取这些配置信息。\n\n## 示例\n\n- [Spring Boot externalized configuration](https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html)\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5589, "slov": 247, "odkazu": 59, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/externalized-configuration.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:17", "sha256": "ef3416daa9fd6ad61a5c63bd3b598a84c6b405f5da50a1fa0671de982ec5de73", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/index.html", "titulek": "A pattern language for microservices", "h1": "微服务的模式语言", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "微服务的模式语言"}, {"uroven": 1, "text": "ć ¸ĺżƒć¨ĄĺźďźˆApplication architecture patterns)"}, {"uroven": 1, "text": "服务拆分(Decomposition)"}, {"uroven": 1, "text": "部署模式(Deployment patterns)"}, {"uroven": 1, "text": "需要关注的边界问题(Cross cutting concerns)"}, {"uroven": 1, "text": "通讯模式(Communication patterns)"}, {"uroven": 2, "text": "éŁŽć ź"}, {"uroven": 2, "text": "外部 API"}, {"uroven": 2, "text": "服务发现"}, {"uroven": 2, "text": "ĺŻé ć€§"}, {"uroven": 1, "text": "数据管理(Data management)"}, {"uroven": 1, "text": "安全(Security)"}, {"uroven": 1, "text": "测试(Testing)"}, {"uroven": 1, "text": "可观测性(Observability)"}, {"uroven": 1, "text": "UI 模式(UI patterns)"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# 微服务的模式语言\n\n咱们开始聊聊微服务架构的[模式语言](https://book.douban.com/subject/1471535/)吧。\n\n> [译注]:模式语言提供了讨论问题的交流术语,它明确了特定场景、特定问题的解决方案和延伸性思考。模式语言主要目的是帮助开发者解决在设计和编程中遇到的共同的问题,即清晰的问题陈述、体现问题的解决方案以及推动解决方案的力量(Forceďź‰çš„ć¸…ć™°čĄ¨čż°ă€‚ĺžŽćœĺŠĄćžśćž„ä˝œä¸şä¸€ä¸ŞçŽ°ĺœ¨ćľčĄŒçš„ćœĺŠĄćžśćž„ďźŒäšŸćœ‰ä¸€ĺĽ—ĺąžäşŽč‡Şĺˇąçš„ć¨Ąĺźă€‚čż™çŻ‡ć–‡çŤ ć˜ŻĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łć¨ĄĺźčŻ­č¨€çš„ä¸€ä¸Şćçş˛ă€‚Chris Richardson 从不同的角度,对相关的模式进行了分类。可以点击链接查看每个模式的详细描述。下图通过虚线框细分了不同的微服务模式。\n\n# ć ¸ĺżƒć¨ĄĺźďźˆApplication architecture patterns)\n\n您为应用程序选择哪一种架构?\n\n- [单体架构(Monolithic architecture)](monolithic.html) - 采用单一部署单元的方式架构应用\n- [微服务架构(Microservices architecture)](microservices.html) - 采用一组松耦合服务的方式架构应用\n\n# 服务拆分(Decomposition)\n\n如何把应用拆分为若干个服务?\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†ďźˆDecompose by business capability)](decomposition/decompose-by-business-capability.html) new - ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ç•ŒĺŽšćœĺŠĄçš„čŒƒĺ›´\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†ďźˆDecompose by subdomain)](decomposition/decompose-by-subdomain.html) new - ć šćŽé˘†ĺŸŸéŠąĺŠ¨čŽžčŽĄä¸­ĺ­ĺŸŸçš„ćŚ‚ĺżľç•ŒĺŽšćœĺŠĄçš„čŒƒĺ›´\n\n# 部署模式(Deployment patterns)\n\n如何部署应用程序的服务?\n\n- [单主机上部署服务的多个实例(Multiple service instances per host)](deployment/multiple-services-per-host.html) - 把服务的多个实例部署在一台主机上\n- [单主机上部署服务的单个实例(Single service instance per host)](deployment/single-service-per-host.html) - 把服务的单一实例部署在它独享的主机上\n- [服务实例与虚拟机一一对应(Service instance per VM)](deployment/service-per-vm.html) - 把服务的单一实例部署在它独享的虚拟机上\n- [服务实例与容器一一对应(Service instance per Container)](deployment/service-per-container.html) - 把服务的单一实例部署在它独享的容器上\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛ďźˆServerless deployment)](/patterns/deployment/serverless-deployment.html) - ä˝żç”¨ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛ĺšłĺ°éƒ¨ç˝˛ćœĺŠĄĺŽžäž‹\n- [服务部署平台(Service deployment platform)](/patterns/deployment/service-deployment-platform.html) new - 使用提供服务抽象能力的高度自动化部署平台部署服务实例\n\n# 需要关注的边界问题(Cross cutting concerns)\n\n如何处理服务实例与外界交互的问题?\n\n- [微服务的基底(Microservice chassis)](/patterns/microservice-chassis.html) - 一个用于服务实例与外界交互和简化服务开发的框架\n- [配置信息外部化(Externalized configuration)](/patterns/externalized-configuration.html) new - 把类似数据库连接、访问密钥等配置信息外部化\n\n# 通讯模式(Communication patterns)\n\n## éŁŽć ź\n\nĺş”čŻĽé€‰ć‹Šć€Žć ˇçš„é€šäżĄćœşĺˆśćĽčż›čĄŒćœĺŠĄé—´é€ščŽŻĺ’Œĺ¤–éƒ¨ĺŽ˘ćˆˇçŤŻé€ščŽŻďźŸ\n\n- [远程过程调用(Remote Procedure Invocation)](communication-style/rpi.html) - 使用基于 RPI 协议的服务间通讯方式\n- [月息Messaging)](communication-style/messaging.html) - 使用异步消息进行服务间通讯\n- [领域独用协议(Domain-specific protocol)](communication-style/domain-specific.html) new - 使用特定领域的通讯协议(如 SIP,等)\n\n## 外部 API\n\n如何处理外部客户端与服务之间的通讯?\n\n- [API 网关(API gateway)](apigateway.html) - 为每一类客户端提供一个访问服务的独特接口\n- [服务前端的后端(Backend for front-end)](apigateway.html) - 为每一类客户端都提供一个独立的 API 网关\n\n## 服务发现\n\n一个基于 RPI 的客户端如何在网络上发现服务实例的位置?\n\n- [客户端服务发现(Client-side discovery)](client-side-discovery.html) - 客户端通过直接查询服务注册表获取服务实例的位置\n- [服务器端服务发现(Server-side discovery)](server-side-discovery.html) - 路由模块通过查询服务注册表获取服务实例的位置\n- [服务注册表(Service registry)](service-registry.html) - 一个记录了服务实例位置的数据\n- [自注册(Self registration)](self-registration.html) - 服务实例自己完成向服务注册表的注册\n- [第三方注册(3rd party registration)](3rd-party-registration.html) - 通过第三方模块来进行服务实例信息到服务注册表的注册过程\n\n## ĺŻé ć€§\n\n如何避免由于服务故障或网络中断所引起的故障蔓延到其他服务?\n\n- [断路器(Circuit Breaker)](reliability/circuit-breaker.html) - 当远端服务返回的故障率超过一定的阀值时,客户端代理(比如 API 网关)对远程服务的调用将立刻返回失败的信息\n\n# 数据管理(Data management)\n\n如何实现数据一致性和查询?\n\n- [每服务数据库(Database per Service)](data/database-per-service.html) - 每个服务都拥有它私有的数据库\n- [共享数据库(Shared database)](data/shared-database.html) - 服务之间共享同一个数据库\n- [事件驱动架构(Event-driven architecture)](data/event-driven-architecture.html) - 使用事件来维护服务间的数据一致性\n- [事件溯源(Event sourcing)](data/event-sourcing.html) - 以一连串事件的方式来持久化聚合\n- [事务日志跟踪(Transaction log tailing)](data/transaction-log-tailing.html) - 跟踪数据库的日志变更并由此对外发布消息\n- [数据库触发器(Database triggers)](data/database-triggers.html) - 使用触发器来捕获对数据的修改\n- [应用程序事件(Application events)](/patterns/cn/data/transactional-outbox.html) - 应用程序从消息队列获取事件并插入数据库中\n- [命令查询职责分离(CQRS)](data/cqrs.html) - 维护一个或者多个重要的数据视图以供高效率的查询\n\n# 安全(Security)\n\nĺŚ‚ä˝•ĺ‘ćœĺŠĄĺŽžäž‹äź é€’čŽżé—ŽĺŽ˘ćˆˇçŤŻçš„čşŤäť˝äżĄćŻďźŸ\n\n- [访问令牌(Access Token)](security/access-token.html) new - ćœĺŠĄĺŽžäž‹é€ščż‡čŽżé—Žäť¤ç‰ŒćĽĺŽ‰ĺ…¨ĺœ°äź é€’ĺŽ˘ćˆˇçŤŻçš„čşŤäť˝äżĄćŻ\n\n# 测试(Testing)\n\n如何更便捷的测试?\n\n- [服务组件测试(Service Component Test)](testing/service-component-test.html)new - a test suite that tests a service in isolation using test doubles for any services that it invokes\n- [服务集成协议测试(Service Integration Contract Test)](testing/service-integration-contract-test.html)new - a test suite for a service that is written by the developers of another service that consumes it\n\n# 可观测性(Observability)\n\n如何掌握一个运行中微服务应用的行为并进行有效的故障排错?\n\n- [应用日志(Log aggregation)](observability/application-logging.html) new - 聚合应用程序产生的日志文件\n- [ĺş”ç”¨ćŒ‡ć ‡ďźˆApplication metrics)](observability/application-metrics.html) new - ĺœ¨äťŁç ä¸­ĺŽžçŽ°ć”śé›†ĺş”ç”¨čżčĽčż‡ç¨‹ä¸­ĺ„çąťćŒ‡ć ‡çš„ĺŠŸčƒ˝\n- [审计日志(Audit logging)](observability/audit-logging.html) new - ćŠŠç”¨ćˆˇčĄŒä¸şčŽ°ĺ˝•ĺœ¨ć•°ćŽĺş“ä¸­äž›ć—ĽĺŽć ¸ćŸĽ\n- [分布式追踪(Distributed tracing)](observability/distributed-tracing.html)new - ĺœ¨ćœĺŠĄäťŁç ä¸­é’ˆĺŻšćŻä¸€ä¸Şĺ¤–éƒ¨čŽżé—ŽďźŒéƒ˝ĺˆ†é…ä¸€ä¸Şĺ”Żä¸€çš„ć ‡čŻ†çŹŚďźŒĺšśĺœ¨čˇ¨ćœĺŠĄčŽżé—Žć—śäź é€’čż™ä¸Şć ‡čŻ†çŹŚäťĽäž›čż˝č¸Şĺˆ†ĺ¸ƒĺźĺź•ĺ‘çš„é—Žé˘˜ă€‚äž‹ĺŚ‚ďźŒĺ˝“é€ščż‡ä¸€ä¸Şé›†ä¸­ĺźćœĺŠĄĺ¤„ç†ĺ¤–éƒ¨čŻˇćą‚ć—śďźŒčŽ°ĺ˝•čŻˇćą‚ćœŹčşŤçš„äżĄćŻäťĽĺŠčŻˇćą‚çš„ĺź€ĺ§‹ĺ’Œçť“ćŸć—śé—´ă€‚\n- [异常追踪(Exception tracking)](observability/exception-tracking.html)new - ćŠŠć‰€ćœ‰ćœĺŠĄç¨‹ĺşäťŁç č§Śĺ‘çš„ĺź‚ĺ¸¸äżĄćŻéƒ˝ćą‡čšĺˆ°é›†ä¸­çš„ĺź‚ĺ¸¸čż˝č¸ŞćœĺŠĄďźŒĺšść šćŽä¸€ĺŽšçš„é€ťčž‘ĺŻšĺź€ĺ‘č€…ćˆ–čżçť´äşşĺ‘˜ĺ‘ĺ‡şé€šçŸĽă€‚\n- [健康检查 APIHealth check API)](observability/health-check-api.html) new - 一个监控服务可调用的 API,通常返回服务健康度信息,或对 ping 等心跳检查请求做出响应。\n\n# UI 模式(UI patterns)\n\n如何将源自多个服务的信息组织在一起生成 UI 界面或 Web 页面?\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťşďźˆServer-side page fragment composition)](ui/server-side-page-fragment-composition.html)new - 在服务器端通过编排由多个业务或领域相关后端服务生成的 HTML 片段来构建前端输出的页面内容\n- [厢戡獯 UI 构建(Client-side UI composition)](ui/client-side-ui-composition.html)new - 在客户端通过编排由多个业务或领域相关 UI 组件生成的 HTML 片段来构建前端输出的页面内容\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 13745, "slov": 615, "odkazu": 99, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:44", "sha256": "b085caa5a75b84621f1819a84444a1bdec3cbf0bc32edb022338faadec2ad6f7", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://book.douban.com/subject/1471535/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/microservice-chassis.html", "titulek": "Microservice chassis", "h1": "Pattern: Microservice chassis", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Microservice chassis"}, {"uroven": 2, "text": "Context"}, {"uroven": 1, "text": "Forces"}, {"uroven": 1, "text": "Solution"}, {"uroven": 1, "text": "Example"}, {"uroven": 2, "text": "Resulting context"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Microservice chassis\n\n## Context\n\nWhen you start the development of an application you often spend a significant amount of time putting in place the mechanisms to handle cross-cutting concerns.\nExamples of cross-cutting concern include:\n\n- Externalized configuration - includes credentials, and network locations of external services such as databases and message brokers\n- Logging - configuring of a logging framework such as log4j or logback\n- Health checks - a url that a monitoring service can “ping” to determine the health of the application\n- Metrics - measurements that provide insight into what the application is doing and how it is performing\n\nAs well as these generic cross-cutting concerns, there are also cross-cutting concerns that are specific to the technologies that an application uses.\nApplications that use infrastructure services such as databases or a message brokers require boilerplate configuration in order to do that.\nFor example, applications that use a relational database must be configured with a connection pool.\nWeb applications that process HTTP requests also need boilerplate configuration.\n\nIt is common to spend one or two days, sometimes even longer, setting up these mechanisms.\nIf you going to spend months or years developing a monolithic application then the upfront investment in handling cross-cutting concerns is insignificant.\nThe situation is very different, however, if you are developing an application that has the [microservice architecture](microservices.html).\nThere are tens or hundreds of services.\nYou will frequently create new services, each of which will only take days or weeks to develop.\nYou cannot afford to spend a few days configuring the mechanisms to handle cross-cutting concerns.\nWhat is even worse is that in a microservice architecture there are additional cross-cutting concerns that you have to deal with including service registration and discovery, and circuit breakers for reliably handling partial failure.\n\n# Forces\n\n- Creating a new microservice should be fast and easy\n- When creating a microservice you must handle cross-cutting concerns such as externalized configuration, logging, health checks, metrics, service registration and discovery, circuit breakers. There are also cross-cutting concerns that are specific to the technologies that the microservices uses.\n\n# Solution\n\nBuild your microservices using a microservice chassis framework, which handles cross-cutting concerns\n\n# Example\n\nExamples of microservice chassis frameworks:\n\n- Java\n - [Spring Boot](http://projects.spring.io/spring-boot/) and [Spring Cloud](http://cloud.spring.io/)\n - [Dropwizard](https://dropwizard.github.io/)\n- Go\n - [Gizmo](http://open.blogs.nytimes.com/2015/12/17/introducing-gizmo/?_r=2)\n - [Micro](https://github.com/micro)\n - [Go kit](https://github.com/go-kit/kit)\n\n## Resulting context\n\nThe major benefit of a microservice chassis is that you can quickly and easy get started with developing a microservice.\n\nYou need a microservice chassis for each programming language/framework that you want to use.\nThis can be an obstacle to adopting a new programming language or framework.\n\nThere are the following related patterns:\n\n- [Microservices](microservices.html) - this pattern motivates the need for the Microservice Chassis pattern\n- [Self Registration](self-registration.html) - the microservice chassis is often responsible for registering the service with the service registry\n- [Client-side discovery](client-side-discovery.html) - the microservice chassis is often responsible for client-side service discovery\n- [Circuit Breaker](reliability/circuit-breaker.html) - the microservice chassis framework might implement this pattern\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 8718, "slov": 716, "odkazu": 68, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/microservice-chassis.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:17", "sha256": "0fc1af3ef2735a484f16255bb0922765d02d8af854bacdbcd27c5c71a9f64aa1", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "http://projects.spring.io/spring-boot/", "http://cloud.spring.io/", "https://dropwizard.github.io/", "http://open.blogs.nytimes.com/2015/12/17/introducing-gizmo/?_r=2", "https://github.com/micro", "https://github.com/go-kit/kit", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/microservices.html", "titulek": "Microservice Architecture pattern", "h1": "模式: 微服务架构", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "模式: 微服务架构"}, {"uroven": 2, "text": "背景"}, {"uroven": 2, "text": "问题"}, {"uroven": 2, "text": "需求"}, {"uroven": 2, "text": "方案"}, {"uroven": 2, "text": "示例"}, {"uroven": 2, "text": "结果"}, {"uroven": 3, "text": "优势"}, {"uroven": 3, "text": "弊端:"}, {"uroven": 3, "text": "需要解决的问题"}, {"uroven": 4, "text": "何时应该使用微服务架构?"}, {"uroven": 4, "text": "如何将应用拆分为服务?"}, {"uroven": 4, "text": "如何维护数据一致性?"}, {"uroven": 4, "text": "如何实现数据查询?"}, {"uroven": 2, "text": "相关模式"}, {"uroven": 2, "text": "已知案例"}, {"uroven": 1, "text": "ç¤şäž‹äťŁç "}, {"uroven": 1, "text": "致谢"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# 模式: 微服务架构\n\n## 背景\n\n在开发服务端企业应用时,应用需要支持各种不同类型的客户端,比如桌面浏览器、移动浏览器以及原生移动应用。应用还需要向第三方提供可访问的API,并通过Web Service或者消息代理与其它应用实现集成。应用通过执行业务逻辑、访问数据库、与其它系统交换信息、并返回一条HTML/JSON/XML响应,来处理请求(HTTP请求与消息)。\n\nĺş”ç”¨é‡‡ç”¨ĺ¤šĺą‚ćžśćž„ćˆ–č€…ĺ…­č§’ćžśćž„ďźŒä¸ťčŚç”ąäťĽä¸‹ĺ‡ çąťä¸ĺŒçť„äťśćž„ćˆďźš\n\n- 展现组件——负责处理HTTP请求并响应HTML或者JSON/XML(对于web Services APIs)\n- 业务逻辑——应用的业务逻辑\n- 数据库访问逻辑——用于访问数据库的数据访问对象\n- 应用集成逻辑——消息层,例如基于Spring Integration\n\n不同逻辑组件分别响应应用中的不同功能模块。\n\n## 问题\n\n应用的部署架构是什么?\n\n## 需求\n\n- 应用需要由一个开发者团队专门负责\n- 团队新成员需要快速上手\n- 应用应该易于理解和修改\n- 对应用能够进行持续部署\n- 需要在多台设备上运行应用副本,从而满足可扩展性与可用性的要求\n- 使用各种新技术(框架、编程语言等)\n\n## 方案\n\n用 [Scale Cube](../../articles/scalecube.html) 方法(特别是Y轴扩展)设计应用架构,将应用程序按功能拆分为一组互相协作的服务。每个服务实现一组特定、相关的功能。举例来说,一个应用程序可能由订单管理服务、客户管理服务等多个服务构成。\n\n服务间的通信则可由HTTP/REST等同步协议或者AMQP等异步协议实现。服务可以彼此独立开发与部署。每个服务皆有自己的[数据库](data/database-per-service.html),从而保证其与其它服务解耦。在必要时,可利用数据库复制机制或者应用层[事件驱动](data/event-driven-architecture.html)机制,维护数据库之间的数据一致性。\n\n## 示例\n\n假设需要构建一款电子商务应用程序,使其能够接收来自客户的订单、验证库存信息与可用信用额度,而后进行发货。该应用程序会包含多个组件,其中StoreFrontUI负责实现用户界面,而其它后端服务则分别负责检查信用额度、维护库存信息以及发送订单。\n\n此应用程序被部署为一组服务集合。\n\n## 结果\n\n### 优势\n\n此类解决方案拥有以下优势:\n\n- 每项微服务相对较小\n - 易于开发者理解\n - IDE处理速度更快,可提高开发者生产效率\n - WebĺŽšĺ™¨ĺŻĺŠ¨é€ŸĺşŚć›´ĺżŤďźŒćéŤ˜ĺź€ĺ‘č€…ç”Ÿäş§ć•ˆçŽ‡ĺšśĺŻĺŠ ĺżŤéƒ¨ç˝˛é€ŸĺşŚ\n- 每项服务皆可独立于其它服务进行部署——简化频繁部署新服务版本的流程\n- 易于实现规模化开发。多团队可以共同进行开发工作。每个(双披萨,即团队成员规模控制在订购两块披萨即可吃饱的程度)团队负责其中一项服务。各团队可独立于其他团队,进行开发、部署工作及扩展自身服务。\n- 改善故障隔离。举例来说,如果某一服务出现内存外溢,则只有该服务本身受到影响。其它服务将继续正常处理请求。相比之下,单体架构中的故障组件会令整套系统陷入瘫痪。\n- 每项服务可独立进行开发与部署\n- ć— éœ€é•żćœŸä˝żç”¨ĺŒä¸€ĺĽ—ćŠ€ćœŻĺ †ć ˆ\n\n### 弊端:\n\n但这类解决方案中也存在着以下弊端:\n\n- ĺź€ĺ‘č€…ĺż…éĄťĺş”ĺŻšĺˆ›ĺťşĺˆ†ĺ¸ƒĺźçłťçťŸć‰€äş§ç”Ÿçš„é˘ĺ¤–çš„ĺ¤ć‚ĺ› ç´ ă€‚\n - 现有开发者工具/IDEä¸ťčŚé˘ĺ‘ĺ•ä˝“ĺş”ç”¨ç¨‹ĺşďźŒĺ› ć­¤ć— ćł•ć˜žĺźć”ŻćŒĺˆ†ĺ¸ƒĺźĺş”ç”¨çš„ĺź€ĺ‘ă€‚\n - ćľ‹čŻ•ĺˇĽä˝œć›´ĺŠ ĺ›°éšžă€‚\n - 开发者必须采取服务间通信机制。\n - 很难在不使用分布式事务机制的情况下跨服务实现功能。\n - 跨服务实现功能要求各团队进行密切协作。\n- 部署复杂。在生产环境下,对这类多种服务类型构建而成的系统进行部署与管理十分困难。\n- ĺ†…ĺ­˜ĺ ç”¨é‡ć›´éŤ˜ă€‚ĺžŽćœĺŠĄćžśćž„ä˝żç”¨N*M个服务实例替代N个单体应用实例,如果每项服务运行自己的JVM(或者其它类似机制),且各实例之间需要进行隔离,那将导致M倍JVM运行时的额外开销。另外,如果每项服务都在自己的虚拟机(例如 EC2 实例)上运行,如同Netflixä¸€ć ˇďźŒé‚Łäšˆé˘ĺ¤–ĺź€é”€äźšć›´éŤ˜ă€‚\n\n### 需要解决的问题\n\n采用微服务架构之前,有若干需要解决的问题。\n\n#### 何时应该使用微服务架构?\n\n应用此类方案带来的挑战在于如何把握好时机。在开发应用程序的最初版本时,大家往往不会面临需要使用微服务架构才能解决的问题。另外,使用复杂的分布式架构会拖慢开发流程。对于初创企业,其面临的最大挑战往往在于如何快速发展商业模式及附属应用。微服务架构中的Yč˝´ć‹†ĺˆ†ć–šĺźĺŻčƒ˝ä˝żĺş”ç”¨ć›´ĺŠ éšžäťĽčż…é€Ÿčż­äťŁă€‚ä˝†ć˜ŻďźŒĺŚ‚ćžœĺ˝“é˘ä¸´éœ€čŚč§Łĺ†łć‰Šĺą•ć€§é—Žé˘˜çš„ć—śĺ€™ĺ†ĺŽťčż›čĄŒĺŠŸčƒ˝ć‹†ĺˆ†ďźŒĺ•ä˝“ĺş”ç”¨çš„ĺ¤ć‚äžčľ–ć€§ä˝żĺ…śĺžˆéšžč˘Ťĺˆ†č§Łä¸şćœĺŠĄé›†ĺˆă€‚\n\n#### 如何将应用拆分为服务?\n\n另一项挑战在于如何将系统拆分为多个微服务。这虽然很棘手但还是有些可行之策:\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†ďźˆDecompose by business capability)](decomposition/decompose-by-business-capability.html) - ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ç•ŒĺŽšćœĺŠĄçš„čŒƒĺ›´\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†ďźˆDecompose by subdomain)](decomposition/decompose-by-subdomain.html) - ć šćŽé˘†ĺŸŸéŠąĺŠ¨čŽžčŽĄä¸­ĺ­ĺŸŸçš„ćŚ‚ĺżľç•ŒĺŽšćœĺŠĄçš„čŒƒĺ›´\n- ć šćŽâ€œĺŠ¨čŻâ€ćˆ–č€…ç”¨äž‹čż›čĄŒćœĺŠĄĺˆ’ĺˆ†ă€‚ä¸žäž‹ćĽčŻ´ďźŒćˆ‘äťŹçťĺ¸¸äźšĺœ¨ç”ľĺ­ĺ•†ĺŠĄĺş”ç”¨ä¸­ĺ‘çŽ°ćœ‰ĺ•ç‹Źçš„â€œĺ‘č´§â€ćœĺŠĄç”¨äşŽĺ¤„ç†ĺˇ˛ĺŽŒćˆčŽ˘ĺ•ă€‚ĺŚä¸€ç§ĺ¸¸č§çš„â€œĺŠ¨čŻâ€ĺˆ’ĺˆ†ć–šĺźć˜ŻĺŽžçŽ°ç™ťĺ˝•ç”¨äž‹çš„â€œç™ťĺ˝•â€ćœĺŠĄă€‚\n- ć šćŽâ€œĺčŻâ€ćˆ–č€…čľ„ćşčż›čĄŒçłťçťŸĺˆ’ĺˆ†ă€‚čż™çąťćœĺŠĄč´Ÿč´ŁĺˆŠç”¨ç‰šĺŽšçš„ĺŽžä˝“/资源完成一系列操作。举例来说,大家可能会在电子商务系统当中发现有“库存”服务用于跟踪货物的库存。\n\n在理想情况下,每项服务都应只面向一小部分职责。(大叔)Bob Martin ć›žćĺ‡şć šćŽĺ•ä¸€č´ŁäťťĺŽŸĺˆ™ďźˆSingle Responsibility Principle,简称 SRP)进行类的设计。SRP äźšç”¨ĺ•ä¸€ĺ˜ć›´ç†ç”ąĺŽťĺŽšäš‰ä¸€ä¸Şçąťçš„čŒč´Łďźšä¸€ä¸Şçąťçš„çŠść€ĺ˜ć›´ĺŞčƒ˝ç”ąä¸€ä¸ŞĺŽŸĺ› ĺŻźč‡´ă€‚ĺŒç†ďźŒćˆ‘äťŹäšŸĺŻäťĽĺœ¨ĺžŽćœĺŠĄčŽžčŽĄĺ˝“ä¸­ĺź•ĺ…Ľ SRP。\n\n另一项可用于指导服务设计的是Unix工具的设计思路。Unix 提供大量工具选项,包括 grep、cat 以及 find 等等。每种工具都只负责实现一项功能,而且功能良好,它们可以通过Shell脚本与其它工具结合进而执行复杂的任务。\n\n#### 如何维护数据一致性?\n\n为了确保松耦合,每个服务都有独用的数据库。维护服务间的数据一致性成为了挑战。在多数应用的架构下,2 阶段提交和分布式事务不再是一个可选项。应用需要采用[事件驱动架构](data/event-driven-architecture.html)ďźŒä¸€ä¸ŞćœĺŠĄĺœ¨ĺ…ść•°ćŽĺ‘ç”Ÿĺ˜ĺŒ–ć—śďźŒĺŻšĺ¤–ĺ‘ĺ¸ƒä¸€ä¸Şäş‹äťśďźŒĺ…śäť–ćœĺŠĄčŽ˘é˜…ĺšśé€ščż‡ćśˆč´ščż™ä¸Şäş‹äťśćĽĺŻšĺş”ć›´ć–°č‡Şĺˇąçš„ć•°ćŽă€‚ćœ‰ä¸€äş›ĺŻé çš„ć–šĺźĺŻäťĽĺŽžçŽ°äş‹äťśçš„ĺ‘ĺ¸ƒĺ’Œć•°ćŽçš„ć›´ć–°ďźŒćŻ”ĺŚ‚[事件溯源](data/event-sourcing.html) 和[事物日志跟踪](data/transaction-log-tailing.html)。\n\n#### 如何实现数据查询?\n\n另一个挑战是进行跨服务的数据的查询。一个常用的解决方式是采用[CQRS](data/cqrs.html),维护一份包含重要数据的视图并通过事件流的方式保持数据的更新。\n\n## 相关模式\n\n微服务架构有很多与之相关的模式,[单体架构](monolithic.html) 便是微服务架构的另一众选择。在应用微服务架构时,您还会跟如下这些模式打交道:\n\n- 服务拆分模式\n - [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/decomposition/decompose-by-business-capability.html) new\n - [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/decomposition/decompose-by-subdomain.html) new\n- [每服务数据库模式](data/database-per-service.html) 描述了服务之间采用独享数据库的方式实现了解耦合。\n- [API 网关模式](apigateway.html) 定义在微服务架构下客户端访问服务的方式。\n- [客户端服务发现](client-side-discovery.html) 和 [服务器端服务发现](server-side-discovery.html) 模式用来在微服务架构中把客户端请求路由到一个可用的服务实例上。\n- 消息和远程过程调用是服务间通信的两种选择。\n- [单主机上部署服务的单个实例](deployment/single-service-per-host.html) 和 [单主机上部署服务的多个实例](deployment/multiple-services-per-host.html) 模式是两种不同的部署策略。\n- 解决边界问题的模式:: [微服务的基底模式](/patterns/microservice-chassis.html) 和 [配置信息外部化](/patterns/externalized-configuration.html) new\n- 可测试性模式: [服务组件测试](testing/service-component-test.html) new 和 [服务集成协议测试](testing/service-integration-contract-test.html) new\n- [断路器](/patterns/reliability/circuit-breaker.html) new\n- [访问令牌](/patterns/security/access-token.html) new\n- 可观测性模式:\n - [应用日志](/patterns/observability/application-logging.html) new\n - [ĺş”ç”¨ćŒ‡ć ‡](/patterns/observability/application-metrics.html) new\n - [审计日志](/patterns/observability/audit-logging.html) new\n - [分布式追踪](/patterns/observability/distributed-tracing.html) new\n - [异常追踪](/patterns/observability/exception-tracking.html) new\n - [健康检查](/patterns/observability/health-check-api.html) new\n- UI 模式:\n - [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/ui/server-side-page-fragment-composition.html) new\n - [厢戡獯 UI 构建](/patterns/ui/client-side-ui-composition.html) new\n\n## 已知案例\n\n众多大型网站将单体架构发展为微服务架构,其中包括 [Netflix](http://techblog.netflix.com/)、[Amazon](http://highscalability.com/blog/2007/9/18/amazon-architecture.html) 与 [eBay](http://www.addsimplicity.com/downloads/eBaySDForum2006-11-29.pdf) 等。\n\n作为一个热门视频流服务,Netflix 利用一套大规模的面向服务的架构来承载高于 30% 的互联网流量。该公司每天需要处理来自 800 多种设备的 10 亿多次视频流 API 请求。平均每次 API 调用会在后端服务中产生 6 次后续调用。\n\nAmazon.com 最初采用一套双层架构。为了扩展业务规模,其决定迁移至一套由数百项后端服务构成的面向服务的架构。多个应用调用这些服务,其中包括 Amazon.com网站和Web服务API。Amazon.com 网站需要调用 100 到 150 个服务方可获取到构建一个 Web 页面所需的全部数据。\n\n作为拍卖网站,eBay.com 也是从单体架构逐步转向面向服务的架构。其应用层由多个独立应用构成。每个应用负责实现完成一组特定功能的业务逻辑,例如购买或者出售。每个应用皆利用X轴进行拆分,部分应用(例如搜索)以Z轴进行拆分。eBay.com 还在数据库层采用了 X、Y 与 Z 轴相结合的扩展方式。\n\n[这里](../../articles/whoisusingmicroservices.html)汇聚了使用微服务架构企业的众多案例。\n\n# ç¤şäž‹äťŁç \n\nChris Richardson 提供了一套基于微服务架构的[ç¤şäž‹äťŁç ](http://eventuate.io/exampleapps.html) 。\n\n# 致谢\n\n为了避免重复翻译,本文在中国普元公司宋潇文先生的[译文](http://blog.csdn.net/xn_sung/article/details/52318956)基础之上整理修订,在此向宋潇文先生表示感谢!\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 16544, "slov": 583, "odkazu": 93, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/microservices.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:06:58", "sha256": "2a505d385fc4de34fd444d8fe12db690628c9a75279200014f2d6c3785bc890f", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "http://techblog.netflix.com/", "http://highscalability.com/blog/2007/9/18/amazon-architecture.html", "http://www.addsimplicity.com/downloads/eBaySDForum2006-11-29.pdf", "http://blog.csdn.net/xn_sung/article/details/52318956", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/monolithic.html", "titulek": "Monolithic Architecture pattern", "h1": "模式: 单体架构", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "模式: 单体架构"}, {"uroven": 2, "text": "背景"}, {"uroven": 2, "text": "问题"}, {"uroven": 2, "text": "需求(Forces)"}, {"uroven": 2, "text": "方案"}, {"uroven": 2, "text": "ä¸žä¸Şć —ĺ­"}, {"uroven": 2, "text": "结果(Resulting context)"}, {"uroven": 2, "text": "相关模式"}, {"uroven": 2, "text": "已知案例"}, {"uroven": 2, "text": "变体"}, {"uroven": 2, "text": "致谢"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# 模式: 单体架构\n\n## 背景\n\n在开发服务端企业应用时,应用需要支持各种不同类型的客户端,比如桌面浏览器、移动浏览器以及原生移动应用。应用还需要向第三方提供可访问的API,并通过Web Service或者消息代理与其它应用实现集成。应用通过执行业务逻辑、访问数据库、与其它系统交换信息、并返回一条HTML/JSON/XML响应,来处理请求(HTTP请求与消息)。\n\nĺş”ç”¨é‡‡ç”¨ĺ¤šĺą‚ćžśćž„ćˆ–č€…ĺ…­č§’ćžśćž„ďźŒä¸ťčŚç”ąäťĽä¸‹ĺ‡ çąťä¸ĺŒçť„äťśćž„ćˆďźš\n\n- 展现组件——负责处理HTTP请求并响应HTML或者JSON/XML(对于web Services APIs)\n- 业务逻辑——应用的业务逻辑\n- 数据库访问逻辑——用于访问数据库的数据访问对象\n- 应用集成逻辑——消息层,例如基于Spring Integration\n\n不同逻辑组件分别响应应用中的不同功能模块。\n\n## 问题\n\n应用的部署架构是什么?\n\n## 需求(Forces)\n\n- 应用需要由一个开发者团队专门负责\n- 团队新成员需要快速上手\n- 应用应该易于理解和修改\n- 对应用能够进行持续部署\n- 需要在多台设备上运行应用副本,从而满足可扩展性与可用性的要求\n- 使用各种新技术(框架、编程语言等)\n\n## 方案\n\n使用单体架构构建应用。例如:\n\n- 单个Java WAR文件。\n- 单个Rails或者NodeJSäťŁç ç›Žĺ˝•ĺą‚çş§ă€‚\n\n## ä¸žä¸Şć —ĺ­\n\n假设需要构建一款电子商务应用程序,使其能够接收来自客户的订单、验证库存信息与可用信用额度,而后进行发货。该应用程序会包含多个组件,其中StoreFrontUI负责实现用户界面,而其它后端服务则分别负责检查信用额度、维护库存信息以及发送订单。\n\n应用被当作一个单体进行部署。例如:一个 Java Web 应用仅包含一个运行在 Tomcat 之类的 Web 容器上 WAR 文件。一个 Rails 应用由单一目录层级构成,该目录层级的部署通过在 Apache/Nginx 上使用 Phusion Passenger,或者在 Tomcat 上使用 JRuby ĺž—äťĽĺŽžçŽ°ă€‚ä¸şäş†ćéŤ˜ć‰Šĺą•ć€§ĺ’ŒĺŻç”¨ć€§ďźŒä˝ ĺŻäťĽĺœ¨č´Ÿč˝˝ĺ‡čĄĄĺ™¨äš‹ĺŽčżčĄŒć­¤ĺş”ç”¨çš„ĺ¤šä¸ŞĺŽžäž‹ă€‚\n\n## 结果(Resulting context)\n\n这类解决方案拥有以下优势:\n\n- 易于开发 — 当前开发工具与IDEçš„čŽžčŽĄç›Žć ‡ĺłĺœ¨äşŽć”ŻćŒĺ•ä˝“ĺş”ç”¨çš„ĺź€ĺ‘ă€‚\n- 易于部署 — ä˝ ĺŞéœ€čŚĺ°†čŻĽWAR(或者目录层级)部署在合适的运行环境中即可。\n- 易于扩展 — ä˝ ĺŻäťĽĺœ¨č´Ÿč˝˝ĺ‡čĄĄĺ™¨ĺŽé˘čżčĄŒĺ¤šä¸Şĺş”ç”¨ĺ‰ŻćœŹĺŽžçŽ°ć‰Šĺą•ă€‚\n\n然而,一旦应用变大、团队扩大,这种方案的弊端将会变得愈发明显:\n\n- ĺ•ä˝“ĺş”ç”¨ĺˇ¨ĺ¤§çš„äťŁç ĺş“ĺŻčƒ˝äźščŽŠäşşćœ›č€Œç”Ÿç•ďźŒç‰šĺˆŤć˜ŻĺŻšé‚Łäş›ĺ›˘é˜Ÿć–°ćˆĺ‘˜ćĽčŻ´ă€‚ĺş”ç”¨éšžäťĽč˘Ťç†č§Łĺ’Œčż›čĄŒäżŽć”šďźŒčż›č€ŒĺŻźč‡´ĺź€ĺ‘é€ŸĺşŚĺ‡ć…˘ă€‚ç”ąäşŽć˛Ąćœ‰ć¸…ć™°çš„ć¨Ąĺ—čžšç•ŒďźŒć¨Ąĺ—ĺŒ–äźšé€ć¸ćśˆĺ¤ąă€‚ĺŚĺ¤–ďźŒç”ąäşŽéšžäťĽć­ŁçĄŽćŠŠćĄäťŁç ĺ˜ĺŒ–ďźŒĺŻźč‡´äťŁç č´¨é‡é€ć­Ľä¸‹ćť‘ďźŒé™ˇĺ…Ľćść€§ĺžŞçŽŻă€‚\n- 过载的IDEâ€”â€”äťŁç ĺş“čśŠĺ¤§ďźŒIDE速度越慢,开发者的生产效率越低。\n- 过载的Web容器——应用越大,Web容器启动时间越长。容器启动耗费时间,极大影响到开发者的生产效率。对部署工作也有负面影响。\n- ćŒçť­éƒ¨ç˝˛ĺ›°éšžâ€”â€”ĺˇ¨ĺ¤§çš„ĺ•ä˝“ĺş”ç”¨ćœŹčşŤĺ°ąć˜Żé˘‘çšéƒ¨ç˝˛çš„ä¸€ĺ¤§éšœç˘ă€‚ä¸şäş†ć›´ć–°ä¸€ä¸Şçť„äťśďźŒä˝ ĺż…éĄťé‡ć–°éƒ¨ç˝˛ć•´ä¸Şĺş”ç”¨ă€‚čż™äźšä¸­ć–­é‚Łäş›ĺŻčƒ˝ä¸Žć›´ć”šć— ĺ…łçš„ĺŽĺ°äťťĺŠĄďźˆäž‹ĺŚ‚Java应用中的QuartzäťťĺŠĄďź‰ďźŒĺŒć—śĺŻčƒ˝ĺź•ĺ‘é—Žé˘˜ă€‚ĺŚĺ¤–ďźŒćœŞč˘Ťć›´ć–°çš„çť„äťśćœ‰ĺŻčƒ˝ć— ćł•ć­Łĺ¸¸ĺŻĺŠ¨ă€‚é‡ć–°éƒ¨ç˝˛äźšĺ˘žĺŠ éŁŽé™ŠďźŒčż›č€Œé˜ťç˘é˘‘çšć›´ć–°ă€‚ĺ› ä¸şç”¨ćˆˇç•Œé˘ĺź€ĺ‘č€…çťĺ¸¸éœ€čŚčż›čĄŒĺżŤé€Ÿčż­äťŁä¸Žé˘‘çšé‡ć–°éƒ¨ç˝˛ďźŒć‰€äťĽčż™ĺŻšç”¨ćˆˇç•Œé˘ĺź€ĺ‘č€…č€Œč¨€ć›´ĺŠ ć˜Żä¸Şéšžé˘˜ă€‚\n- ĺş”ç”¨ć‰Šĺą•ĺ›°éšžâ€”â€”ĺ•ä˝“ćžśćž„ĺŞčƒ˝čż›čĄŒä¸€çť´äź¸çźŠă€‚ä¸€ć–šé˘ďźŒĺŽƒĺŻäťĽé€ščż‡čżčĄŒĺ¤šä¸Şĺş”ç”¨ĺ‰ŻćœŹćĽĺ˘žĺŠ ä¸šĺŠĄĺŽšé‡ďźŒĺŽžçŽ°ć‰Šĺą•ă€‚ä¸€äş›äş‘ćœĺŠĄç”šč‡łĺŻäťĽć šćŽč´Ÿč˝˝é‡ĺŠ¨ć€č°ƒć•´ĺŽžäž‹ć•°é‡ă€‚ä˝†ĺœ¨ĺŚä¸€ć–šé˘ďźŒć•°ćŽé‡ĺ˘žĺ¤§äźšä˝żĺž—čŻĽćžśćž„ć— ćł•äź¸çźŠă€‚ćŻä¸Şĺş”ç”¨ĺŽžäž‹éœ€čŚčŽżé—Žć‰€ćœ‰ć•°ćŽďźŒĺŻźč‡´çź“ĺ­˜ä˝Žć•ˆďźŒĺŠ ĺ¤§ĺ†…ĺ­˜ĺ ç”¨ĺ’ŒI/O流量。另外,不同的应用组件有不同的资源需求——有的是CPUĺŻ†é›†ĺž‹çš„ďźŒĺŚĺ¤–ä¸€äş›ć˜Żĺ†…ĺ­˜ĺŻ†é›†ĺž‹çš„ă€‚ĺ•ä˝“ćžśćž„ć— ćł•ĺ•ç‹Źäź¸çźŠćŻä¸Şçť„äťśă€‚\n- 难于进行规模化开发——单体应用是规模化开发的障碍。应用一旦达到特定规模,需要将现有组织拆分成多个团队,每个团队负责不同的功能模块。举例来说,我们可能需要设立UIĺ›˘é˜Ÿă€äźščŽĄĺ›˘é˜Ÿă€ĺş“ĺ­˜ĺ›˘é˜Ÿç­‰ç­‰ă€‚ĺ•ä˝“ĺş”ç”¨çš„é—Žé˘˜ĺœ¨äşŽĺŽƒä˝żĺ›˘é˜Ÿć— ćł•ç‹ŹçŤ‹ĺą•ĺź€ĺˇĽä˝œă€‚ĺ›˘é˜Ÿéœ€čŚĺœ¨ĺˇĽä˝œčż›ĺşŚĺ’Œé‡ć–°éƒ¨ç˝˛ä¸Ščż›čĄŒĺč°ƒă€‚ĺŻšäşŽĺ„ĺ›˘é˜Ÿč€Œč¨€ďźŒčż™ä˝żĺž—ĺ˜ć›´ĺ’Œć›´ć–°äş§ĺ“ĺ˜ĺž—ĺź‚ĺ¸¸ĺ›°éšžă€‚\n- éœ€čŚé•żćœŸĺ…łćł¨ĺŒä¸€ĺĽ—ćŠ€ćœŻć ˆâ€”â€”ĺ•ä˝“ćžśćž„čżŤä˝żćˆ‘äťŹé•żćœŸä˝żç”¨ĺœ¨ĺź€ĺ‘ĺˆćœŸé€‰ĺŽšçš„ćŠ€ćœŻĺ †ć ˆďźˆĺœ¨ćŸäş›ćƒ…ĺ†ľä¸‹ďźŒĺŻčƒ˝ć˜ŻćŸäş›ćŠ€ćœŻçš„ç‰šĺŽšç‰ˆćœŹďź‰ă€‚ĺ•ä˝“ĺş”ç”¨ć˜Żć¸čż›é‡‡ç”¨ć–°ćŠ€ćœŻçš„éšœç˘ă€‚ä¸žäž‹ćĽčŻ´ďźŒĺŚ‚ćžœćˆ‘äťŹé€‰ć‹Šäş†JVM,那么我们可以选择JavaäťĽĺ¤–çš„ä¸€äş›čŻ­č¨€ďźŒĺ› ä¸şGroovy和Scala等基于JVM的语言也可以和Java进行良好的互操作。但此时以非JVMčŻ­č¨€çź–ĺ†™çš„çť„äťśĺ°ąć— ćł•ĺœ¨čŻĽĺ•ä˝“ćžśćž„ä¸­ä˝żç”¨ă€‚ĺŚĺ¤–ďźŒĺŚ‚ćžœĺ¤§ĺŽść‰€ä˝żç”¨çš„ĺş”ç”¨ĺšłĺ°ćĄ†ćžśĺˇ˛çťčż‡ć—śďźŒé‚Łäšˆćˆ‘äťŹĺ°†ĺžˆéšžĺ°†ĺş”ç”¨čżç§ťĺˆ°ĺ…śĺŽƒć›´ć–°ĺšśä¸”ć›´ĺŽŒĺ–„çš„ćĄ†ćžśĺ˝“ä¸­ă€‚ćœ‰ć—śĺ€™ä¸şäş†é‡‡ç”¨ä¸€ĺĽ—ć–°ĺž‹ĺšłĺ°ćĄ†ćžśďźŒćˆ‘äťŹç”šč‡łéœ€čŚé‡ĺ†™ć•´ä¸Şĺş”ç”¨ďźŒčż™ć˜ŻéŁŽé™Šĺžˆĺ¤§çš„ĺˇĽä˝œă€‚\n\n## 相关模式\n\n[微服务架构](microservices.html) 是一种能够解决单体架构各种局限的备选模式。\n\n## 已知案例\n\n知名的互联网服务商最初皆采用单体架构,包括 Netflix、Amazon.com 以及 eBay 等等。作者开发的大多数 Web 应用也是用单体架构。\n\n## 变体\n\nć—\n\n## 致谢\n\nä¸şäş†éżĺ…é‡ĺ¤çżťčŻ‘ďźŒćœŹć–‡ć šćŽä¸­ĺ›˝ć™Žĺ…ƒĺ…Źĺ¸ĺŽ‹ć˝‡ć–‡ĺ…ˆç”Ÿçš„[译文](http://blog.csdn.net/xn_sung/article/details/52318942)整理修订,在此向宋潇文先生表示感谢!\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 11103, "slov": 380, "odkazu": 60, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/monolithic.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:06:56", "sha256": "20359ab541ddaef6bacaa6e7ea997a19d8703e533addf7b21ed20f9dbd76c06b", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "http://blog.csdn.net/xn_sung/article/details/52318942", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/observability/application-logging.html", "titulek": "Log aggregation", "h1": "Pattern: Log aggregation", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Log aggregation"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Log aggregation\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\n\n## Problem\n\nHow to understand the behavior of an application and troubleshoot problems?\n\n## Solution\n\nA service writes information about what it is doing to a log file in a standardized format.\nThe log file contains errors, warnings, information and debug messages.\nUse a centralized logging service that aggregates logs from each services instance and allows users to search.\n\n- [Distributed tracing](distributed-tracing.html) - include the external request id in each log message\n- [Exception tracking](exception-tracking.html) - as well as logging exceptions, report them to an exception tracking service\n\n## Examples\n\n- [AWS Cloud Watch](https://aws.amazon.com/cloudwatch/)\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5830, "slov": 324, "odkazu": 62, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/observability/application-logging.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:39", "sha256": "5be7862a2c729f72e7c071927c01319051a0a922f52e72f3975857a62c6cddef", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://aws.amazon.com/cloudwatch/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/observability/application-metrics.html", "titulek": "Application metrics", "h1": "Pattern: Application metrics", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Application metrics"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Application metrics\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\n\n## Problem\n\nHow to understand the behavior of an application and troubleshoot problems?\n\n## Solution\n\nInstrument a service’s code to gather statistics about individual operations.\nAggregate metrics in centralized metrics service, which provides reporting and alerting.\nThere are two models for delivery metrics to the metrics service:\nMetrics are either pushed to the metrics service or the metrics service pulls them using an API exposed by the service.\n\n## Examples\n\n- Instrumentation libraries:\n - Coda Hale/Yammer [Java Metrics Library](http://metrics.dropwizard.io/3.1.0/)\n - [Prometheus client libraries](https://prometheus.io/docs/instrumenting/clientlibs/)\n- Metrics aggregation services\n - [Prometheus](https://prometheus.io/docs/introduction/overview/)\n - [AWS Cloud Watch](https://aws.amazon.com/cloudwatch/)\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5976, "slov": 320, "odkazu": 63, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/observability/application-metrics.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:40", "sha256": "62c054e1cde5b5e38cec4d936671c47eb513c0eae6308d64930106ba03df4c80", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "http://metrics.dropwizard.io/3.1.0/", "https://prometheus.io/docs/instrumenting/clientlibs/", "https://prometheus.io/docs/introduction/overview/", "https://aws.amazon.com/cloudwatch/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/observability/audit-logging.html", "titulek": "Audit logging", "h1": "Pattern: Audit logging", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Audit logging"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Audit logging\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\n\n## Problem\n\nHow to understand the behavior of an application and troubleshoot problems?\n\n## Solution\n\nRecord user activity in a database.\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5300, "slov": 255, "odkazu": 59, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/observability/audit-logging.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:41", "sha256": "6104307e72e403870067fabf817193e71422cf30f8f9dbd8767fd49ee2451927", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/observability/distributed-tracing.html", "titulek": "Distributed tracing", "h1": "Pattern: Distributed tracing", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Distributed tracing"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Distributed tracing\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\n\n## Problem\n\nHow to understand the behavior of an application and troubleshoot problems?\n\n## Solution\n\nInstrument services with code that assigns each external request an unique identifier.\nThe external request id is passed to all services that are involved in handling the request and included in [Log aggregation](application-logging.html) messages.\nRecord information (e.g. start time, end time) about the work (e.g. service requests) performed when handling the external request in a centralized service.\n\n- [Log aggregation](application-logging.html) - external request identifier is included in each log messages\n\n## Examples\n\n- [Spring Cloud Sleuth](https://cloud.spring.io/spring-cloud-sleuth/) - distributed tracing for Spring Cloud applications\n- [Open Zipkin](http://zipkin.io/) - service for recording and displaying tracing information\n- [Open Tracing](http://opentracing.io) - standardized API for distributed tracing\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 6082, "slov": 347, "odkazu": 63, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/observability/distributed-tracing.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:42", "sha256": "fa37591a831384d425e1f0dc3ecdc7cb8a0d020b97ff873506868a2b9b2a7545", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://cloud.spring.io/spring-cloud-sleuth/", "http://zipkin.io/", "http://opentracing.io/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/observability/exception-tracking.html", "titulek": "Exception tracking", "h1": "Pattern: Exception tracking", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Exception tracking"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Exception tracking\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\n\n## Problem\n\nHow to understand the behavior of an application and troubleshoot problems?\n\n## Solution\n\nReport all exceptions to a centralized exception tracking service that aggregates and tracks exceptions and notifies developers.\n\n- [Log aggregation](application-logging.html) - exceptions should be logged as well as reported to a tracking service\n\n> (译注:[sentry](https://sentry.io/welcome/)ĺ°ąć˜Żćäž›čż™ć ˇćœĺŠĄçš„ä¸€ä¸Ş SaaS 应用)\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5611, "slov": 285, "odkazu": 61, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/observability/exception-tracking.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:43", "sha256": "9cfad86ea578707c3de52b02f139f8b4d0b0d420ea7a4646ba1cb7194a55e8d2", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://sentry.io/welcome/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/observability/health-check-api.html", "titulek": "Health Check", "h1": "Pattern: Health Check API", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Health Check API"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Health Check API\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\n\n## Problem\n\nHow to understand the behavior of an application and troubleshoot problems?\n\n## Solution\n\nA service has an API (e.g. HTTP endpoint) that returns the health of the service.\nA monitoring service, monitoring service, [service registry](../service-registry.html) or load balancer can ‘ping’ the health check API to verify that a service instance is available.\n\n## Examples\n\n- [Spring Boot Actuator](http://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html)\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5666, "slov": 297, "odkazu": 61, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/observability/health-check-api.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:44", "sha256": "ac0b3df60d10e54f8a6b187ffd692ff23b2118baa05da9206c1f032b534e630b", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "http://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/reliability/circuit-breaker.html", "titulek": "Circuit Breaker", "h1": "Pattern: Circuit Breaker", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Circuit Breaker"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Example"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Circuit Breaker\n\n## Problem\n\nHow to prevent a network or service failure from cascading to other services?\n\n## Solution\n\nA service client should invoke a remote service via a proxy that functions in a similar fashion to an electrical circuit breaker.\nWhen the number of consecutive failures crosses a threshold, the circuit breaker trips, and for the duration of a timeout period all attempts to invoke the remote service will fail immediately.\nAfter the timeout expires the circuit breaker allows a limited number of test requests to pass through.\nIf those requests succeed the circuit breaker resumes normal operation.\nOtherwise, if there is a failure the timeout period begins again.\n\n- The [Microservice Chassis](../microservice-chassis.html) might implement this pattern\n- An [API Gateway](../apigateway.html) will use this pattern to invoke services\n- A [Server-side discovery](../server-side-discovery.html) router might use this pattern to invoke services\n\n## Example\n\n- [Netflix Hystrix](https://github.com/Netflix/Hystrix)\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 6081, "slov": 369, "odkazu": 62, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/reliability/circuit-breaker.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:28", "sha256": "790f63690ea4964d37e25b444e63c322e6448bf0ac307d3c452ae7c6560c4e9f", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://github.com/Netflix/Hystrix", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/security/access-token.html", "titulek": "Access token", "h1": "Pattern: Access token", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Access token"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Access token\n\n## Problem\n\nHow to communicate the identity of the requestor to the services that handle the request?\n\n## Solution\n\nThe [API Gateway](../apigateway.html) authenticates the user and passes an access token (e.g. [JSON Web Token](https://jwt.io/)) that securely identifies the user in each request to the services.\n\n- The [API Gateway](../apigateway.html) uses this pattern.\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5441, "slov": 277, "odkazu": 60, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/security/access-token.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:36", "sha256": "2df0ed5652ddbf68aac59721abd80d530591503b4ac60c0dcd3caa0aac1fcec5", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://jwt.io/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/self-registration.html", "titulek": "Self Registration pattern", "h1": "模式: 自注册", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "模式: 自注册"}, {"uroven": 2, "text": "背景"}, {"uroven": 2, "text": "问题"}, {"uroven": 2, "text": "需求"}, {"uroven": 2, "text": "方案"}, {"uroven": 2, "text": "示例"}, {"uroven": 2, "text": "结果"}, {"uroven": 2, "text": "相关模式"}, {"uroven": 2, "text": "致谢"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# 模式: 自注册\n\n## 背景\n\n如采用[客户端服务发现模式](client-side-discovery.html)或者[服务器端服务发现模式](client-side-discovery.html),各服务实例必须在启动时注册至服务注册表,从而保证其能够被获取,并在关闭时进行注销。\n\n## 问题\n\n如何在服务注册表内注册和注销服务实例?\n\n## 需求\n\n- 各服务实例必须在启动时被注册至服务注册表,并在关闭时进行注销。\n- 崩溃的服务实例必须从服务注册表中注销。\n- ĺœ¨čżčĄŒä˝†ć— ĺŠ›ĺ¤„ç†čŻˇćą‚çš„ćœĺŠĄĺŽžäž‹ĺż…éĄťäťŽćœĺŠĄćł¨ĺ†ŒčĄ¨ä¸­ćł¨é”€ă€‚\n\n## 方案\n\n一项服务实例必须可以自动注册到服务注册表中。在启动时,该服务实例将自身(主机与IP地址)注册至服务注册表,使自身可被发现。客户端必须定期更新其注册信息,确保注册表获悉其仍处于运行状态。在关闭时,服务实例从服务注册表中自动注销。\n\n这一流程通常由[微服务基底框架](microservice-chassis.html)实现。\n\n## 示例\n\n[Netflix Eureka](https://github.com/Netflix/eureka/wiki/Understanding-eureka-client-server-communication) 即是服务注册表的一个例子。它为服务实现自动注册(注销)提供一个注册API及一套客户端库。\n\n在使用 [Apache Zookeeper](http://zookeeper.apache.org) 作为服务注册表时,每项服务对应一个特定的Zookeeper znode。在启动时,各服务实例会在该服务的znode下创建一个具有短暂存活时间的子znode。该子znode中包含该实例的位置信息。服务客户端通过检索该服务的子znode即可判断对应服务实例的可用性。如果服务实例终止但未移除对应的子znode,Zookeeper会在该子znode的存活时间超时后将其移除。\n\n## 结果\n\n自注册模式的优势在于:\n\n- ćœĺŠĄĺŽžäž‹äş†č§Łč‡ŞčşŤçŠść€ďźŒĺ› ć­¤čƒ˝ĺ¤ŸĺŽžçŽ°ćŻ”ĺŻĺŠ¨/停止更为复杂的状态模型,例如启动中、可用……\n\n但自注册模式也存在着以下弊端:\n\n- 将服务与服务注册表耦合起来。\n- 需要为编写服务时使用的每种编程语言/框架分别实现服务注册逻辑,例如Node.JS/JavaScript、Java/Scala等等。\n- äťĺœ¨čżčĄŒä˝†ć— ćł•ĺ¤„ç†čŻˇćą‚çš„ćœĺŠĄĺŽžäž‹é€šĺ¸¸ć— ćł•č‡ŞĺŠ¨ĺœ¨ćœĺŠĄćł¨ĺ†ŒčĄ¨ä¸­čż›čĄŒč‡Şćˆ‘ćł¨é”€ă€‚\n\n## 相关模式\n\n- [服务注册表](service-registry.html) - 服务发现机制中的重要部分。\n- [客户端服务发现](client-side-discovery.html) - 服务实例发现的方式之一。\n- [服务器端服务发现](server-side-discovery.html) - 服务实例发现的另一方式。\n- [微服务的基底](microservice-chassis.html) - 微服务底盘框架负责实现自注册功能。\n- [第三方注册](3rd-party-registration.html) 是备选方案。\n\n## 致谢\n\nä¸şäş†éżĺ…é‡ĺ¤çżťčŻ‘ďźŒćœŹć–‡ć šćŽä¸­ĺ›˝ć™Žĺ…ƒĺ…Źĺ¸ĺŽ‹ć˝‡ć–‡ĺ…ˆç”Ÿçš„[译文](http://blog.csdn.net/xn_sung/article/details/52336772)整理修订,在此向宋潇文先生表示感谢!\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 7979, "slov": 313, "odkazu": 66, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/self-registration.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:26", "sha256": "8fd90a1453b0b777bd977fc8bb2a2127112c1e2672997df490886160c3439fd7", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://github.com/Netflix/eureka/wiki/Understanding-eureka-client-server-communication", "http://zookeeper.apache.org/", "http://blog.csdn.net/xn_sung/article/details/52336772", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/server-side-discovery.html", "titulek": "Server-side service discovery pattern", "h1": "模式: 服务器端服务发现", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "模式: 服务器端服务发现"}, {"uroven": 2, "text": "背景"}, {"uroven": 2, "text": "问题"}, {"uroven": 2, "text": "需求"}, {"uroven": 2, "text": "方案"}, {"uroven": 2, "text": "例子"}, {"uroven": 2, "text": "结果"}, {"uroven": 2, "text": "相关模式"}, {"uroven": 2, "text": "致谢"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# 模式: 服务器端服务发现\n\n## 背景\n\nä¸ĺŒćœĺŠĄäš‹é—´é€šĺ¸¸éœ€čŚç›¸äş’č°ƒç”¨ă€‚ĺœ¨ĺ•ä˝“ĺş”ç”¨ç¨‹ĺşĺ˝“ä¸­ďźŒćœĺŠĄé—´é€ščż‡čŻ­č¨€ĺą‚çş§çš„ć–šćł•ćˆ–č€…čż‡ç¨‹ĺŽžçŽ°ç›¸äş’č°ƒç”¨ă€‚ĺœ¨äź çťŸçš„ĺˆ†ĺ¸ƒĺźçłťçťŸéƒ¨ç˝˛ä¸‹ďźŒćœĺŠĄĺœ¨ĺ›şĺŽšĺšśä¸”ĺˇ˛çŸĽçš„ä˝ç˝Žďźˆä¸ťćœşä¸ŽçŤŻĺŁďź‰čżčĄŒďźŒäťŽč€ŒçĄŽäżĺ„ćœĺŠĄĺŻĺˆŠç”¨HTTP/REST或者某种RPC机制进行相互调用。然而,现代化[微服务应用程序](microservices.html)ä¸­é€šĺ¸¸ĺœ¨č™šć‹ŸĺŒ–ćˆ–č€…ĺŽšĺ™¨ĺŒ–çŽŻĺ˘ƒä¸­čżčĄŒďźŒĺœ¨čż™ć ˇçš„çŽŻĺ˘ƒä¸­ćœĺŠĄçš„ĺŽžäž‹ć•°é‡ĺ’Œä˝ç˝Žć˜ŻĺŠ¨ć€ĺ˜ĺŒ–çš„ă€‚\n\nĺ› ć­¤ďźŒčŚćƒłĺŽžçŽ°ĺŽ˘ćˆˇçŤŻĺ‘ĺŠ¨ć€ĺ˜ĺŒ–çš„ä¸€çť„ćœĺŠĄçŤŻĺŽžäž‹ĺ‘é€čŻˇćą‚ďźŒćˆ‘äťŹĺż…éĄťé‡‡ç”¨ć–°çš„ćœşĺˆśă€‚\n\n## 问题\n\n服务的客户端——包括API网关或者其它服务——如何才能获取服务端实例的位置?\n\n## 需求\n\n- 每一服务实例都会在特定位置(主机与端口)通过HTTP/REST或者Thrift等方式发布一个远程API。\n- 服务端实例的具体数量及位置会发生动态变化。\n- 虚拟机与容器通常会被分配动态IP地址。\n- 服务实例的数量会发生动态变化。例如,ECč‡ŞĺŠ¨äź¸çźŠçť„äźšć šćŽč´Ÿč˝˝ćƒ…ĺ†ľéšć—śč°ƒć•´ĺŽžäž‹ć•°é‡ă€‚\n\n## 方案\n\n在向某一服务发送请求时,客户端会通过在已知位置运行的路由器(或者是负载均衡器)发送请求。路由器会查询[服务注册表](service-registry.html),并向可用的服务实例转发该请求。服务注册表也可能背内建于路由器之中。\n\n以下示意图展现了这种模式的结构:\n\n## 例子\n\nAWS Elastic Load Balancer(即AWS弹性负载均衡,简称ELB)便是一个服务器端服务发现模式的例子。客户端向该ELB发出HTTPS)请求(或者开启TCP连接),而ELB则在一组EC2实例中对该流量进行负载均衡。ELB既能够对来自互联网的外部流量进行负载均衡,又能够被部署在VPC中,对内部流量进行负载均衡。ELBĺŒć ˇĺŻä˝œä¸ş[服务注册表](service-registry.html)发挥作用。EC2实例可通过API调用或者借助自动伸缩分组机制注册至ELB。\n\n一些集群解决方案如 [Kubernetes](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/services.md) 以及 [Marathon](https://mesosphere.github.io/marathon/docs/service-discovery-load-balancing.html),会在每台主机上运行一套代理,用来提供服务器端服务发现模式的路由机制。为了访问服务,客户端可以利用被分配至该服务的端口接入这个本地代理。该代理随后会将各请求转发给在集群某处运行的服务实例。\n\n## 结果\n\n服务器端发现机制拥有以下优势:\n\n- 相较于 [客户端服务发现](client-side-discovery.html) ďźŒĺ…śĺŽ˘ćˆˇçŤŻäťŁç ç”ąäşŽć— éœ€ĺŽžçŽ°ĺ‘çŽ°ĺŠŸčƒ˝č€Œć›´ä¸şçŽ€ĺ•ă€‚č€Œä¸”ĺŽ˘ćˆˇçŤŻĺŞéœ€čŚĺ‘čˇŻç”ąćœşĺˆśĺ‘é€čŻˇćą‚ĺłĺŻă€‚\n- 部分云环境提供此项功能,例如AWS Elastic Load Balancer。\n\n但服务器端发现机制亦存在着以下弊端:\n\n- 除非成为云环境的一部分,否则该路由机制必须作为另一系统组件进行安装与配置。为实现可用性和一定的接入能力,还需要为其配置一定数量的副本。\n- 相较于 [客户端服务发现](client-side-discovery.html) ,服务器端发现机制需要更多的网络跳转。\n\n## 相关模式\n\n- [服务注册表](service-registry.html)\n- [断路器](reliability/circuit-breaker.html)\n- [客户端服务发现](client-side-discovery.html)\n\n## 致谢\n\n- ä¸şäş†éżĺ…é‡ĺ¤çżťčŻ‘ďźŒćœŹć–‡ć šćŽä¸­ĺ›˝ć™Žĺ…ƒĺ…Źĺ¸ĺŽ‹ć˝‡ć–‡ĺ…ˆç”Ÿçš„ [译文](http://blog.csdn.net/xn_sung/article/details/52336752) 整理修订,在此向宋潇文先生表示感谢!\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 8679, "slov": 324, "odkazu": 65, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/server-side-discovery.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:24", "sha256": "ccceaad503167661e3e9f15070b44d4f6cc00a152abe43a1c7922fb882421410", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/services.md", "https://mesosphere.github.io/marathon/docs/service-discovery-load-balancing.html", "http://blog.csdn.net/xn_sung/article/details/52336752", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/service-registry.html", "titulek": "Service registry pattern", "h1": "模式: 服务注册表", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "模式: 服务注册表"}, {"uroven": 2, "text": "背景"}, {"uroven": 2, "text": "问题"}, {"uroven": 2, "text": "需求"}, {"uroven": 2, "text": "方案"}, {"uroven": 2, "text": "示例"}, {"uroven": 2, "text": "结果"}, {"uroven": 2, "text": "相关模式"}, {"uroven": 2, "text": "致谢"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# 模式: 服务注册表\n\n## 背景\n\n一项服务的客户端需要使用[客户端服务发现](client-side-discovery.html)或者[服务器端服务发现](server-side-discovery.html)机制,从而获取给其发送请求的服务实例的位置。\n\n## 问题\n\n服务的客户端(在[客户端服务发现](client-side-discovery.html)机制中)或者服务路由(在[服务器端服务发现](server-side-discovery.html)机制中)如何获取可用服务实例的信息?\n\n## 需求\n\n- 每个服务实例都会在特定位置(主机与端口)通过HTTP/REST或者Thrift等方式发布一个远程API。\n- 服务实例的数量和位置会发生动态变化。虚拟机与容器通常会被分配给一个动态IP地址。例如,AWS的EC2č‡ŞĺŠ¨äź¸çźŠçť„äźšć šćŽč´Ÿč˝˝ćƒ…ĺ†ľč°ƒć•´ĺŽžäž‹ć•°é‡ă€‚\n\n## 方案\n\n建立一套服务注册表,即一个包括服务、服务的实例和其位置信息的数据库。各服务实例需要在启动时注册至该服务注册表,并在关闭时进行注销。该服务的客户端以及/或者路由器通过查询此服务注册表以找到可用的服务实例。\n\n## 示例\n\n服务注册表的例子(或者经常作为服务注册表使用的技术)包括:\n\n- [Eureka](https://github.com/Netflix/eureka/wiki/Eureka-at-a-glance)\n- [Apache Zookeeper](http://zookeeper.apache.org)\n- [Consul](https://consul.io/)\n- [Etcd](https://github.com/coreos/etcd)\n\nKubernetes、Marathon 以及 AWS ELB 等系统中存在一套隐式的服务注册表。\n\n## 结果\n\n服务注册表模式的优势包括:\n\n- 服务的客户端及/或路由器能够获取服务实例的位置。\n\n服务注册表模式的弊端包括:\n\n- é™¤éžć­¤ćœĺŠĄćł¨ĺ†ŒčĄ¨č˘Ťĺ†…ç˝ŽäşŽĺŸşçĄ€čŽžć–˝ďźŒĺŚĺˆ™ĺ…śĺż…éĄťä˝œä¸şĺŚĺ¤–çš„ĺŸşçĄ€čŽžć–˝çť„äťśčż›čĄŒĺŽ‰čŁ…ă€é…ç˝Žä¸ŽçŽĄç†ă€‚ĺŚĺ¤–ďźŒćœĺŠĄćł¨ĺ†ŒčĄ¨äšŸć˜Żä¸€ä¸Şĺžˆĺ…łé”Žçš„çłťçťŸçť„äťśă€‚ĺ°˝çŽĄĺŽ˘ćˆˇçŤŻĺş”ĺ˝“ĺŻšćœĺŠĄćł¨ĺ†ŒčĄ¨ćäž›çš„ć•°ćŽčż›čĄŒçź“ĺ­˜ďźŒä˝†ä¸€ć—ŚčŻĽćœĺŠĄćł¨ĺ†ŒčĄ¨ĺ‘ç”Ÿć•…éšœé‚Łäšˆčż™äş›ć•°ćŽĺ°ąäźščż‡ćœŸă€‚ĺ› ć­¤ďźŒćœĺŠĄćł¨ĺ†ŒčĄ¨ĺż…éĄťćœ‰ćžéŤ˜çš„ĺŻç”¨ć€§ă€‚\n\n开发者需要决定各服务实例如何注册至该服务注册表。有两个选项:\n\n- [自注册模式](self-registration.html) - 服务实例自行完成注册。\n- [第三方注册模式](3rd-party-registration.html) - 由第三方注册工具将各服务实例注册至服务注册表。\n\n服务注册表的客户端需要获取服务注册表实例的位置。另外,各服务注册表实例也必须被部署在固定且已知的IP地址上。各客户端则利用这些IP地址进行配置。\n\n举例来说,[Netflix Eureka](https://github.com/Netflix/eureka/wiki/Configuring-Eureka-in-AWS-Cloud)ćœĺŠĄĺŽžäž‹é€šĺ¸¸äźšć šćŽĺźšć€§IP地址进行部署。其弹性IPĺœ°ĺ€ĺŻç”¨čľ„ćşćą ĺˆ™ĺˆŠç”¨ĺąžć€§ć–‡äťśćˆ–č€…é€ščż‡DNS进行配置。当一个Eureka实例开始启动时,它会查询配置,寻找可用的弹性IP地址。Eureka客户端也需要通过该弹性IPĺœ°ĺ€ćą čż›čĄŒé…ç˝Žă€‚\n\n## 相关模式\n\n- [客户端服务发现](client-side-discovery.html) 和 [服务器端服务发现](server-side-discovery.html) 催生了服务注册表这个模式。\n- [自注册](self-registration.html) 和 [第三方注册](3rd-party-registration.html) 是将服务实例注册至服务注册表的两种不同方式。\n\n## 致谢\n\nä¸şäş†éżĺ…é‡ĺ¤çżťčŻ‘ďźŒćœŹć–‡ć šćŽä¸­ĺ›˝ć™Žĺ…ƒĺ…Źĺ¸ĺŽ‹ć˝‡ć–‡ĺ…ˆç”Ÿçš„[译文](http://blog.csdn.net/xn_sung/article/details/52336759)整理修订,在此向宋潇文先生表示感谢!\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 8511, "slov": 340, "odkazu": 68, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/service-registry.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:25", "sha256": "5ec4a8de205905ec94f2cb79f583dcf193d3457570809ed5e59f7b554c67889a", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://github.com/Netflix/eureka/wiki/Eureka-at-a-glance", "http://zookeeper.apache.org/", "https://consul.io/", "https://github.com/coreos/etcd", "https://github.com/Netflix/eureka/wiki/Configuring-Eureka-in-AWS-Cloud", "http://blog.csdn.net/xn_sung/article/details/52336759", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/testing/service-component-test.html", "titulek": "Service Component Test", "h1": "Pattern: Service Component Test", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Service Component Test"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "See also"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Service Component Test\n\n## Problem\n\nHow to simplify the testing of a service\n\n## Solution\n\nA test suite that tests a service in isolation using test doubles for any services that it invokes.\n\n- See [Service Integration Contract Test](service-integration-contract-test.html)\n\n## See also\n\n- See [Component Testing](http://martinfowler.com/articles/microservice-testing/#testing-component-introduction)\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5451, "slov": 274, "odkazu": 60, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/testing/service-component-test.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:37", "sha256": "e26dddc5c6b0ea25fd4f27edc20067941ba372bfb5fe73355351f59aa4b74aad", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "http://martinfowler.com/articles/microservice-testing/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/testing/service-integration-contract-test.html", "titulek": "Service Integration Contract Test", "h1": "Pattern: Service Integration Contract Test", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Service Integration Contract Test"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "See also"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Service Integration Contract Test\n\n## Problem\n\nHow to verify that a service provides an API that its clients expect\n\n## Solution\n\nA test suite for a service that is written by the developers of another service that consumes it.\nThe test suite verifies that the service meets the consuming service’s expectations.\n\n- See [Service Component Test](service-component-test.html)\n\n## See also\n\n- See [Integration Contract Test](http://martinfowler.com/articles/microservice-testing/#testing-contract-introduction)\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5560, "slov": 291, "odkazu": 60, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/testing/service-integration-contract-test.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:38", "sha256": "4493d26a72758f4e357304fa181d9f88c8028970e1a53da7b4e1c20bf0dbd7a4", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "http://martinfowler.com/articles/microservice-testing/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/ui/client-side-ui-composition.html", "titulek": "Client-side UI composition", "h1": "Pattern: Client-side UI composition", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Client-side UI composition"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Client-side UI composition\n\n## Problem\n\nHow to implement a UI screen or page that displays data from multiple services?\n\n## Solution\n\nBuild a UI on the client by composing UI fragments rendered by multiple, [business capability](../decomposition/decompose-by-business-capability.html)/[subdomain](../decomposition/decompose-by-subdomain.html)-specific UI components.\n\n- The [Server-side page fragment composition](server-side-page-fragment-composition.html) pattern is an alternative approach\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5548, "slov": 284, "odkazu": 61, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/ui/client-side-ui-composition.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:46", "sha256": "b4ca955eb80ede378512ebe699ae940a0fca99a2b1a2029f1001e5507077c83c", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/cn/ui/server-side-page-fragment-composition.html", "titulek": "Server-side page fragment composition", "h1": "Pattern: Server-side page fragment composition", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 4, "text": "Chris Richardson 的微服务架构网站"}, {"uroven": 4, "text": "微服务架构咨询和培训服务"}, {"uroven": 4, "text": "ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç "}, {"uroven": 3, "text": "模式库"}, {"uroven": 1, "text": "Pattern: Server-side page fragment composition"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}], "markdown": "#### [Chris Richardson 的微服务架构网站](/index.html)\n\n**本站由[Kong](https://konghq.com/)提供支持**\n\n#### 微服务架构咨询和培训服务\n\n本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。\n\nChris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。\n\n[预约课程](http://www.chrisrichardson.net/contactus.html)\n\n#### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç \n\n为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。\n\n[čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html)\n\n---\n\n### 模式库\n\nć ¸ĺżƒć¨Ąĺź\n\n- [单体架构](/patterns/cn/monolithic.html)\n- [微服务架构](/patterns/cn/microservices.html)\n\n服务拆分\n\n- [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new\n- [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new\n\n部署模式\n\n- [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html)\n- [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html)\n- [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html)\n- [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html)\n- [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html)\n- [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new\n\n需要关注的边界问题\n\n- [微服务的基底](/patterns/cn/microservice-chassis.html)\n- [配置信息外部化](/patterns/cn/externalized-configuration.html) new\n\n通讯模式\n\n- [远程过程调用](/patterns/cn/communication-style/rpi.html)\n- [月息](/patterns/cn/communication-style/messaging.html)\n- [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new\n- [API 网关](/patterns/cn/apigateway.html)\n- [服务前端的后端](/patterns/cn/apigateway.html)\n- [客户端服务发现](/patterns/cn/client-side-discovery.html)\n- [服务器端服务发现](/patterns/cn/server-side-discovery.html)\n- [服务注册表](/patterns/cn/service-registry.html)\n- [自注册](/patterns/cn/self-registration.html)\n- [第三方注册](/patterns/cn/3rd-party-registration.html)\n- [断路器](/patterns/cn/reliability/circuit-breaker.html) new\n\n数据管理\n\n- [每服务数据库](/patterns/cn/data/database-per-service.html)\n- [共享数据库](/patterns/cn/data/shared-database.html)\n- [事件驱动架构](/patterns/cn/data/event-driven-architecture.html)\n- [事件溯源](/patterns/cn/data/event-sourcing.html)\n- [CQRS](/patterns/cn/data/cqrs.html)\n- [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html)\n- [数据库触发器](/patterns/cn/data/database-triggers.html)\n- [应用程序事件](/patterns/cn/data/transactional-outbox.html)\n\n安全模式\n\n- [访问令牌](/patterns/cn/security/access-token.html) new\n\n可测试性\n\n- [服务组件测试](/patterns/cn/testing/service-component-test.html) new\n- [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new\n\n可观测性\n\n- [应用日志](/patterns/cn/observability/application-logging.html) new\n- [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new\n- [审计日志](/patterns/cn/observability/audit-logging.html) new\n- [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new\n- [异常追踪](/patterns/cn/observability/exception-tracking.html) new\n- [健康检查](/patterns/cn/observability/health-check-api.html) new\n\nUI 模式\n\n- [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new\n- [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new\n\n---\n\n[订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n---\n\n全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。\n\n[了解更多](http://eventuate.io/)\n\nĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙)\n\n# Pattern: Server-side page fragment composition\n\n## Problem\n\nHow to implement a UI screen or page that displays data from multiple services?\n\n## Solution\n\nBuild a webpage on the server by composing HTML fragments generated by multiple, [business capability](../decomposition/decompose-by-business-capability.html)/[subdomain](../decomposition/decompose-by-subdomain.html)-specific web applications.\n\n- The [Client-side UI composition](client-side-ui-composition.html) pattern is an alternative approach\n\n---\n\nTweet\n\n[关注本站推特账号 @crichardson](https://twitter.com/crichardson)\n\nŠ 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.", "znaku_textu": 5548, "slov": 283, "odkazu": 61, "kodovani": "iso-8859-2", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/cn/ui/server-side-page-fragment-composition.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:45", "sha256": "010295240465ea0fd1e7021ca3360a7caf1e12ad40b0491c312122e2367ea279", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "http://eventuate.io/", "http://www.chrisrichardson.net/contactus.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/", "https://twitter.com/share", "https://twitter.com/crichardson"]} {"url": "https://microservices.io/patterns/communication-style/domain-specific.html", "titulek": "Pattern: Domain-specific protocol", "h1": "Pattern: Domain-specific protocol", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Domain-specific protocol", "og:url": "http://microservices.io/patterns/communication-style/domain-specific.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/communication-style/domain-specific.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Domain-specific protocol", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Domain-specific protocol"}, "url": "http://microservices.io/patterns/communication-style/domain-specific.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Domain-specific protocol"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Domain-specific protocol\n\n[pattern](/tags/pattern)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\nServices must handle requests from the application’s clients.\nFurthermore, services must sometimes collaborate to handle those requests.\nThey must use an inter-process communication protocol.\n\n## Forces\n\n## Solution\n\nUse a domain-specific protocol for inter-service communication.\n\n## Examples\n\nThere are numerous domain-specific protocols including:\n\n- Email protocols such as SMTP and IMAP\n- Media streaming protocols such as RTMP, HLS, and HDS\n\n## Resulting context\n\n- The [Messaging](messaging.html) pattern is an alternative pattern\n- The [RPI](rpi.html) pattern is an alternative pattern\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4020, "slov": 477, "odkazu": 30, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/communication-style/domain-specific.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:15", "sha256": "d62d63620a6ab0b971475fd79a8ca45ffe5dc51cc03414b27add583fefd63fdd", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/communication-style/idempotent-consumer.html", "titulek": "Pattern: Idempotent Consumer", "h1": "Pattern: Idempotent Consumer", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Idempotent Consumer", "og:url": "http://microservices.io/patterns/communication-style/idempotent-consumer.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/communication-style/idempotent-consumer.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Idempotent Consumer", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Idempotent Consumer"}, "url": "http://microservices.io/patterns/communication-style/idempotent-consumer.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Idempotent Consumer"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "See also"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Idempotent Consumer\n\n[pattern](/tags/pattern)\n\n---\n\n## Context\n\nIn an enterprise application, it’s usually a good idea to use a message broker that guarantees at-least once delivery.\nAt-least once delivery guarantees that a message broker will deliver a message to a consumer even if errors occur.\nOne side-effect, however, is that the consumer can be invoked repeatedly for the same message.\n**Consequently, a consumer must be idempotent: the outcome of processing the same message repeatedly must be the same as processing the message once.**\nIf a consumer is not idempotent, multiple invocations can cause bugs.\nFor example, a consumer of an `AccountDebited` message that subtracts the debit amount from the current balance would calculate the incorrect balance.\n\n## Problem\n\nHow does a message consumer handle duplicate messages correctly?\n\n## Solution\n\nMake a consumer idempotent by having it record the IDs of processed messages in the database.\nWhen processing a message, a consumer can detect and discard duplicates by querying the database.\nThere are a couple of different places to store the message IDs.\nOne option is for the consumer to use a separate `PROCESSED_MESSAGES` table.\nThe other option is for the consumer to store the IDs in the business entities that it creates or updates.\n\nHere’s how a consumer can use the `PROCESSED_MESSAGES` table:\n\nAfter starting the database transaction, the message handler inserts the message’s ID into the `PROCESSED_MESSAGE` table.\nSince the `(subscriberId, messageID)` is the `PROCESSED_MESSAGE` table’s primary key the `INSERT` will fail if the message has been already processed successfully.\nThe message handler can then rollback the transaction and ignore the message.\n\n## See also\n\n- The [Eventuate framework](https://eventuate.io) implements this pattern.\n- This [blog post about this pattern](/post/microservices/patterns/2020/10/16/idempotent-consumer.html)\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 5184, "slov": 665, "odkazu": 28, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/communication-style/idempotent-consumer.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:16", "sha256": "f02804c7fb160f91bf78168b412d9b019d857c87168934bbdb0fc7257cf0ce7a", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://eventuate.io/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/communication-style/messaging.html", "titulek": "Pattern: Messaging", "h1": "Pattern: Messaging", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Messaging", "og:url": "http://microservices.io/patterns/communication-style/messaging.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/communication-style/messaging.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Messaging", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Messaging"}, "url": "http://microservices.io/patterns/communication-style/messaging.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Messaging"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "See also"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Messaging\n\n[pattern](/tags/pattern) [inter-service communication](/tags/inter-service communication) [service api](/tags/service api) [service design](/tags/service design)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\nServices must handle requests from the application’s clients.\nFurthermore, services often collaborate to handle those requests.\nConsequently, they must use an inter-process communication protocol.\n\n## Forces\n\n- Services often need to collaborate\n- Synchronous communicate results in tight runtime coupling, both the client and service must be available for the duration of the request\n\n## Problem\n\nHow do services in a microservice architecture communicate?\n\n## Solution\n\nUse asynchronous messaging for inter-service communication.\nServices communicating by exchanging messages over messaging channels.\n\nThere are several different styles of asynchronous communication:\n\n- Request/response - a service sends a request message to a recipient and expects to receive a reply message promptly\n- Notifications - a sender sends a message a recipient but does not expect a reply. Nor is one sent.\n- Request/asynchronous response - a service sends a request message to a recipient and expects to receive a reply message eventually\n- Publish/subscribe - a service publishes a message to zero or more recipients\n- Publish/asynchronous response - a service publishes a request to one or recipients, some of whom send back a reply\n\n## Examples\n\nThere are numerous examples of asynchronous messaging technologies\n\n- [Apache Kafka](http://kafka.apache.org)\n- [RabbitMQ](https://www.rabbitmq.com/)\n\n`OrderService` from the [FTGO Example application](https://github.com/microservices-patterns/ftgo-application) publishes an `Order Created` event when it creates an `Order`.\n\n```\npublic class OrderService { ... public Order createOrder(long consumerId, long restaurantId, List lineItems) { Restaurant restaurant = restaurantRepository.findById(restaurantId) .orElseThrow(() -> new RestaurantNotFoundException(restaurantId)); List orderLineItems = makeOrderLineItems(lineItems, restaurant); ResultWithDomainEvents orderAndEvents = Order.createOrder(consumerId, restaurant, orderLineItems); Order order = orderAndEvents.result; orderRepository.save(order); orderAggregateEventPublisher.publish(order, orderAndEvents.events); OrderDetails orderDetails = new OrderDetails(consumerId, restaurantId, orderLineItems, order.getOrderTotal()); CreateOrderSagaState data = new CreateOrderSagaState(order.getId(), orderDetails); createOrderSagaManager.create(data, Order.class, order.getId()); meterRegistry.ifPresent(mr -> mr.counter(\"placed_orders\").increment()); return order; } \n```\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- Loose runtime coupling since it decouples the message sender from the consumer\n- Improved availability since the message broker buffers messages until the consumer is able to process them\n- Supports a variety of communication patterns including request/reply, notifications, request/async response, publish/subscribe, publish/async response etc\n\nThis pattern has the following drawbacks:\n\n- Additional complexity of message broker, which must be highly available\n\nThis pattern has the following issues:\n\n- Request/reply-style communication is more complex\n\n- The [Saga pattern](/patterns/data/saga.html) and [CQRS pattern](/patterns/data/cqrs.html) use messaging\n- The [Transactional Outbox pattern](/patterns/data/transactional-outbox.html) enables messages to be sent as part of a database transaction\n- The [Externalized configuration pattern](../externalized-configuration.html) supplies the (logical) message channel names and the location of the message broker\n- The [Domain-specific protocol](domain-specific.html) pattern is an alternative pattern\n- The [RPI](rpi.html) pattern is an alternative pattern\n\n## See also\n\n- My book [Microservices patterns](/book) describes inter-communication in depth\n- [Enterprise Integration Patterns](http://www.enterpriseintegrationpatterns.com/) - a comprehensive set of message patterns\n- The [Eventuate Tram framework](http://eventuate.io/) , which implements transaction messaging for microservices\n\n---\n\n[pattern](/tags/pattern) [inter-service communication](/tags/inter-service communication) [service api](/tags/service api) [service design](/tags/service design)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 7654, "slov": 852, "odkazu": 42, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/communication-style/messaging.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:15", "sha256": "56772e57da28676360d2ad7df4c84720e48a6f7d658d90475a6d0af0896f9f00", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "http://kafka.apache.org/", "https://www.rabbitmq.com/", "https://github.com/microservices-patterns/ftgo-application", "http://www.enterpriseintegrationpatterns.com/", "http://eventuate.io/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/communication-style/rpi.html", "titulek": "Pattern: Remote Procedure Invocation (RPI)", "h1": "Pattern: Remote Procedure Invocation (RPI)", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Remote Procedure Invocation (RPI)", "og:url": "http://microservices.io/patterns/communication-style/rpi.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/communication-style/rpi.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Remote Procedure Invocation (RPI)", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Remote Procedure Invocation (RPI)"}, "url": "http://microservices.io/patterns/communication-style/rpi.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Remote Procedure Invocation (RPI)"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Remote Procedure Invocation (RPI)\n\n[pattern](/tags/pattern) [inter-service communication](/tags/inter-service communication) [service api](/tags/service api) [service design](/tags/service design)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\nServices must handle requests from the application’s clients.\nFurthermore, services must sometimes collaborate to handle those requests.\nThey must use an inter-process communication protocol.\n\n## Forces\n\n- Services often need to collaborate\n- Synchronous communicate results in tight runtime coupling, both the client and service must be available for the duration of the request\n\n## Problem\n\nHow do services in a microservice architecture communicate?\n\n## Solution\n\nUse RPI for inter-service communication.\nThe client uses a request/reply-based protocol to make requests to a service.\n\n## Examples\n\nThere are numerous examples of RPI technologies\n\n- [REST](https://en.wikipedia.org/wiki/Representational_state_transfer)\n- [gRPC](http://www.grpc.io/)\n- [Apache Thrift](https://thrift.apache.org/)\n\n`RegistrationServiceProxy` from the [Microservices Example application](https://github.com/cer/microservices-examples) is an example of a component, which is written in Scala, that makes a REST request using the Spring Framework’s `RestTemplate`:\n\n```\n@Component class RegistrationServiceProxy @Autowired()(restTemplate: RestTemplate) extends RegistrationService { @Value(\"${user_registration_url}\") var userRegistrationUrl: String = _ @HystrixCommand(commandProperties=Array(new HystrixProperty(name=\"execution.isolation.thread.timeoutInMilliseconds\", value=\"800\"))) override def registerUser(emailAddress: String, password: String): Either[RegistrationError, String] = { try { val response = restTemplate.postForEntity(userRegistrationUrl, RegistrationBackendRequest(emailAddress, password), classOf[RegistrationBackendResponse]) response.getStatusCode match { case HttpStatus.OK => Right(response.getBody.id) } } catch { case e: HttpClientErrorException if e.getStatusCode == HttpStatus.CONFLICT => Left(DuplicateRegistrationError) } } } \n```\n\nThe value of `user_registration_url` is supplied using [Externalized configuration](../externalized-configuration.html).\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- Simple and familiar\n- Request/reply is easy\n- Simpler system since there in no intermediate broker\n\nThis pattern has the following drawbacks:\n\n- Usually only supports request/reply and not other interaction patterns such as notifications, request/async response, publish/subscribe, publish/async response\n- Reduced availability since the client and the service must be available for the duration of the interaction\n\nThis pattern has the following issues:\n\n- Client needs to discover locations of service instances\n\n- The [Domain-specific protocol](domain-specific.html) is an alternative pattern\n- The [Messaging](messaging.html) is an alternative pattern\n- [Externalized configuration](../externalized-configuration.html) supplies the (logical) network location, e.g. URL, of the service.\n- A client must use either [Client-side discovery](../client-side-discovery.html) and [Server-side discovery](../server-side-discovery.html) to locate a service instance\n- A client will typically use the [Circuit Breaker pattern](../reliability/circuit-breaker.html) to improve reliability\n\n---\n\n[pattern](/tags/pattern) [inter-service communication](/tags/inter-service communication) [service api](/tags/service api) [service design](/tags/service design)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 6786, "slov": 753, "odkazu": 41, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/communication-style/rpi.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:14", "sha256": "7c08e77572604e35b9ec171a437e24af1f45e11e896cca2a7198623f18ec902d", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://en.wikipedia.org/wiki/Representational_state_transfer", "http://www.grpc.io/", "https://thrift.apache.org/", "https://github.com/cer/microservices-examples", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/data/aggregate.html", "titulek": "Pattern: Aggregate", "h1": "Pattern: Aggregate", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Aggregate", "og:url": "http://microservices.io/patterns/data/aggregate.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/data/aggregate.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Aggregate", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Aggregate"}, "url": "http://microservices.io/patterns/data/aggregate.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Aggregate"}, {"uroven": 2, "text": "See also"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Aggregate\n\n[pattern](/tags/pattern)\n\n---\n\nFrom Domain-Driven Design (DDD).\n\nA graph of objects that can be treated as a unit.\n\n## See also\n\n- My book [Microservices patterns](/book) describes this pattern in a lot more detail.\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 3520, "slov": 421, "odkazu": 27, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/data/aggregate.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:47", "sha256": "6e6e62d4838c86e0b1b58c952bace84572f88ef004a685ffd6065cefb34138ab", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/data/api-composition.html", "titulek": "Pattern: API Composition", "h1": "Pattern: API Composition", "popis": "Invoke the services that own the data and perform an in-memory join", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: API Composition", "og:image": "http://microservices.io/i/data/ApiBasedQueryBigPicture.jpg", "og:url": "http://microservices.io/patterns/data/api-composition.html", "og:description": "Invoke the services that own the data and perform an in-memory join"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/data/api-composition.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: API Composition", "description": "A pattern language for microservices", "primaryImageOfPage": {"@type": "ImageObject", "contentUrl": "http://microservices.io/i/data/ApiBasedQueryBigPicture.jpg", "representativeOfPage": "True"}, "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: API Composition", "description": "Invoke the services that own the data and perform an in-memory join", "image": {"@type": "ImageObject", "name": "API Composition", "width": "735", "height": "428", "url": "http://microservices.io/i/data/ApiBasedQueryBigPicture.jpg"}}, "url": "http://microservices.io/patterns/data/api-composition.html"}, {"@context": "http://schema.org", "@type": "Question", "name": "How to implement queries that join data across multiple services in a microservice architecture?", "acceptedAnswer": {"@type": "Answer", "text": "Invoke the services that own the data and perform an in-memory join"}}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: API Composition"}, {"uroven": 2, "text": "Want to learn more about this pattern?"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Example"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "See also"}, {"uroven": 2, "text": "Learn more"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: API Composition\n\n[pattern](/tags/pattern) [service collaboration](/tags/service collaboration) [implementing queries](/tags/implementing queries)\n\n---\n\n## Want to learn more about this pattern?\n\nTake a look at my [self-paced, online bootcamp](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html) that teaches you how to use the Saga, API Composition, and CQRS patterns to design operations that span multiple services.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025)\n\n## Context\n\nYou have applied the [Microservices architecture pattern](../microservices.html) and the [Database per service pattern](database-per-service.html).\nAs a result, it is no longer straightforward to implement queries that join data from multiple services.\n\n## Problem\n\nHow to implement queries in a microservice architecture?\n\n## Solution\n\nImplement a query by defining an *API Composer*, which invoking the services that own the data and performs an in-memory join of the results.\n\n## Example\n\nAn [API Gateway](../apigateway.html) often does API composition.\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- It a simple way to query data in a microservice architecture\n\nThis pattern has the following drawbacks:\n\n- Some queries would result in inefficient, in-memory joins of large datasets.\n\n- The [Database per Service pattern](database-per-service.html) creates the need for this pattern\n- The [CQRS pattern](cqrs.html) is an alternative solution\n\n## See also\n\n## Learn more\n\n- My book [Microservices patterns](/book) describes this pattern in a lot more detail\n- Take a look at my [self-paced, online bootcamp](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html) that teaches you how to use the Saga, API Composition, and CQRS patterns to design operations that span multiple services.\n\n---\n\n[pattern](/tags/pattern) [service collaboration](/tags/service collaboration) [implementing queries](/tags/implementing queries)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 5259, "slov": 646, "odkazu": 33, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/data/api-composition.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:56", "sha256": "a034e8d1cc53e8e5ea635876db3c2065b159aba885ff465aeb82b60af84bb94a", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/data/command-side-replica.html", "titulek": "Pattern: Command-side replica", "h1": "Pattern: Command-side replica", "popis": "Maintain a queryable replica of the data in the service that implements the command.", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Command-side replica", "og:image": "http://microservices.io/i/data/command-side-replica.jpg", "og:url": "http://microservices.io/patterns/data/command-side-replica.html", "og:description": "Maintain a queryable replica of the data in the service that implements the command."}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/data/command-side-replica.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Command-side replica", "description": "A pattern language for microservices", "primaryImageOfPage": {"@type": "ImageObject", "contentUrl": "http://microservices.io/i/data/command-side-replica.jpg", "representativeOfPage": "True"}, "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Command-side replica", "description": "Maintain a queryable replica of the data in the service that implements the command.", "image": {"@type": "ImageObject", "name": "Command-side replica", "width": "735", "height": "428", "url": "http://microservices.io/i/data/command-side-replica.jpg"}}, "url": "http://microservices.io/patterns/data/command-side-replica.html"}, {"@context": "http://schema.org", "@type": "Question", "name": "How can a service that implements a command retrieve data from another service?", "acceptedAnswer": {"@type": "Answer", "text": "Maintain a queryable replica of the data in the service that implements the command."}}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Command-side replica"}, {"uroven": 2, "text": "Want to learn more about this pattern?"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 3, "text": "Benefits"}, {"uroven": 3, "text": "Drawbacks"}, {"uroven": 2, "text": "See also"}, {"uroven": 2, "text": "Learn more"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Command-side replica\n\n[pattern](/tags/pattern) [service collaboration](/tags/service collaboration) [implementing commands](/tags/implementing commands)\n\n---\n\n## Want to learn more about this pattern?\n\nTake a look at my [self-paced, online bootcamp](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html) that teaches you how to use the Saga, API Composition, and CQRS patterns to design operations that span multiple services.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025)\n\n## Context\n\nYou have applied the [Microservices architecture pattern](../microservices.html) and the [Database per service pattern](database-per-service.html).\nAs a result, a service that implements a system command often needs to query other services.\nFor example, the `createOrder()` command is implemented by the `Order Service`, which needs to retrieve the restaurant’s menu `Restaurant Service` in order to price and validate the line items.\n\nOne option is for the `Order Service` to query the `Restaurant Service` each time.\nThe query can either be implemented synchronously using, for example, or asynchronously as a saga step.\nHowever, this approach has several drawbacks, which can be partially mitigated by caching, including more network traffic and a runtime dependency on the `Restaurant Service`.\n\nAn alternative approach is to replica the restaurants’ menus to the `Order Service`.\n\n## Problem\n\nHow can a service that implements a command retrieve data from another service?\n\nThere are five [dark energy forces](/post/microservices/2021/11/30/dark-matter-dark-energy.html):\n\n- [Simple components](/articles/dark-energy-dark-matter/dark-energy/simple-components.html) - simple components consisting of few subdomains are easier to understand and maintain than complex components\n- [Team autonomy](/articles/dark-energy-dark-matter/dark-energy/team-autonomy.html) - a team needs to be able to develop, test and deploy their software independently of other teams\n- [Fast deployment pipeline](/articles/dark-energy-dark-matter/dark-energy/fast-deployment-pipeline.html) - fast feedback and high deployment frequency are essential and are enabled by a fast deployment pipeline, which in turn requires components that are fast to build and test.\n- [Support multiple technology stacks](/articles/dark-energy-dark-matter/dark-energy/multiple-technology-stacks.html) - subdomains are sometimes implemented using a variety of technologies; and developers need to evolve the application’s technology stack, e.g. use current versions of languages and frameworks\n- [Segregate by characteristics](/articles/dark-energy-dark-matter/dark-energy/segregate-by-characteristics.html) - e.g. resource requirements to improve scalability, their availability requirements to improve availability, their security requirements to improve security, etc.\n\nThere are five [dark matter forces](/post/microservices/2021/11/30/dark-matter-dark-energy.html):\n\n- [Simple interactions](/articles/dark-energy-dark-matter/dark-matter/simple-interactions.html) - an operation that’s local to a component or consists of a few simple interactions between components is easier to understand and troubleshoot than a distributed operation, especially one consisting of complex interactions\n- [Efficient interactions](/articles/dark-energy-dark-matter/dark-matter/efficient-interactions.html) - a distributed operation that involves lots of network round trips and large data transfers can be too inefficient\n- [Prefer ACID over BASE](/articles/dark-energy-dark-matter/dark-matter/prefer-acid-over-base.html) - it’s easier to implement an operation as an ACID transaction rather than, for example, eventually consistent sagas\n- [Minimize runtime coupling](/articles/dark-energy-dark-matter/dark-matter/minimize-runtime-coupling.html) - to maximize the availability and reduce the latency of an operation\n- [Minimize design time coupling](/articles/dark-energy-dark-matter/dark-matter/minimize-design-time-coupling.html) - reduce the likelihood of changing services in lockstep, which reduces productivity\n\n## Solution\n\nThe solution consists of the following elements:\n\n- Command service - the service that implements the command.\n- Provider service - the service that owns the data that the command service needs\n- Replica database - a read-only replica of the data from the provider service.\nThe command service keeps the replica up to data by subscribing to [Domain events](domain-event.html) published by the provider service\n\n## Resulting context\n\n### Benefits\n\nThis pattern resolves the following forces:\n\n- Support multiple technology stacks - the replica database can use a technology stack that’s more optimized to support the command\n- Segregate by characteristics - the provider service is no longer invoked by the command and so might need to be as performant or available\n- Simple interactions - the command is simpler since it no longer needs to interact with the provider service\n- Efficient interactions - the command is more efficient since it no longer needs to interact with the provider service\n- Prefer ACID over BASE - the replica is potentially stale\n- Minimize runtime coupling - runtime coupling is reduced since the the command no longer needs to interact with the provider service\n\n### Drawbacks\n\nThis pattern potentially fails to resolve the following forces:\n\n- Simple components - makes the command service more complicated since it needs to maintain the replica. It also complicates the provider service since it must publish the events.\n- Team autonomy - the provider service’s team might need to coordinate more frequently with command service team due to increased design-time coupling (see below)\n- Fast deployment pipeline - the command service’s deployment pipeline might be slower since it needs test the replica\n- Segregate by characteristics - potentially increased since, for example, if the replica database contains regulated data (e.g. PII) then the command service might be more complicated.\n- Simple interactions - potentially more complicated since the provider service’s commands must publish events\n- Efficient interactions - potentially less efficient since the provider service might publish a large volume of events\n- Minimize design-time coupling - risk of tight design-time coupling between services, since the command service needs to know about the structure of the data that is replicated and potentially its lifecycle events.\n\n- The [Database per Service pattern](database-per-service.html) creates the need for this pattern\n- The [Saga](saga.html) is an alternative solution\n- The [Domain event](domain-event.html) pattern generates the events\n- This pattern is structurally identical to [CQRS](cqrs.html) .\n\n## See also\n\n- [Eventuate](http://eventuate.io) , which is a platform for developing transactional business applications.\n\n## Learn more\n\n- My book [Microservices patterns](/book) describes this pattern in a lot more detail\n- Take a look at my [self-paced, online bootcamp](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html) that teaches you how to use the Saga, API Composition, and CQRS patterns to design operations that span multiple services.\n\n---\n\n[pattern](/tags/pattern) [service collaboration](/tags/service collaboration) [implementing commands](/tags/implementing commands)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 10537, "slov": 1346, "odkazu": 46, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/data/command-side-replica.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:55", "sha256": "8f9790de60a9f138ebaf30471d762e20a3d3973117d16ba81838251cba3ebd2d", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://eventuate.io/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/data/cqrs.html", "titulek": "Pattern: Command Query Responsibility Segregation (CQRS)", "h1": "Pattern: Command Query Responsibility Segregation (CQRS)", "popis": "Define a queryable replica that is kept up to date by subscribing to events published by the services that own the data.", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Command Query Responsibility Segregation (CQRS)", "og:image": "http://microservices.io/i/data/cqrs.jpg", "og:url": "http://microservices.io/patterns/data/cqrs.html", "og:description": "Define a queryable replica that is kept up to date by subscribing to events published by the services that own the data."}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/data/cqrs.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Command Query Responsibility Segregation (CQRS)", "description": "A pattern language for microservices", "primaryImageOfPage": {"@type": "ImageObject", "contentUrl": "http://microservices.io/i/data/cqrs.jpg", "representativeOfPage": "True"}, "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Command Query Responsibility Segregation (CQRS)", "description": "Define a queryable replica that is kept up to date by subscribing to events published by the services that own the data.", "image": {"@type": "ImageObject", "name": "Command Query Responsibility Segregation (CQRS)", "width": "735", "height": "428", "url": "http://microservices.io/i/data/cqrs.jpg"}}, "url": "http://microservices.io/patterns/data/cqrs.html"}, {"@context": "http://schema.org", "@type": "Question", "name": "How to implement queries that join data across multiple services in a microservice architecture?", "acceptedAnswer": {"@type": "Answer", "text": "Define a queryable replica that is kept up to date by subscribing to events published by the services that own the data."}}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Command Query Responsibility Segregation (CQRS)"}, {"uroven": 2, "text": "Want to learn more about this pattern?"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "See also"}, {"uroven": 2, "text": "Learn more"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Command Query Responsibility Segregation (CQRS)\n\n[pattern](/tags/pattern) [service collaboration](/tags/service collaboration) [implementing queries](/tags/implementing queries)\n\n---\n\n## Want to learn more about this pattern?\n\nTake a look at my [self-paced, online bootcamp](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html) that teaches you how to use the Saga, API Composition, and CQRS patterns to design operations that span multiple services.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025)\n\n## Context\n\nYou have applied the [Microservices architecture pattern](../microservices.html) and the [Database per service pattern](database-per-service.html).\nAs a result, it is no longer straightforward to implement queries that join data from multiple services.\nAlso, if you have applied the [Event sourcing pattern](event-sourcing.html) then the data is no longer easily queried.\n\n## Problem\n\nHow to implement a query that retrieves data from multiple services in a microservice architecture?\n\n## Solution\n\nDefine a view database, which is a read-only ‘replica’ that is designed specifically to support that query, or a group related queries.\nThe application keeps the database up to date by subscribing to [Domain events](domain-event.html) published by the service that own the data.\nThe type of database and its schema are optimized for the query or queries.\nIt’s often a NoSQL database, such as a document database or a key-value store.\n\n## Examples\n\n- My book’s FTGO example application has the [`Order History Service`](https://github.com/microservices-patterns/ftgo-application#chapter-7-implementing-queries-in-a-microservice-architecture), which implements this pattern.\n- There are [several Eventuate-based example applications](http://eventuate.io/exampleapps.html) that illustrate how to use this pattern.\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- Supports multiple denormalized views that are scalable and performant\n- Improved separation of concerns = simpler command and query models\n- Necessary in an event sourced architecture\n\nThis pattern has the following drawbacks:\n\n- Increased complexity\n- Potential code duplication\n- Replication lag/eventually consistent views\n\n- The [Database per Service pattern](database-per-service.html) creates the need for this pattern\n- The [API Composition pattern](api-composition.html) is an alternative solution\n- The [Domain event](domain-event.html) pattern generates the events\n- CQRS is often used with [Event sourcing](event-sourcing.html)\n\n## See also\n\n- [Eventuate](http://eventuate.io) , which is a platform for developing transactional business applications.\n\n## Learn more\n\n- My book [Microservices patterns](/book) describes this pattern in a lot more detail\n- Take a look at my [self-paced, online bootcamp](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html) that teaches you how to use the Saga, API Composition, and CQRS patterns to design operations that span multiple services.\n\n---\n\n[pattern](/tags/pattern) [service collaboration](/tags/service collaboration) [implementing queries](/tags/implementing queries)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 6442, "slov": 795, "odkazu": 36, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/data/cqrs.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:57", "sha256": "4d0a288566879405ca9c27abeef8c31a0736d90df8d4eb8db5a038c933f4e117", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "https://github.com/microservices-patterns/ftgo-application", "http://eventuate.io/exampleapps.html", "http://eventuate.io/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/data/database-per-service.html", "titulek": "Pattern: Database per service", "h1": "Pattern: Database per service", "popis": "A service's database is private to that service", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Database per service", "og:image": "http://microservices.io/i/databaseperservice.png", "og:url": "http://microservices.io/patterns/data/database-per-service.html", "og:description": "A service's database is private to that service"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/data/database-per-service.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Database per service", "description": "A pattern language for microservices", "primaryImageOfPage": {"@type": "ImageObject", "contentUrl": "http://microservices.io/i/databaseperservice.png", "representativeOfPage": "True"}, "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Database per service", "description": "A service's database is private to that service", "image": {"@type": "ImageObject", "name": "Database per service", "width": "735", "height": "428", "url": "http://microservices.io/i/databaseperservice.png"}}, "url": "http://microservices.io/patterns/data/database-per-service.html"}, {"@context": "http://schema.org", "@type": "Question", "name": "What’s the database architecture in a microservices application?", "acceptedAnswer": {"@type": "Answer", "text": "A service's database is private to that service"}}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Database per service"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Example"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Database per service\n\n[pattern](/tags/pattern) [application architecture](/tags/application architecture) [loose coupling](/tags/loose coupling)\n\n---\n\n## Context\n\nLet’s imagine you are developing an online store application using the [Microservice architecture pattern](/patterns/microservices.html).\nMost services need to persist data in some kind of database.\nFor example, the `Order Service` stores information about orders and the `Customer Service` stores information about customers.\n\n## Problem\n\nWhat’s the database architecture in a microservices application?\n\n## Forces\n\n- Services must be loosely coupled so that they can be developed, deployed and scaled independently\n- Some business transactions must enforce invariants that span multiple services.\nFor example, the `Place Order` use case must verify that a new Order will not exceed the customer’s credit limit.\nOther business transactions, must update data owned by multiple services.\n- Some business transactions need to query data that is owned by multiple services.\nFor example, the `View Available Credit` use must query the Customer to find the `creditLimit` and Orders to calculate the total amount of the open orders.\n- Some queries must join data that is owned by multiple services.\nFor example, finding customers in a particular region and their recent orders requires a join between customers and orders.\n- Databases must sometimes be replicated and sharded in order to scale. See the [Scale Cube](/articles/scalecube.html).\n- Different services have different data storage requirements.\nFor some services, a relational database is the best choice.\nOther services might need a NoSQL database such as MongoDB, which is good at storing complex, unstructured data, or Neo4J, which is designed to efficiently store and query graph data.\n\n## Solution\n\nKeep each microservice’s persistent data private to that service and accessible only via its API.\nA service’s transactions only involve its database.\n\nThe following diagram shows the structure of this pattern.\n\nThe service’s database is effectively part of the implementation of that service.\nIt cannot be accessed directly by other services.\n\nThere are a few different ways to keep a service’s persistent data private.\nYou do not need to provision a database server for each service.\nFor example, if you are using a relational database then the options are:\n\n- Private-tables-per-service – each service owns a set of tables that must only be accessed by that service\n- Schema-per-service – each service has a database schema that’s private to that service\n- Database-server-per-service – each service has it’s own database server.\n\nPrivate-tables-per-service and schema-per-service have the lowest overhead.\nUsing a schema per service is appealing since it makes ownership clearer.\nSome high throughput services might need their own database server.\n\nIt is a good idea to create barriers that enforce this modularity.\nYou could, for example, assign a different database user id to each service and use a database access control mechanism such as grants.\nWithout some kind of barrier to enforce encapsulation, developers will always be tempted to bypass a service’s API and access it’s data directly.\n\n## Example\n\nThe [FTGO application](/post/microservices/patterns/data/2019/07/15/ftgo-database-per-service.html) is an example of an application that uses this approach.\nEach service has database credentials that only grant it access its own (logical) database on a shared MySQL server.\nFor more information, see this [blog post](/post/microservices/patterns/data/2019/07/15/ftgo-database-per-service.html).\n\n## Resulting context\n\nUsing a database per service has the following benefits:\n\n- Helps ensure that the services are loosely coupled.\nChanges to one service’s database does not impact any other services.\n- Each service can use the type of database that is best suited to its needs.\nFor example, a service that does text searches could use ElasticSearch.\nA service that manipulates a social graph could use Neo4j.\n\nUsing a database per service has the following drawbacks:\n\n- Implementing business transactions that span multiple services is not straightforward.\nDistributed transactions are best avoided because of the CAP theorem.\nMoreover, many modern (NoSQL) databases don’t support them.\n- Implementing queries that join data that is now in multiple databases is challenging.\n- Complexity of managing multiple SQL and NoSQL databases\n\nThere are various patterns/solutions for implementing transactions and queries that span services:\n\n- Implementing transactions that span services - use the [Saga pattern](saga.html).\n- Implementing queries that span services:\n - [API Composition](api-composition.html) - the application performs the join rather than the database.\n For example, a service (or the API gateway) could retrieve a customer and their orders by first retrieving the customer from the customer service and then querying the order service to return the customer’s most recent orders.\n - [Command Query Responsibility Segregation (CQRS)](cqrs.html) - maintain one or more materialized views that contain data from multiple services.\n The views are kept by services that subscribe to events that each services publishes when it updates its data.\n For example, the online store could implement a query that finds customers in a particular region and their recent orders by maintaining a view that joins customers and orders.\n The view is updated by a service that subscribes to customer and order events.\n\n- [Microservice architecture pattern](/patterns/microservices.html) creates the need for this pattern\n- [Saga pattern](/patterns/data/saga.html) is a useful way to implement eventually consistent transactions\n- The [API Composition](api-composition.html) and [Command Query Responsibility Segregation (CQRS)](cqrs.html) pattern are useful ways to implement queries\n- The [Shared Database anti-pattern](shared-database.html) describes the problems that result from microservices sharing a database\n\n---\n\n[pattern](/tags/pattern) [application architecture](/tags/application architecture) [loose coupling](/tags/loose coupling)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 9369, "slov": 1250, "odkazu": 37, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/data/database-per-service.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:52", "sha256": "4dbca44ffab823749d6f06484e10ddfba1790a5470655c55cae7383de2196ae0", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/data/domain-event.html", "titulek": "Pattern: Domain event", "h1": "Pattern: Domain event", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Domain event", "og:url": "http://microservices.io/patterns/data/domain-event.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/data/domain-event.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Domain event", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Domain event"}, "url": "http://microservices.io/patterns/data/domain-event.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Domain event"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "See also"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Domain event\n\n[pattern](/tags/pattern)\n\n---\n\nFrom Domain-Driven Design (DDD).\n\n## Context\n\nA service often needs to publish events when it updates its data.\nThese events might be needed, for example, to update a [CQRS view](cqrs.html).\nAlternatively, the service might participate in an choreography-based [saga](saga.html), which uses events for coordination.\n\n## Problem\n\nHow does a service publish an event when it updates its data?\n\n## Solution\n\nOrganize the business logic of a service as a collection of DDD [aggregates](aggregate.html) that emit domain events when they created or updated.\nThe service publishes these domain events so that they can be consumed by other services.\n\n- The [Saga](saga.html) and [CQRS](cqrs.html) patterns create the need for this pattern\n- The [Aggregate pattern](aggregate.html) is used to structure the business logic\n- The [Transactional outbox pattern](transactional-outbox.html) is used to publish events as part of a database transaction\n- [Event sourcing](event-sourcing.html) is sometimes used to publish domain events\n\n## See also\n\n- My book [Microservices patterns](/book) describes this pattern in a lot more detail.\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4443, "slov": 549, "odkazu": 32, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/data/domain-event.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:58", "sha256": "5d1ab47b053255188b26c6e96b0e758ca26a1ecb9e53982f5a8461ae1fc2bfaf", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/data/event-sourcing.html", "titulek": "Pattern: Event sourcing", "h1": "Pattern: Event sourcing", "popis": "Use event sourcing, which persists aggregates as a sequence of domain events", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Event sourcing", "og:image": "http://microservices.io/i/data/storingevents.png", "og:url": "http://microservices.io/patterns/data/event-sourcing.html", "og:description": "Use event sourcing, which persists aggregates as a sequence of domain events"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/data/event-sourcing.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Event sourcing", "description": "A pattern language for microservices", "primaryImageOfPage": {"@type": "ImageObject", "contentUrl": "http://microservices.io/i/data/storingevents.png", "representativeOfPage": "True"}, "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Event sourcing", "description": "Use event sourcing, which persists aggregates as a sequence of domain events", "image": {"@type": "ImageObject", "name": "Event sourcing", "width": "735", "height": "428", "url": "http://microservices.io/i/data/storingevents.png"}}, "url": "http://microservices.io/patterns/data/event-sourcing.html"}, {"@context": "http://schema.org", "@type": "Question", "name": "How to reliably publish events when data changes?", "acceptedAnswer": {"@type": "Answer", "text": "Use event sourcing, which persists aggregates as a sequence of domain events"}}], "drobecky": [], "osnova": [{"uroven": 1, "text": "Pattern: Event sourcing"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Example"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "See also"}], "markdown": "# Pattern: Event sourcing\n\n[pattern](/tags/pattern)\n\n---\n\n## Context\n\nA service command typically needs to create/update/delete [aggregates](aggregate.html) in the database **and** send messages/events to a message broker.\nFor example, a service that participates in a [saga](/patterns/data/saga.html) needs to update business entities and send messages/events.\nSimilarly, a service that publishes a [domain event](domain-event.html) must update an [aggregate](aggregate.html) and publish an event.\n\nThe command must atomically update the database and send messages in order to avoid data inconsistencies and bugs.\nHowever, it is not viable to use a traditional distributed transaction (2PC) that spans the database and the message broker\nThe database and/or the message broker might not support 2PC.\nAnd even if they do, it’s often undesirable to couple the service to both the database and the message broker.\n\nBut without using 2PC, sending a message in the middle of a transaction is not reliable.\nThere’s no guarantee that the transaction will commit.\nSimilarly, if a service sends a message after committing the transaction there’s no guarantee that it won’t crash before sending the message.\n\nIn addition, messages must be sent to the message broker in the order they were sent by the service.\nThey must usually be delivered to each consumer in the same order although that’s outside the scope of this pattern.\nFor example, let’s suppose that an aggregate is updated by a series of transactions `T1`, `T2`, etc.\nThis transactions might be performed by the same service instance or by different service instances.\nEach transaction publishes a corresponding event: `T1 -> E1`, `T2 -> E2`, etc.\nSince `T1` precedes `T2`, event `E1` must be published before `E2`.\n\n## Problem\n\nHow to atomically update the database and send messages to a message broker?\n\n## Forces\n\n- 2PC is not an option. The database and/or the message broker might not support 2PC. Also, it’s often undesirable to couple the service to both the database and the message broker.\n- If the database transaction commits then the messages must be sent. Conversely, if the database rolls back, the messages must not be sent\n- Messages must be sent to the message broker in the order they were sent by the service. This ordering must be preserved across multiple service instances that update the same aggregate.\n\n## Solution\n\nA good solution to this problem is to use event sourcing.\nEvent sourcing persists the state of a business entity such an Order or a Customer as a sequence of state-changing events.\nWhenever the state of a business entity changes, a new event is appended to the list of events.\nSince saving an event is a single operation, it is inherently atomic.\nThe application reconstructs an entity’s current state by replaying the events.\n\nApplications persist events in an event store, which is a database of events.\nThe store has an API for adding and retrieving an entity’s events.\nThe event store also behaves like a message broker.\nIt provides an API that enables services to subscribe to events.\nWhen a service saves an event in the event store, it is delivered to all interested subscribers.\n\nSome entities, such as a Customer, can have a large number of events.\nIn order to optimize loading, an application can periodically save a snapshot of an entity’s current state.\nTo reconstruct the current state, the application finds the most recent snapshot and the events that have occurred since that snapshot.\nAs a result, there are fewer events to replay.\n\n## Example\n\n[Customers and Orders](https://github.com/eventuate-examples/eventuate-examples-java-customers-and-orders) is an example of an application that is built using Event Sourcing and [CQRS](cqrs.html).\nThe application is written in Java, and uses Spring Boot.\nIt is built using [Eventuate](http://eventuate.io), which is an application platform based on event sourcing and CQRS.\n\nThe following diagram shows how it persist orders.\n\nInstead of simply storing the current state of each order as a row in an `ORDERS` table, the application persists each `Order` as a sequence of events.\nThe `CustomerService` can subscribe to the order events and update its own state.\n\nHere is the `Order` aggregate:\n\n```\npublic class Order extends ReflectiveMutableCommandProcessingAggregate { private OrderState state; private String customerId; public OrderState getState() { return state; } public List process(CreateOrderCommand cmd) { return EventUtil.events(new OrderCreatedEvent(cmd.getCustomerId(), cmd.getOrderTotal())); } public List process(ApproveOrderCommand cmd) { return EventUtil.events(new OrderApprovedEvent(customerId)); } public List process(RejectOrderCommand cmd) { return EventUtil.events(new OrderRejectedEvent(customerId)); } public void apply(OrderCreatedEvent event) { this.state = OrderState.CREATED; this.customerId = event.getCustomerId(); } public void apply(OrderApprovedEvent event) { this.state = OrderState.APPROVED; } public void apply(OrderRejectedEvent event) { this.state = OrderState.REJECTED; } \n```\n\nHere is an example of an event handler in the `CustomerService` that subscribes to `Order` events:\n\n```\n@EventSubscriber(id = \"customerWorkflow\") public class CustomerWorkflow { @EventHandlerMethod public CompletableFuture> reserveCredit( EventHandlerContext ctx) { OrderCreatedEvent event = ctx.getEvent(); Money orderTotal = event.getOrderTotal(); String customerId = event.getCustomerId(); String orderId = ctx.getEntityId(); return ctx.update(Customer.class, customerId, new ReserveCreditCommand(orderTotal, orderId)); } } \n```\n\nIt processes an `OrderCreated` event by attempting to reserve credit for the orders customer.\n\nThere are [several example applications](http://eventuate.io/exampleapps.html) that illustrate how to use event sourcing.\n\n## Resulting context\n\nEvent sourcing has several benefits:\n\n- It solves one of the key problems in implementing an event-driven architecture and makes it possible to reliably publish events whenever state changes.\n- Because it persists events rather than domain objects, it mostly avoids the object‑relational impedance mismatch problem.\n- It provides a 100% reliable [audit log](../observability/audit-logging) of the changes made to a business entity\n- It makes it possible to implement temporal queries that determine the state of an entity at any point in time.\n- Event sourcing-based business logic consists of loosely coupled business entities that exchange events. This makes it a lot easier to migrate from a monolithic application to a microservice architecture.\n\nEvent sourcing also has several drawbacks:\n\n- It is a different and unfamiliar style of programming and so there is a learning curve.\n- The event store is difficult to query since it requires typical queries to reconstruct the state of the business entities. That is likely to be complex and inefficient.\nAs a result, the application must use [Command Query Responsibility Segregation (CQRS)](cqrs.html) to implement queries.\nThis in turn means that applications must handle eventually consistent data.\n\n- The [Saga](saga.html) and [Domain event](domain-event.html) patterns create the need for this pattern.\n- The [CQRS](cqrs.html) must often be used with event sourcing.\n- Event sourcing implements the [Audit logging](../observability/audit-logging) pattern.\n\n## See also\n\n- [Eventuate](http://eventuate.io) , which is a platform for developing applications with Event Sourcing and CQRS\n- [Articles about event sourcing and CQRS](http://eventuate.io/articles.html)\n- [How Eventuate implements snapshots](https://blog.eventuate.io/2017/03/07/eventuate-local-now-supports-snapshots/)", "znaku_textu": 7660, "slov": 1077, "odkazu": 37, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/data/event-sourcing.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:59", "sha256": "f8928b7478fd7107c7fc9eac223780632f7232e5271797247bf8e0c4bd4a73ad", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://github.com/eventuate-examples/eventuate-examples-java-customers-and-orders", "http://eventuate.io/", "http://eventuate.io/exampleapps.html", "http://eventuate.io/articles.html", "https://blog.eventuate.io/2017/03/07/eventuate-local-now-supports-snapshots/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/data/polling-publisher.html", "titulek": "Pattern: Polling publisher", "h1": "Pattern: Polling publisher", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Polling publisher", "og:url": "http://microservices.io/patterns/data/polling-publisher.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/data/polling-publisher.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Polling publisher", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Polling publisher"}, "url": "http://microservices.io/patterns/data/polling-publisher.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Polling publisher"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "Learn more"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Polling publisher\n\n[pattern](/tags/pattern) [transactional messaging](/tags/transactional messaging) [inter-service communication](/tags/inter-service communication)\n\n---\n\n## Context\n\nYou have applied the [Transactional Outbox](transactional-outbox.html) pattern.\n\n## Problem\n\nHow to publish messages/events into the *outbox* in the database to the message broker?\n\n## Forces\n\n## Solution\n\nPublish messages by polling the database’s outbox table.\n\n## Examples\n\n- [Eventuate Tram framework](https://github.com/eventuate-tram/eventuate-tram-core) implements polling.\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- Works with any SQL database\n\nThis pattern has the following drawbacks:\n\n- Tricky to publish events in order\n- Not all NoSQL databases support this pattern\n\n- The [Transactional Outbox](transactional-outbox.html) pattern creates the need for this pattern.\n- The [Transaction log tailing](transaction-log-tailing.html) pattern is an alternative solution\n\n## Learn more\n\n- My book [Microservices patterns](/book) describes this pattern in a lot more detail.\n- The [Eventuate Tram framework](https://github.com/eventuate-tram/eventuate-tram-core) implements this pattern\n\n---\n\n[pattern](/tags/pattern) [transactional messaging](/tags/transactional messaging) [inter-service communication](/tags/inter-service communication)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4580, "slov": 529, "odkazu": 32, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/data/polling-publisher.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:02", "sha256": "f675fb926272f419b676185d9bec6b25259ddbc92dc3de36d4168f408ebf159d", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://github.com/eventuate-tram/eventuate-tram-core", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/data/saga.html", "titulek": "Pattern: Saga", "h1": "Pattern: Saga", "popis": "Implement transactions using a saga, which is sequence of local transactions", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Saga", "og:image": "http://microservices.io/i/data/saga.jpg", "og:url": "http://microservices.io/patterns/data/saga.html", "og:description": "Implement transactions using a saga, which is sequence of local transactions"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/data/saga.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Saga", "description": "A pattern language for microservices", "primaryImageOfPage": {"@type": "ImageObject", "contentUrl": "http://microservices.io/i/data/saga.jpg", "representativeOfPage": "True"}, "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Saga", "description": "Implement transactions using a saga, which is sequence of local transactions", "image": {"@type": "ImageObject", "name": "Saga", "width": "735", "height": "428", "url": "http://microservices.io/i/data/saga.jpg"}}, "url": "http://microservices.io/patterns/data/saga.html"}, {"@context": "http://schema.org", "@type": "Question", "name": "How to implement transactions that span services in a microservice architecture?", "acceptedAnswer": {"@type": "Answer", "text": "Implement transactions using a saga, which is sequence of local transactions"}}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Saga"}, {"uroven": 2, "text": "Want to learn more about this pattern?"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Example: Choreography-based saga"}, {"uroven": 2, "text": "Example: Orchestration-based saga"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "Learn more"}, {"uroven": 2, "text": "Example code"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Saga\n\n[pattern](/tags/pattern) [transaction management](/tags/transaction management) [sagas](/tags/sagas) [service collaboration](/tags/service collaboration) [implementing commands](/tags/implementing commands)\n\n---\n\n## Want to learn more about this pattern?\n\nTake a look at my [self-paced, online bootcamp](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html) that teaches you how to use the Saga, API Composition, and CQRS patterns to design operations that span multiple services.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025)\n\n## Context\n\nYou have applied the [Database per Service](database-per-service.html) pattern.\nEach service has its own database.\nSome business transactions, however, span multiple service so you need a mechanism to implement transactions that span services.\nFor example, let’s imagine that you are building an e-commerce store where customers have a credit limit.\nThe application must ensure that a new order will not exceed the customer’s credit limit.\nSince Orders and Customers are in different databases owned by different services the application cannot simply use a local ACID transaction.\n\n## Problem\n\nHow to implement transactions that span services?\n\n## Forces\n\n- 2PC is not an option\n\n## Solution\n\nImplement each business transaction that spans multiple services as a saga.\nA saga is a sequence of local transactions.\nEach local transaction updates the database and publishes a message or event to trigger the next local transaction in the saga.\nIf a local transaction fails because it violates a business rule then the saga executes a series of compensating transactions that undo the changes that were made by the preceding local transactions.\n\nThere are two ways of coordination sagas:\n\n- Choreography - each local transaction publishes domain events that trigger local transactions in other services\n- Orchestration - an orchestrator (object) tells the participants what local transactions to execute\n\n## Example: Choreography-based saga\n\nAn e-commerce application that uses this approach would create an order using a choreography-based saga that consists of the following steps:\n\n1. The `Order Service` receives the `POST /orders` request and creates an `Order` in a `PENDING` state\n2. It then emits an `Order Created` event\n3. The `Customer Service` ’s event handler attempts to reserve credit\n4. It then emits an event indicating the outcome\n5. The `OrderService` ’s event handler either approves or rejects the `Order`\n\n[Take a tour of an example saga](/post/architecture/2024/03/20/tour-of-two-sagas.html)\n\n## Example: Orchestration-based saga\n\nAn e-commerce application that uses this approach would create an order using an orchestration-based saga that consists of the following steps:\n\n1. The `Order Service` receives the `POST /orders` request and creates the `Create Order` saga orchestrator\n2. The saga orchestrator creates an `Order` in the `PENDING` state\n3. It then sends a `Reserve Credit` command to the `Customer Service`\n4. The `Customer Service` attempts to reserve credit\n5. It then sends back a reply message indicating the outcome\n6. The saga orchestrator either approves or rejects the `Order`\n\n[Take a tour of an example saga](/post/architecture/2024/03/20/tour-of-two-sagas.html)\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- It enables an application to maintain data consistency across multiple services without using distributed transactions\n\nThis solution has the following drawbacks:\n\n- Lack of automatic rollback - a developer must design compensating transactions that explicitly undo changes made earlier in a saga rather than relying on the automatic rollback feature of ACID transactions\n- Lack of isolation (the “I” in ACID) - the lack of isolation means that there’s risk that the concurrent execution of multiple sagas and transactions can use data anomalies. consequently, a saga developer must typical use countermeasures, which are design techniques that implement isolation. Moreover, careful analysis is needed to select and correctly implement the countermeasures. See [Chapter 4/section 4.3 of my book Microservices Patterns](https://livebook.manning.com/book/microservices-patterns/chapter-4/143) for more information.\n\nThere are also the following issues to address:\n\n- In order to be reliable, a service must atomically update its database *and* publish a message/event.\nIt cannot use the traditional mechanism of a distributed transaction that spans the database and the message broker.\nInstead, it must use one of the patterns listed below.\n- A client that initiates the saga, which an asynchronous flow, using a synchronous request (e.g. HTTP `POST /orders`) needs to be able to determine its outcome.\nThere are several options, each with different trade-offs:\n - The service sends back a response once the saga completes, e.g. once it receives an `OrderApproved` or `OrderRejected` event.\n - The service sends back a response (e.g. containing the `orderID` ) after initiating the saga and the client periodically polls (e.g. `GET /orders/{orderID}` ) to determine the outcome\n - The service sends back a response (e.g. containing the `orderID` ) after initiating the saga, and then sends an event (e.g. websocket, web hook, etc) to the client once the saga completes.\n\n- The [Database per Service pattern](database-per-service.html) creates the need for this pattern\n- The following patterns are ways to *atomically* update state *and* publish messages/events:\n - [Event sourcing](event-sourcing.html)\n - [Transactional Outbox](transactional-outbox.html)\n- A choreography-based saga can publish events using [Aggregates](aggregate.html) and [Domain Events](domain-event.html)\n- The [Command-side replica](command-side-replica.html) is an alternative pattern, which can replace saga step that query data\n\n## Learn more\n\n- My book [Microservices patterns](/book) describes this pattern in a lot more detail. The book’s [example application](https://github.com/microservice-patterns/ftgo-application) implements orchestration-based sagas using the [Eventuate Tram Sagas framework](https://github.com/eventuate-tram/eventuate-tram-sagas)\n- Take a look at my [self-paced, online bootcamp](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html) that teaches you how to use the Saga, API Composition, and CQRS patterns to design operations that span multiple services.\n- Read these [articles](/tags/sagas.html) about the Saga pattern\n- My [presentations](/presentations) on sagas and asynchronous microservices.\n\n## Example code\n\nThe following examples implement the customers and orders example in different ways:\n\n- [Choreography-based saga](https://github.com/eventuate-tram/eventuate-tram-examples-customers-and-orders) where the services publish domain events using the [Eventuate Tram framework](https://github.com/eventuate-tram/eventuate-tram-core)\n- [Orchestration-based saga](https://github.com/eventuate-tram/eventuate-tram-sagas-examples-customers-and-orders) where the `Order Service` uses a saga orchestrator implemented using the [Eventuate Tram Sagas framework](https://github.com/eventuate-tram/eventuate-tram-sagas)\n- [Choreography and event sourcing-based saga](https://github.com/eventuate-examples/eventuate-examples-java-customers-and-orders) where the services publish domain events using the [Eventuate event sourcing framework](http://eventuate.io/)\n\n---\n\n[pattern](/tags/pattern) [transaction management](/tags/transaction management) [sagas](/tags/sagas) [service collaboration](/tags/service collaboration) [implementing commands](/tags/implementing commands)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 10840, "slov": 1404, "odkazu": 48, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/data/saga.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:54", "sha256": "b40bacd786c8e6ec76600ef1ad42d4e4176d1aa9f879e5b53c99347db22124a7", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "https://livebook.manning.com/book/microservices-patterns/chapter-4/143", "https://github.com/microservice-patterns/ftgo-application", "https://github.com/eventuate-tram/eventuate-tram-sagas", "https://github.com/eventuate-tram/eventuate-tram-examples-customers-and-orders", "https://github.com/eventuate-tram/eventuate-tram-core", "https://github.com/eventuate-tram/eventuate-tram-sagas-examples-customers-and-orders", "https://github.com/eventuate-examples/eventuate-examples-java-customers-and-orders", "http://eventuate.io/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/data/shared-database.html", "titulek": "Pattern: Shared database", "h1": "Pattern: Shared database", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Shared database", "og:url": "http://microservices.io/patterns/data/shared-database.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/data/shared-database.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Shared database", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Shared database"}, "url": "http://microservices.io/patterns/data/shared-database.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Shared database"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Shared database\n\n[pattern](/tags/pattern)\n\n---\n\n## Context\n\nLet’s imagine you are developing an online store application using the [Microservice architecture pattern](/patterns/microservices.html).\nMost services need to persist data in some kind of database.\nFor example, the `Order Service` stores information about orders and the `Customer Service` stores information about customers.\n\n## Problem\n\nWhat’s the database architecture in a microservices application?\n\n## Forces\n\n- Services must be loosely coupled so that they can be developed, deployed and scaled independently\n- Some business transactions must enforce invariants that span multiple services.\nFor example, the `Place Order` use case must verify that a new Order will not exceed the customer’s credit limit.\nOther business transactions, must update data owned by multiple services.\n- Some business transactions need to query data that is owned by multiple services.\nFor example, the `View Available Credit` use must query the Customer to find the `creditLimit` and Orders to calculate the total amount of the open orders.\n- Some queries must join data that is owned by multiple services.\nFor example, finding customers in a particular region and their recent orders requires a join between customers and orders.\n- Databases must sometimes be replicated and sharded in order to scale. See the [Scale Cube](/articles/scalecube.html).\n- Different services have different data storage requirements.\nFor some services, a relational database is the best choice.\nOther services might need a NoSQL database such as MongoDB, which is good at storing complex, unstructured data, or Neo4J, which is designed to efficiently store and query graph data.\n\nUse a (single) database that is shared by multiple services.\nEach service freely accesses data owned by other services using local ACID transactions.\n\nThe `OrderService` and `CustomerService` freely access each other’s tables.\nFor example, the `OrderService` can use the following ACID transaction ensure that a new order will not violate the customer’s credit limit.\n\n```\nBEGIN TRANSACTION\n…\nSELECT ORDER_TOTAL\n FROM ORDERS WHERE CUSTOMER_ID = ?\n…\nSELECT CREDIT_LIMIT\nFROM CUSTOMERS WHERE CUSTOMER_ID = ?\n…\nINSERT INTO ORDERS …\n…\nCOMMIT TRANSACTION\n```\n\nThe database will guarantee that the credit limit will not be exceeded even when simultaneous transactions attempt to create orders for the same customer.\n\nThe benefits of this pattern are:\n\n- A developer uses familiar and straightforward ACID transactions to enforce data consistency\n- A single database is simpler to operate\n\nThe drawbacks of this pattern are:\n\n- Development time coupling - a developer working on, for example, the `OrderService` will need to coordinate schema changes with the developers of other services that access the same tables.\nThis coupling and additional coordination will slow down development.\n- Runtime coupling - because all services access the same database they can potentially interfere with one another.\nFor example, if long running `CustomerService` transaction holds a lock on the `ORDER` table then the `OrderService` will be blocked.\n- Single database might not satisfy the data storage and access requirements of all services.\n- [Database per Service](database-per-service.html) is an alternative approach\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 6546, "slov": 864, "odkazu": 30, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/data/shared-database.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:53", "sha256": "0daf3e67e31ea37ba19650612945d6ae14432af94f90fa9f5664253e6b2c3e9d", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/data/transaction-log-tailing.html", "titulek": "Pattern: Transaction log tailing", "h1": "Pattern: Transaction log tailing", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Transaction log tailing", "og:url": "http://microservices.io/patterns/data/transaction-log-tailing.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/data/transaction-log-tailing.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Transaction log tailing", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Transaction log tailing"}, "url": "http://microservices.io/patterns/data/transaction-log-tailing.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Transaction log tailing"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Example"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "Learn more"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Transaction log tailing\n\n[pattern](/tags/pattern) [transactional messaging](/tags/transactional messaging) [inter-service communication](/tags/inter-service communication)\n\n---\n\n## Context\n\nYou have applied the [Transactional Outbox](transactional-outbox.html) pattern.\n\n## Problem\n\nHow to publish messages/events into the *outbox* in the database to the message broker?\n\n## Forces\n\n## Solution\n\nTail the database transaction log and publish each message/event inserted into the *outbox* to the message broker.\n\nThe mechanism for trailing the transaction log depends on the database:\n\n- MySQL binlog\n- Postgres WAL\n- AWS DynamoDB table streams\n\n## Example\n\n- [Eventuate Tram framework](https://github.com/eventuate-tram/eventuate-tram-core) implements transaction log tailing.\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- No 2PC\n- Guaranteed to be accurate\n\nThis pattern has the following drawbacks:\n\n- Relatively obscure although becoming increasing common\n- Requires database specific solutions\n- Tricky to avoid duplicate publishing\n\n- The [Transactional Outbox](transactional-outbox.html) pattern creates the need for this pattern\n- The [Polling publisher](polling-publisher.html) pattern is an alternative solution\n\n## Learn more\n\n- My book [Microservices patterns](/book) describes this pattern in a lot more detail.\n- The [Eventuate Tram framework](https://github.com/eventuate-tram/eventuate-tram-core) implements this pattern\n\n---\n\n[pattern](/tags/pattern) [transactional messaging](/tags/transactional messaging) [inter-service communication](/tags/inter-service communication)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4829, "slov": 561, "odkazu": 32, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/data/transaction-log-tailing.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:01", "sha256": "b07942a1b6f79e480f5ea7c49fd702763756487001fa1d7b7e1bcacaaeedcc87", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://github.com/eventuate-tram/eventuate-tram-core", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/data/transactional-outbox.html", "titulek": "Pattern: Transactional outbox", "h1": "Pattern: Transactional outbox", "popis": "First, write the message/event to a database OUTBOX table as part of the transaction that updates business objects, and then publish it to a message broker.", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Transactional outbox", "og:image": "http://microservices.io/i/patterns/data/ReliablePublication.png", "og:url": "http://microservices.io/patterns/data/transactional-outbox.html", "og:description": "First, write the message/event to a database OUTBOX table as part of the transaction that updates business objects, and then publish it to a message broker."}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/data/transactional-outbox.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Transactional outbox", "description": "A pattern language for microservices", "primaryImageOfPage": {"@type": "ImageObject", "contentUrl": "http://microservices.io/i/patterns/data/ReliablePublication.png", "representativeOfPage": "True"}, "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Transactional outbox", "description": "First, write the message/event to a database OUTBOX table as part of the transaction that updates business objects, and then publish it to a message broker.", "image": {"@type": "ImageObject", "name": "Transactional outbox", "width": "735", "height": "428", "url": "http://microservices.io/i/patterns/data/ReliablePublication.png"}}, "url": "http://microservices.io/patterns/data/transactional-outbox.html"}, {"@context": "http://schema.org", "@type": "Question", "name": "How to reliably/atomically update the database and publish messages/events?", "acceptedAnswer": {"@type": "Answer", "text": "First, write the message/event to a database OUTBOX table as part of the transaction that updates business objects, and then publish it to a message broker."}}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Transactional outbox"}, {"uroven": 2, "text": "Also known as"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Result context"}, {"uroven": 2, "text": "Learn more"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Transactional outbox\n\n[pattern](/tags/pattern) [transactional messaging](/tags/transactional messaging) [service design](/tags/service design) [inter-service communication](/tags/inter-service communication)\n\n---\n\n## Also known as\n\nApplication events\n\n## Context\n\nA service command typically needs to create/update/delete [aggregates](aggregate.html) in the database **and** send messages/events to a message broker.\nFor example, a service that participates in a [saga](/patterns/data/saga.html) needs to update business entities and send messages/events.\nSimilarly, a service that publishes a [domain event](domain-event.html) must update an [aggregate](aggregate.html) and publish an event.\n\nThe command must atomically update the database and send messages in order to avoid data inconsistencies and bugs.\nHowever, it is not viable to use a traditional distributed transaction (2PC) that spans the database and the message broker\nThe database and/or the message broker might not support 2PC.\nAnd even if they do, it’s often undesirable to couple the service to both the database and the message broker.\n\nBut without using 2PC, sending a message in the middle of a transaction is not reliable.\nThere’s no guarantee that the transaction will commit.\nSimilarly, if a service sends a message after committing the transaction there’s no guarantee that it won’t crash before sending the message.\n\nIn addition, messages must be sent to the message broker in the order they were sent by the service.\nThey must usually be delivered to each consumer in the same order although that’s outside the scope of this pattern.\nFor example, let’s suppose that an aggregate is updated by a series of transactions `T1`, `T2`, etc.\nThis transactions might be performed by the same service instance or by different service instances.\nEach transaction publishes a corresponding event: `T1 -> E1`, `T2 -> E2`, etc.\nSince `T1` precedes `T2`, event `E1` must be published before `E2`.\n\n## Problem\n\nHow to atomically update the database and send messages to a message broker?\n\n## Forces\n\n- 2PC is not an option. The database and/or the message broker might not support 2PC. Also, it’s often undesirable to couple the service to both the database and the message broker.\n- If the database transaction commits then the messages must be sent. Conversely, if the database rolls back, the messages must not be sent\n- Messages must be sent to the message broker in the order they were sent by the service. This ordering must be preserved across multiple service instances that update the same aggregate.\n\n## Solution\n\nThe solution is for the service that sends the message to first store the message in the database as part of the transaction that updates the business entities.\nA separate process then sends the messages to the message broker.\n\nThe participants in this pattern are:\n\n- Sender - the service that sends the message\n- Database - the database that stores the business entities and message outbox\n- Message outbox - if it’s a relational database, this is a table that stores the messages to be sent. Otherwise, if it’s a NoSQL database, the outbox is a property of each database record (e.g. document or item)\n- Message relay - sends the messages stored in the outbox to the message broker\n\n## Result context\n\nThis pattern has the following benefits:\n\n- 2PC is not used\n- Messages are guaranteed to be sent if and only if the database transaction commits\n- Messages are sent to the message broker in the order they were sent by the application\n\nThis pattern has the following drawbacks:\n\n- Potentially error prone since the developer might forget to publish the message/event after updating the database.\n\nThis pattern also has the following issues:\n\n- The Message relay might publish a message more than once.\nIt might, for example, crash after publishing a message but before recording the fact that it has done so.\nWhen it restarts, it will then publish the message again.\nAs a result, a message consumer must be idempotent, perhaps by tracking the IDs of the messages that it has already processed.\nFortunately, since message Consumers usually need to be idempotent (because a message broker can deliver messages more than once) this is typically not a problem.\n\n- The [Saga](saga.html) and [Domain event](domain-event.html) patterns create the need for this pattern.\n- The [Event sourcing](event-sourcing.html) is an alternative solution\n- There are two patterns for implementing the Message relay:\n - The [Transaction log tailing](transaction-log-tailing.html) pattern\n - The [Polling publisher](polling-publisher.html) pattern\n\n## Learn more\n\n- My book [Microservices patterns](/book) describes this pattern in a lot more detail.\n- The [Eventuate Tram framework](https://github.com/eventuate-tram/eventuate-tram-core) implements this pattern\n\n---\n\n[pattern](/tags/pattern) [transactional messaging](/tags/transactional messaging) [service design](/tags/service design) [inter-service communication](/tags/inter-service communication)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 8204, "slov": 1122, "odkazu": 38, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/data/transactional-outbox.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:00", "sha256": "4a86d3fb29ea43f67802cbe0ed94763ab0691684525e394d8e6619842b8cc3a5", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://github.com/eventuate-tram/eventuate-tram-core", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/decomposition/decompose-by-business-capability.html", "titulek": "Pattern: Decompose by business capability", "h1": "Pattern: Decompose by business capability", "popis": "Decompose an application into services by defining services corresponding to business capabilities.", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Decompose by business capability", "og:image": "http://microservices.io/i/successtriangle.png", "og:url": "http://microservices.io/patterns/decomposition/decompose-by-business-capability.html", "og:description": "Decompose an application into services by defining services corresponding to business capabilities."}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/decomposition/decompose-by-business-capability.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Decompose by business capability", "description": "A pattern language for microservices", "primaryImageOfPage": {"@type": "ImageObject", "contentUrl": "http://microservices.io/i/successtriangle.png", "representativeOfPage": "True"}, "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Decompose by business capability", "description": "Decompose an application into services by defining services corresponding to business capabilities.", "image": {"@type": "ImageObject", "name": "Microservices enable continuous delivery/deployment", "width": "735", "height": "428", "url": "http://microservices.io/i/successtriangle.png"}}, "url": "http://microservices.io/patterns/decomposition/decompose-by-business-capability.html"}, {"@context": "http://schema.org", "@type": "Question", "name": "How to decompose an application into services?", "acceptedAnswer": {"@type": "Answer", "text": "Decompose an application into services by defining services corresponding to business capabilities."}}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Decompose by business capability"}, {"uroven": 1, "text": "Context"}, {"uroven": 1, "text": "Problem"}, {"uroven": 1, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting Context"}, {"uroven": 2, "text": "Issues"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Decompose by business capability\n\n[pattern](/tags/pattern)\n\n---\n\n# Context\n\nYou are developing a large, complex application and want to use the [microservice architecture](../microservices.html).\nThe microservice architecture structures an application as a set of loosely coupled services.\nThe goal of the microservice architecture is to accelerate software development by enabling continuous delivery/deployment.\n\nThe microservice architecture does this in two ways:\n\n1. Simplifies testing and enables components to deployed independently\n2. Structures the engineering organization as a collection of small (6-10 members), autonomous teams, each of which is responsible for one or more services\n\nThese benefits are not automatically guaranteed.\nInstead, they can only be achieved by the careful functional decomposition of the application into services.\n\nA service must be small enough to be developed by a small team and to be easily tested.\nA useful guideline from object-oriented design (OOD) is the Single Responsibility Principle ([SRP](http://www.objectmentor.com/resources/articles/srp.pdf)).\nThe SRP defines a responsibility of a class as a reason to change, and states that a class should only have one reason to change.\nIt make sense to apply the SRP to service design as well and design services that are cohesive and implement a small set of strongly related functions.\n\nThe application also be decomposed in a way so that most new and changed requirements only affect a single service.\nThat is because changes that affect multiple services requires coordination across multiple teams, which slows down development.\nAnother useful principle from OOD is the Common Closure Principle (CCP), which states that classes that change for the same reason should be in the same package.\nPerhaps, for instance, two classes implement different aspects of the same business rule.\nThe goal is that when that business rule changes developers, only need to change code in a small number - ideally only one - of packages.\nThis kind of thinking makes sense when designing services since it will help ensure that each change should impact only one service.\n\n# Problem\n\nHow to decompose an application into services?\n\n# Forces\n\n- The architecture must be stable\n- Services must be cohesive.\nA service should implement a small set of strongly related functions.\n- Services must conform to the Common Closure Principle - things that change together should be packaged together - to ensure that each change affect only one service\n- Services must be loosely coupled - each service as an API that encapsulates its implementation.\nThe implementation can be changed without affecting clients\n- A service should be testable\n- Each service be small enough to be developed by a “two pizza” team, i.e. a team of 6-10 people\n- Each team that owns one or more services must be autonomous.\nA team must be able to develop and deploy their services with minimal collaboration with other teams.\n\n## Solution\n\nDefine services corresponding to business capabilities.\nA business capability is a concept from business architecture modeling.\nIt is something that a business does in order to generate value.\nA business capability often corresponds to a business object, e.g.\n\n- *Order Management* is responsible for orders\n- *Customer Management* is responsible for customers\n\nBusiness capabilities are often organized into a multi-level hierarchy.\nFor example, an enterprise application might have top-level categories such as *Product/Service development*, *Product/Service delivery*, *Demand generation*, etc.\n\n## Examples\n\nThe business capabilities of an online store include:\n\n- Product catalog management\n- Inventory management\n- Order management\n- Delivery management\n- …\n\nThe corresponding microservice architecture would have services corresponding to each of these capabilities.\n\n## Resulting Context\n\nThis pattern has the following benefits:\n\n- Stable architecture since the business capabilities are relatively stable\n- Development teams are cross-functional, autonomous, and organized around delivering business value rather than technical features\n- Services are cohesive and loosely coupled\n\n## Issues\n\nThere are the following issues to address:\n\n- **How to identify business capabilities?**\nIdentifying business capabilities and hence services requires an understanding of the business.\nAn organization’s business capabilities are identified by analyzing the organization’s purpose, structure, business processes, and areas of expertise.\nBounded contexts are best identified using an iterative process.\nGood starting points for identifying business capabilities are:\n - organization structure - different groups within an organization might correspond to business capabilities or business capability groups.\n - high-level domain model - business capabilities often correspond to domain objects\n\n- The [Decompose by subdomain](decompose-by-subdomain.html) pattern is an alternative pattern\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 8193, "slov": 1089, "odkazu": 30, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/decomposition/decompose-by-business-capability.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:46", "sha256": "ee4d0c9fa57c7c10392a5b8b58099d5156c13669b134d67fd0f8a7bd898aed2d", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "http://www.objectmentor.com/resources/articles/srp.pdf", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/decomposition/decompose-by-subdomain.html", "titulek": "Pattern: Decompose by subdomain", "h1": "Pattern: Decompose by subdomain", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Decompose by subdomain", "og:url": "http://microservices.io/patterns/decomposition/decompose-by-subdomain.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/decomposition/decompose-by-subdomain.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Decompose by subdomain", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Decompose by subdomain"}, "url": "http://microservices.io/patterns/decomposition/decompose-by-subdomain.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Decompose by subdomain"}, {"uroven": 1, "text": "Context"}, {"uroven": 1, "text": "Problem"}, {"uroven": 1, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting Context"}, {"uroven": 2, "text": "Issues"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Decompose by subdomain\n\n[pattern](/tags/pattern)\n\n---\n\n# Context\n\nYou are developing a large, complex application and want to use the [microservice architecture](../microservices.html).\nThe microservice architecture structures an application as a set of loosely coupled services.\nThe goal of the microservice architecture is to accelerate software development by enabling continuous delivery/deployment.\n\nThe microservice architecture does this in two ways:\n\n1. Simplifies testing and enables components to deployed independently\n2. Structures the engineering organization as a collection of small (6-10 members), autonomous teams, each of which is responsible for one or more services\n\nThese benefits are not automatically guaranteed.\nInstead, they can only be achieved by the careful functional decomposition of the application into services.\n\nA service must be small enough to be developed by a small team and to be easily tested.\nA useful guideline from object-oriented design (OOD) is the Single Responsibility Principle ([SRP](http://www.objectmentor.com/resources/articles/srp.pdf)).\nThe SRP defines a responsibility of a class as a reason to change, and states that a class should only have one reason to change.\nIt make sense to apply the SRP to service design as well and design services that are cohesive and implement a small set of strongly related functions.\n\nThe application also be decomposed in a way so that most new and changed requirements only affect a single service.\nThat is because changes that affect multiple services requires coordination across multiple teams, which slows down development.\nAnother useful principle from OOD is the Common Closure Principle (CCP), which states that classes that change for the same reason should be in the same package.\nPerhaps, for instance, two classes implement different aspects of the same business rule.\nThe goal is that when that business rule changes developers, only need to change code in a small number - ideally only one - of packages.\nThis kind of thinking makes sense when designing services since it will help ensure that each change should impact only one service.\n\n# Problem\n\nHow to decompose an application into services?\n\n# Forces\n\n- The architecture must be stable\n- Services must be cohesive.\nA service should implement a small set of strongly related functions.\n- Services must conform to the Common Closure Principle - things that change together should be packaged together - to ensure that each change affect only one service\n- Services must be loosely coupled - each service as an API that encapsulates its implementation.\nThe implementation can be changed without affecting clients\n- A service should be testable\n- Each service be small enough to be developed by a “two pizza” team, i.e. a team of 6-10 people\n- Each team that owns one or more services must be autonomous.\nA team must be able to develop and deploy their services with minimal collaboration with other teams.\n\n## Solution\n\nDefine services corresponding to Domain-Driven Design (DDD) subdomains.\nDDD refers to the application’s problem space - the business - as the domain.\nA domain is consists of multiple subdomains.\nEach subdomain corresponds to a different part of the business.\n\nSubdomains can be classified as follows:\n\n- Core - key differentiator for the business and the most valuable part of the application\n- Supporting - related to what the business does but not a differentiator. These can be implemented in-house or outsourced.\n- Generic - not specific to the business and are ideally implemented using off the shelf software\n\n## Examples\n\nThe subdomains of an online store include:\n\n- Product catalog\n- Inventory management\n- Order management\n- Delivery management\n- …\n\nThe corresponding microservice architecture would have services corresponding to each of these subdomains.\n\n## Resulting Context\n\nThis pattern has the following benefits:\n\n- Stable architecture since the subdomains are relatively stable\n- Development teams are cross-functional, autonomous, and organized around delivering business value rather than technical features\n- Services are cohesive and loosely coupled\n\n## Issues\n\nThere are the following issues to address:\n\n- **How to identify the subdomains?**\nIdentifying subdomains and hence services requires an understanding of the business.\nLike business capabilities, subdomains are identified by analyzing the business and its organizational structure and identifying the different areas of expertise.\nSubdomains are best identified using an iterative process.\nGood starting points for identifying subdomains are:\n- organization structure - different groups within an organization might correspond to subdomains\n- high-level domain model - subdomains often have a key domain object\n\n- The [Decompose by business capability](decompose-by-business-capability.html) pattern is an alternative pattern\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 8101, "slov": 1092, "odkazu": 30, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/decomposition/decompose-by-subdomain.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:47", "sha256": "fa56f5a827801924cf47163241064424eb3ab952e08d510b9b9ecc57bcd2db4f", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "http://www.objectmentor.com/resources/articles/srp.pdf", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/decomposition/self-contained-service.html", "titulek": "Self-contained service", "h1": "Self-contained service", "popis": "Design a service so that it can respond to a synchronous request without waiting for the response from any other service.", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Self-contained service", "og:image": "http://microservices.io/i/Order-Service-asynchronous.png", "og:url": "http://microservices.io/patterns/decomposition/self-contained-service.html", "og:description": "Design a service so that it can respond to a synchronous request without waiting for the response from any other service."}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/decomposition/self-contained-service.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Self-contained service", "description": "A pattern language for microservices", "primaryImageOfPage": {"@type": "ImageObject", "contentUrl": "http://microservices.io/i/Order-Service-asynchronous.png", "representativeOfPage": "True"}, "mainEntity": {"@type": "Intangible", "name": "Pattern: Self-contained service", "description": "Design a service so that it can respond to a synchronous request without waiting for the response from any other service.", "image": {"@type": "ImageObject", "name": "Designing highly available service", "width": "735", "height": "428", "url": "http://microservices.io/i/Order-Service-asynchronous.png"}}, "url": "http://microservices.io/patterns/decomposition/self-contained-service.html"}, {"@context": "http://schema.org", "@type": "Question", "name": "How should a service collaborate with other services when handling a synchronous request?", "acceptedAnswer": {"@type": "Answer", "text": "Design a service so that it can respond to a synchronous request without waiting for the response from any other service."}}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Self-contained service"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Example"}, {"uroven": 2, "text": "Resulting Context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Self-contained service\n\n[pattern](/tags/pattern) [loose coupling](/tags/loose coupling)\n\n---\n\n## Context\n\nConsider, the FTGO application, which is an online food delivery application.\nA client of application creates an order by making an HTTP `POST /orders` request and expects a response, say, within 600ms.\nBecause the FTGO application uses the [microservice architecture](/patterns/microservices.html), the responsibilities that implement order creation are scattered across multiple services.\nThe `POST` request is first routed to the `Order Service`, which must then collaborate with the following services:\n\n- `Restaurant Service` - knows the restaurant’s menu and prices\n- `Consumer Service` - knows the state of the `Consumer` that places the order\n- `Kitchen Service` - creates a `Ticket` , which tells the chef what to cook\n- `Accounting Service` - authorizes the consumer’s credit card\n\nThe `Order Service` could invoke each of these services using synchronous request/response.\nIt might, for example, implement the inter-service communication using REST or gRPC.\n\nHowever, a key drawback of using synchronous request/response is that it reduces availability.\nThat’s because if any of the `Order Sevice`’s collaborators are unavailable, it will not be able to create the order and must return an error to the client.\n\nAn alternative approach is to eliminate all synchronous communication between the `Order Service` and its collaborators by using the CQRS and Saga patterns.\nThe `Order Service` can use the [CQRS pattern](/patterns/data/cqrs.html) to maintain a replica of the restaurant menu’s and there by eliminate the need to synchronously fetch data from the `Restaurant Service`.\nIt can validate the order asynchronously by using the [Saga pattern](/patterns/data/saga.html).\nThe `Order Service` creates an `Order` in a `PENDING` state and sends back a response to the `POST /order`.\nIt then completes the creation of the order by communicating asynchronously with the other services.\n\nA key benefit of this approach is that it improves availability.\nThe `Order Service` always respond to a `POST /orders` request even when one of the other services is unavailable.\nOne drawback, however, of using a saga to complete the creation of the order is that the response to the `POST` doesn’t tell the client whether the order was approved.\nThe client must find out by periodically invoking `GET /orders/{orderId}`.\n\n## Problem\n\nHow should a service collaborate with other services when handling a synchronous request?\n\n## Forces\n\n- The microservice architecture often distributes the responsibility of handling a request amongst multiple services\n- An operation is typically required to be highly available with a low response time\n- The availability of an operation is the product of the availabilities of the services that are invoked while handling a request: serviceAvailability numberOfSynchronouslyCollaboratingServices\n- A service can retry a request to a failed collaborator but this increases response time.\n\n## Solution\n\nDesign a service so that it can respond to a synchronous request without waiting for the response from any other service.\n\nOne way to make a service self-contained is to implement needed functionality as a service module rather than a separate service.\nWe could, for example, merge the `Order Service` and `Restaurant Service`.\n\nAnother way to make a service self-contained is for it to collaborate with other services using the [CQRS](/patterns/data/cqrs.html) and the [Saga](/patterns/data/saga.html) patterns.\nA self-contained service uses the Saga pattern to asynchronously maintain data consistency.\nIt uses the CQRS pattern to maintain a replica of data owned by other services.\n\n## Example\n\nThe `Order Service` in the FTGO application described earlier is an example of a self-contained service.\nThe `createOrder()` operation, for example, queries a CQRS replica of data owned by the `Restaurant Service` to validate and price the order, and then initiates a saga to finish the creation of the order.\n\n## Resulting Context\n\nThis pattern has the following benefits:\n\n- Improved availability and response time\n\nThis pattern has the following drawbacks:\n\n- Increased cost and complexity of using CQRS\n- Increased complexity of using sagas\n- Less straightforward API when using sagas\n- Larger service due to functionality being implemented in the service instead of as a separate service\n\n- [Microservice architecture](/patterns/microservices.html) - creates the need for this pattern\n- [Saga](/patterns/data/saga.html) - used by a service self-contained to asynchronously maintain data consistency\n- [CQRS](/patterns/data/cqrs.html) - used by a service self-contained to maintain a replica of data owned by other services\n\n---\n\n[pattern](/tags/pattern) [loose coupling](/tags/loose coupling)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 7985, "slov": 1077, "odkazu": 31, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/decomposition/self-contained-service.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:48", "sha256": "9d9d755b3364f63f148a7c92a18f0c4fe9cec1924a007bd342de2e8464b307e6", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/decomposition/service-per-team.html", "titulek": "Service per team", "h1": "Service per team", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Service per team", "og:url": "http://microservices.io/patterns/decomposition/service-per-team.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/decomposition/service-per-team.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Service per team", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Service per team"}, "url": "http://microservices.io/patterns/decomposition/service-per-team.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Service per team"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Service per team\n\n[pattern](/tags/pattern) [service granularity](/tags/service granularity)\n\n---\n\n## Context\n\nA high performance development organization consist of multiple teams.\nEach team is long-lived, small (typically 5-9 people), loosely coupled, autonomous, and cross-functional.\n[Conway’s law](https://en.wikipedia.org/wiki/Conway%27s_law)\nsays an architecture mirrors the communication structure of the organization that builds it.\nConsequently, an organization consisting of loosely coupled teams needs a loosely coupled architecture.\n\nOne such loosely coupled architecture is the [microservice architecture](/patterns/microservices.html).\nIt’s an application style that structures an application as a loosely coupled set of services.\n[Decompose by Subdomain](decompose-by-subdomain.html) and [Decompose by business capability](decompose-by-business-capability.html) are patterns for identifying services and organizing them around business functionality.\nBut what’s the relationship between services and teams?\n\nOne approach is a shared ownership model where multiple teams to work on each service as necessary.\nFor example, each team might be responsible for implementing features that span multiple services.\nOn the one hand, this approach aligns teams with the user experience.\nBut on the other hand, it increases the amount of coordination needed between the teams.\nAlso, the lack of code ownership increases the risk of poor code quality.\n\nA better approach, which increases team autonomy and loose coupling, is a code/service ownership model.\nThe team, which is responsible for a business function/capability owns a code base, which they deploy as one of more services.\nAs a result, the team can freely develop, test, deploy and scale its services.\nThey primarily interact with other teams in order to negotiate APIs.\n\nA team should ideally own just one service since that’s sufficient to ensure team autonomy and loose coupling and each additional service adds complexity and overhead.\nA team should only deploy its code as multiple services if it solves a tangible problem, such as significantly reducing lead time or improving scalability or fault tolerance.\n\nSince a team must be small, its cognitive capacity is limited.\nIn order for the team to be productive, its code base should be scoped to not exceed the team’s cognitive capacity.\nIn other words, it must ‘fit’ in the team’s heads.\nAs a result, there is an upper bound on the size and/or complexity of a service.\n\n## Problem\n\nWhat’s the relationship between teams and services?\n\n## Forces\n\n- A team should be small, e.g. 5-9 people\n- A team should be autonomous and loosely coupled\n- The size and complexity of the team’s code base must not exceed the team’s cognitive capacity.\n- Finer-grained service decomposition improves *-ilities* including maintainability, testability, deployability\n- Finer-grained service decomposition adds complexity\n\n## Solution\n\nEach service is owned by a team, which has sole responsibility for making changes.\nIdeally each team has only one service:\n\nEach team is responsible for one or more business functions (e.g. business capabilities).\nA team owns (has sole responsibility for changing) a code base consisting of one or more modules.\nIts code base is sized so as to not exceed the cognitive capacity of team.\nThe team deploys its code as one or more services.\nA team should have exactly one service unless there is a proven need to have multiple services.\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- Enables each team to be autonomous and work with minimal coordination with other teams\n- Enables the teams to be loosely coupled\n- Achieves team autonomy and loose coupling with the minimum number of services\n- Improves code quality due to long term code ownership\n\nThis pattern has the following drawbacks:\n\n- Teams are not necessarily aligned with end user features\n- Implementing features that span services is more complicated and requires teams to collaborate\n\n- [Microservice architecture](/patterns/microservices.html) - creates the need for this pattern\n- [Decompose by Subdomain](decompose-by-subdomain.html) and [Decompose by business capability](decompose-by-business-capability.html) are patterns for identifying services\n\n---\n\n[pattern](/tags/pattern) [service granularity](/tags/service granularity)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 7564, "slov": 1008, "odkazu": 32, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/decomposition/service-per-team.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:49", "sha256": "0b37a9fab201023d2e55d68125a3642a2f6d443a0d2cffffeebba8249ab62496", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://en.wikipedia.org/wiki/Conway's_law", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/deployment/multiple-services-per-host.html", "titulek": "Pattern: Multiple service instances per host", "h1": "Pattern: Multiple service instances per host", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Multiple service instances per host", "og:url": "http://microservices.io/patterns/deployment/multiple-services-per-host.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/deployment/multiple-services-per-host.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Multiple service instances per host", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Multiple service instances per host"}, "url": "http://microservices.io/patterns/deployment/multiple-services-per-host.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Multiple service instances per host"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Multiple service instances per host\n\n[pattern](/tags/pattern) [deployment](/tags/deployment)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](/patterns/microservices.html) and architected your system as a set of services.\nEach service is deployed as a set of service instances for throughput and availability.\n\n## Problem\n\nHow are services packaged and deployed?\n\n## Forces\n\n- Services are written using a variety of languages, frameworks, and framework versions\n- Each service consists of multiple service instances for throughput and availability\n- Service must be independently deployable and scalable\n- Service instances need to be isolated from one another\n- You need to be able to quickly build and deploy a service\n- You need to be able to constrain the resources (CPU and memory) consumed by a service\n- You need to monitor the behavior of each service instance\n- You want deployment to reliable\n- You must deploy the application as cost-effectively as possible\n\n## Solution\n\nRun multiple instances of different services on a host (Physical or Virtual machine).\n\nThere are various ways of deploying a service instance on a shared host including:\n\n- Deploy each service instance as a JVM process. For example, a Tomcat or Jetty instances per service instance.\n- Deploy multiple service instances in the same JVM. For example, as web applications or OSGI bundles.\n\n## Examples\n\n## Resulting context\n\nThe benefits of this pattern include:\n\n- More efficient resource utilization than the [Service Instance per host pattern](single-service-per-host.html)\n\nThe drawbacks of this approach include:\n\n- Risk of conflicting resource requirements\n- Risk of conflicting dependency versions\n- Difficult to limit the resources consumed by a service instance\n- If multiple services instances are deployed in the same process then its difficult to monitor the resource consumption of each service instance.\nIts also impossible to isolate each instance\n\n- The [Single Service Instance per Host pattern](single-service-per-host.html) is an alternative solution.\n- The [Serverless deployment pattern](/patterns/deployment/serverless-deployment.html) is an alternative solution.\n\n---\n\n[pattern](/tags/pattern) [deployment](/tags/deployment)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 5477, "slov": 691, "odkazu": 31, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/deployment/multiple-services-per-host.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:05", "sha256": "d8edb235b82dd62d2cd7865ae0074ddc0b1a061149b946f917487fb49ca9e5a5", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/deployment/serverless-deployment.html", "titulek": "Pattern: Serverless deployment", "h1": "Pattern: Serverless deployment", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Serverless deployment", "og:url": "http://microservices.io/patterns/deployment/serverless-deployment.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/deployment/serverless-deployment.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Serverless deployment", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Serverless deployment"}, "url": "http://microservices.io/patterns/deployment/serverless-deployment.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Serverless deployment"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Serverless deployment\n\n[pattern](/tags/pattern) [deployment](/tags/deployment)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](/patterns/microservices.html) and architected your system as a set of services.\nEach service is deployed as a set of service instances for throughput and availability.\n\n## Problem\n\nHow are services packaged and deployed?\n\n## Forces\n\n- Services are written using a variety of languages, frameworks, and framework versions\n- Each service consists of multiple service instances for throughput and availability\n- Service must be independently deployable and scalable\n- Service instances need to be isolated from one another\n- You need to be able to quickly build and deploy a service\n- You need to be able to constrain the resources (CPU and memory) consumed by a service\n- You need to monitor the behavior of each service instance\n- You want deployment to reliable\n- You must deploy the application as cost-effectively as possible\n\n## Solution\n\nUse a deployment infrastructure that hides any concept of servers (i.e. reserved or preallocated resources)- physical or virtual hosts, or containers.\nThe infrastructure takes your service’s code and runs it.\nYou are charged for each request based on the resources consumed.\n\nTo deploy your service using this approach, you package the code (e.g. as a ZIP file), upload it to the deployment infrastructure and describe the desired performance characteristics.\n\nThe deployment infrastructure is a utility operated by a public cloud provider.\nIt typically uses either containers or virtual machines to isolate the services.\nHowever, these details are hidden from you.\nNeither you nor anyone else in your organization is responsible for managing any low-level infrastructure such as operating systems, virtual machines, etc.\n\n## Examples\n\nThere are a few different serverless deployment environments:\n\n- [AWS Lambda](https://aws.amazon.com/lambda/)\n- [Google Cloud Functions](https://cloud.google.com/functions/docs)\n- [Azure Functions](https://azure.microsoft.com/en-us/services/functions/)\n\nThey offer similar functionality but AWS Lambda has the richest feature set.\nAn AWS Lambda function is a stateless component that is invoked to handle events.\nTo create an AWS Lambda function you package your the NodeJS, Java or Python code for your service in a ZIP file, and upload it to AWS Lambda.\nYou also specify the name of function that handles events as well as resource limits.\n\nWhen an event occurs, AWS Lambda finds an idle instance of your function, launching one if none are available and invokes the handler function.\nAWS Lambda runs enough instances of your function to handle the load.\nUnder the covers, it uses containers to isolate each instance of a lambda function.\nAs you might expect, AWS Lambda runs the containers on EC2 instances.\n\nThere are four ways to invoke a lambda function.\nOne option is to configure your lambda function to be invoked in response to an event generated by an AWS service such as S3, DynamoDB or Kinesis.\nExamples of events include the following:\n\n- an object being created in a S3 bucket\n- an item is created, updated or deleted in a DynamoDB table\n- a message is available to read from a Kinesis stream\n- an email being received via the Simple email service.\n\nAnother way to invoke a lambda function is to configure the AWS Lambda Gateway to route HTTP requests to your lambda.\nAWS Gateway transforms an HTTP request into an event object, invokes the lambda function, and generates a HTTP response from the lambda function’s result.\n\nYou can also explicitly invoke your lambda function using the AWS Lambda Web Service API.\nYour application that invokes the lambda function supplies a JSON object, which is passed to the lambda function.\nThe web service call returns the value returned by the lambda.\n\nThe fourth way to invoke a lambda function is periodically using a cron-like mechanism.\nYou can, for example, tell AWS to invoke you lambda function every five minutes.\n\nThe cost of each invocation is a function of the duration of the invocation, which is measured in 100 millisecond increments, and the memory consumed.\n\n## Resulting context\n\nThe benefits of using serverless deployment include:\n\n- It eliminates the need to spend time on the undifferentiated heavy lifting of managing low-level infrastructure.\nInstead, you can focus on your code.\n- The serverless deployment infrastructure is extremely elastic.\nIt automatically scales your services to handle the load.\n- You pay for each request rather than provisioning what might be under utilized virtual machines or containers.\n\nThe drawbacks of serverless deployment include:\n\n- Significant limitation and constraints -\nA serverless deployment environment typically has far more constraints that a VM-based or Container-based infrastructure.\nFor example, AWS Lambda only supports a few languages.\nIt is only suitable for deploying stateless applications that run in response to a request.\nYou cannot deploy a long running stateful application such as a database or message broker.\n- Limited “input sources” - lambdas can only respond to requests from a limited set of input sources.\nAWS Lambda is not intended to run services that, for example, subscribe to a message broker such as RabbitMQ.\n- Applications must startup quickly - serverless deployment is not a good fit your service takes a long time to start\n- Risk of high latency - the time it takes for the infrastructure to provision an instance of your function and for the function to initialize might result in significant latency.\nMoreover, a serverless deployment infrastructure can only react to increases in load.\nYou cannot proactively pre-provision capacity.\nAs a result, your application might initially exhibit high latency when there are sudden, massive spikes in load.\n\nThe deployment infrastructure will internally deploy your application using one of the other patterns.\nIt will most likely use [Service Service per Host pattern](single-service-per-host.html).\n\n- The [Multiple Service Instances per Host pattern](multiple-services-per-host.html) is an alternative deployment solution\n- The [Single Service per Host pattern](single-service-per-host.html) is an alternative deployment solution\n\n---\n\n[pattern](/tags/pattern) [deployment](/tags/deployment)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 9520, "slov": 1327, "odkazu": 34, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/deployment/serverless-deployment.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:09", "sha256": "bfedbda29ce91bb562a4983ba950bc845978a82c4e1134e03af14ed59a92561f", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://aws.amazon.com/lambda/", "https://cloud.google.com/functions/docs", "https://azure.microsoft.com/en-us/services/functions/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/deployment/service-deployment-platform.html", "titulek": "Pattern: Service deployment platform", "h1": "Pattern: Service deployment platform", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Service deployment platform", "og:url": "http://microservices.io/patterns/deployment/service-deployment-platform.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/deployment/service-deployment-platform.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Service deployment platform", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Service deployment platform"}, "url": "http://microservices.io/patterns/deployment/service-deployment-platform.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Service deployment platform"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Service deployment platform\n\n[pattern](/tags/pattern) [deployment](/tags/deployment)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](/patterns/microservices.html) and architected your system as a set of services.\nEach service is deployed as a set of service instances for throughput and availability.\n\n## Problem\n\nHow are services packaged and deployed?\n\n## Forces\n\n- Services are written using a variety of languages, frameworks, and framework versions\n- Each service consists of multiple service instances for throughput and availability\n- Service must be independently deployable and scalable\n- Service instances need to be isolated from one another\n- You need to be able to quickly build and deploy a service\n- You need to be able to constrain the resources (CPU and memory) consumed by a service\n- You need to monitor the behavior of each service instance\n- You want deployment to reliable\n- You must deploy the application as cost-effectively as possible\n\n## Solution\n\nUse a deployment platform, which is automated infrastructure for application deployment.\nIt provides a service abstraction, which is a named, set of highly available (e.g. load balanced) service instances.\n\n## Examples\n\n- Docker orchestration frameworks including [Docker swarm mode](https://docs.docker.com/engine/swarm/) and [Kubernetes](http://kubernetes.io/)\n- [Serverless platforms](serverless-deployment.html) such as AWS Lambda\n- PaaS including [Cloud Foundry](https://www.cloudfoundry.org/) and [AWS Elastic Beanstalk](https://aws.amazon.com/elasticbeanstalk/)\n\n- Some deployment platforms provide a [Service Registry](../service-registry.html) and [Server-Side discovery](../server-side-discovery.html)\n- Internally, a deployment platform might use use [containers](../deployment/service-per-container.html) or [virtual machines](../deployment/service-per-vm.html) to deploy a service.\nDocker orchestration frameworks are, of course, explicitly [container-based](../deployment/service-per-container.html)\n\n---\n\n[pattern](/tags/pattern) [deployment](/tags/deployment)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 5312, "slov": 625, "odkazu": 38, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/deployment/service-deployment-platform.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:10", "sha256": "3e82b41c68191b89d52787758f707ca81691d3b3ef2eb7885b6a9c3cc7cc35c1", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://docs.docker.com/engine/swarm/", "http://kubernetes.io/", "https://www.cloudfoundry.org/", "https://aws.amazon.com/elasticbeanstalk/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/deployment/service-per-container.html", "titulek": "Pattern: Service instance per container", "h1": "Pattern: Service instance per container", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Service instance per container", "og:url": "http://microservices.io/patterns/deployment/service-per-container.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/deployment/service-per-container.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Service instance per container", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Service instance per container"}, "url": "http://microservices.io/patterns/deployment/service-per-container.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Service instance per container"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Service instance per container\n\n[pattern](/tags/pattern) [deployment](/tags/deployment) [docker](/tags/docker)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](/patterns/microservices.html) and architected your system as a set of services.\nEach service is deployed as a set of service instances for throughput and availability.\n\n## Problem\n\nHow are services packaged and deployed?\n\n## Forces\n\n- Services are written using a variety of languages, frameworks, and framework versions\n- Each service consists of multiple service instances for throughput and availability\n- Service must be independently deployable and scalable\n- Service instances need to be isolated from one another\n- You need to be able to quickly build and deploy a service\n- You need to be able to constrain the resources (CPU and memory) consumed by a service\n- You need to monitor the behavior of each service instance\n- You want deployment to reliable\n- You must deploy the application as cost-effectively as possible\n\n## Solution\n\nPackage the service as a (Docker) container image and deploy each service instance as a container\n\n## Examples\n\nDocker is becoming an extremely popular way of packaging and deploying services.\nEach service is packaged as a Docker image and each service instance is a Docker container.\nThere are several Docker clustering frameworks including:\n\n- [Kubernetes](http://kubernetes.io/)\n- [Marathon/Mesos](https://mesosphere.github.io/marathon/)\n- [Amazon EC2 Container Service](http://aws.amazon.com/ecs/)\n\n## Resulting context\n\nThe benefits of this approach include:\n\n- It is straightforward to scale up and down a service by changing the number of container instances.\n- The container encapsulates the details of the technology used to build the service. All services are, for example, started and stopped in exactly the same way.\n- Each service instance is isolated\n- A container imposes limits on the CPU and memory consumed by a service instance\n- Containers are extremely fast to build and start.\nFor example, it’s 100x faster to package an application as a Docker container than it is to package it as an AMI.\nDocker containers also start much faster than a VM since only the application process starts rather than an entire OS.\n\nThe drawbacks of this approach include:\n\n- The infrastructure for deploying containers is not as rich as the infrastructure for deploying virtual machines.\n\n- This pattern is a refinement of the [Service Instance per Host pattern](single-service-per-host.html)\n- The [Service Instance per VM pattern](service-per-vm.html) is an alternative solution\n- The [Serverless deployment pattern](serverless-deployment.html) is an alternative solution.\n\n---\n\n[pattern](/tags/pattern) [deployment](/tags/deployment) [docker](/tags/docker)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 6008, "slov": 766, "odkazu": 36, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/deployment/service-per-container.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:08", "sha256": "9136530b64a8420fca0f1406d9ccc473edc9c0f714122d4d7e5fff688dbbca1f", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "http://kubernetes.io/", "https://mesosphere.github.io/marathon/", "http://aws.amazon.com/ecs/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/deployment/service-per-vm.html", "titulek": "Pattern: Service Instance per VM", "h1": "Pattern: Service Instance per VM", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Service Instance per VM", "og:url": "http://microservices.io/patterns/deployment/service-per-vm.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/deployment/service-per-vm.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Service Instance per VM", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Service Instance per VM"}, "url": "http://microservices.io/patterns/deployment/service-per-vm.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Service Instance per VM"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Service Instance per VM\n\n[pattern](/tags/pattern) [deployment](/tags/deployment)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](/patterns/microservices.html) and architected your system as a set of services.\nEach service is deployed as a set of service instances for throughput and availability.\n\n## Problem\n\nHow are services packaged and deployed?\n\n## Forces\n\n- Services are written using a variety of languages, frameworks, and framework versions\n- Each service consists of multiple service instances for throughput and availability\n- Service must be independently deployable and scalable\n- Service instances need to be isolated from one another\n- You need to be able to quickly build and deploy a service\n- You need to be able to constrain the resources (CPU and memory) consumed by a service\n- You need to monitor the behavior of each service instance\n- You want deployment to reliable\n- You must deploy the application as cost-effectively as possible\n\n## Solution\n\nPackage the service as a virtual machine image and deploy each service instance as a separate VM\n\n## Examples\n\n- Netflix packages each service as an EC2 AMI and deploys each service instance as a EC2 instance.\n\n## Resulting context\n\nThe benefits of this approach include:\n\n- Its straightforward to scale the service by increasing the number of instances. Amazon Autoscaling Groups can even do this automatically based on load.\n- The VM encapsulates the details of the technology used to build the service. All services are, for example, started and stopped in exactly the same way.\n- Each service instance is isolated\n- A VM imposes limits on the CPU and memory consumed by a service instance\n- IaaS solutions such as AWS provide a mature and feature rich infrastructure for deploying and managing virtual machines. For example,\n - Elastic Load Balancer -\n - Autoscaling groups\n - …\n\nThe drawbacks of this approach include:\n\n- Building a VM image is slow and time consuming\n\n- This pattern is a refinement of the [Single Service per Host pattern](single-service-per-host.html)\n- The [Service Instance per Container pattern](service-per-container.html) is an alternative solution\n- The [Serverless deployment pattern](/patterns/deployment/serverless-deployment.html) is an alternative solution.\n\n---\n\n[pattern](/tags/pattern) [deployment](/tags/deployment)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 5569, "slov": 716, "odkazu": 32, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/deployment/service-per-vm.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:07", "sha256": "e18ac8f4de4dd094807fec8d0052ac030d5fe03b210a953cac417882b5e64c88", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/deployment/single-service-per-host.html", "titulek": "Pattern: Single Service Instance per Host", "h1": "Pattern: Single Service Instance per Host", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Single Service Instance per Host", "og:url": "http://microservices.io/patterns/deployment/single-service-per-host.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/deployment/single-service-per-host.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Single Service Instance per Host", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Single Service Instance per Host"}, "url": "http://microservices.io/patterns/deployment/single-service-per-host.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Single Service Instance per Host"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Single Service Instance per Host\n\n[pattern](/tags/pattern) [deployment](/tags/deployment)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](/patterns/microservices.html) and architected your system as a set of services.\nEach service is deployed as a set of service instances for throughput and availability.\n\n## Problem\n\nHow are services packaged and deployed?\n\n## Forces\n\n- Services are written using a variety of languages, frameworks, and framework versions\n- Each service consists of multiple service instances for throughput and availability\n- Service must be independently deployable and scalable\n- Service instances need to be isolated from one another\n- You need to be able to quickly build and deploy a service\n- You need to be able to constrain the resources (CPU and memory) consumed by a service\n- You need to monitor the behavior of each service instance\n- You want deployment to reliable\n- You must deploy the application as cost-effectively as possible\n\n## Solution\n\nDeploy each single service instance on its own host\n\n## Examples\n\n## Resulting context\n\nThe benefits of this approach include:\n\n- Services instances are isolated from one another\n- There is no possibility of conflicting resource requirements or dependency versions\n- A service instance can only consume at most the resources of a single host\n- Its straightforward to monitor, manage, and redeploy each service instance\n\nThe drawbacks of this approach include:\n\n- Potentially less efficient resource utilization compared to [Multiple Services per Host](multiple-services-per-host.html) because there are more hosts\n\n- The [Multiple Service Instances per Host pattern](multiple-services-per-host.html) is an alternative solution\n- The [Service Instance per VM pattern](service-per-vm.html) is a refinement of this pattern\n- The [Service Instance per Container pattern](service-per-container.html) is a refinement of this pattern\n- The [Serverless deployment pattern](/patterns/deployment/serverless-deployment.html) is an alternative solution.\n\n---\n\n[pattern](/tags/pattern) [deployment](/tags/deployment)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 5335, "slov": 665, "odkazu": 33, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/deployment/single-service-per-host.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:06", "sha256": "865b93b6210cd8fbbf8b9b1b629c6b7abf8839272530fec8d0b627ff41791945", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/externalized-configuration.html", "titulek": "Pattern: Externalized configuration", "h1": "Pattern: Externalized configuration", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Externalized configuration", "og:url": "http://microservices.io/patterns/externalized-configuration.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/externalized-configuration.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Externalized configuration", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Externalized configuration"}, "url": "http://microservices.io/patterns/externalized-configuration.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Externalized configuration"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting Context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Externalized configuration\n\n[pattern](/tags/pattern) [service design](/tags/service design)\n\n---\n\n## Context\n\nAn application typically uses one or more infrastructure and 3rd party services.\nExamples of infrastructure services include: a [Service registry](service-registry.html), a message broker and a database server.\nExamples of 3rd party services include: payment processing, email and messaging, etc.\n\n## Problem\n\nHow to enable a service to run in multiple environments without modification?\n\n## Forces\n\n- A service must be provided with configuration data that tells it how to connect to the external/3rd party services. For example, the database network location and credentials\n- A service must run in multiple environments - dev, test, qa, staging, production - without modification and/or recompilation\n- Different environments have different instances of the external/3rd party services, e.g. QA database vs. production database, test credit card processing account vs. production credit card processing account\n\n## Solution\n\nExternalize all application configuration including the database credentials and network location.\nOn startup, a service reads the configuration from an external source, e.g. OS environment variables, etc.\n\n## Examples\n\n[Spring Boot externalized configuration](https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html) reads values from a variety of sources including operating system environment variables, property files and command line arguments.\nThese values are available within the Spring application context.\n\n`RegistrationServiceProxy` from the [Microservices Example application](https://github.com/cer/microservices-examples) is an example of a component, which is written in Scala, is configured with the variable `user_registration_url`:\n\n```\n @Component class RegistrationServiceProxy @Autowired()(restTemplate: RestTemplate) extends RegistrationService { @Value(\"${user_registration_url}\") var userRegistrationUrl: String = _ \n```\n\nThe `docker-compose.yml` file supplies its value as an operating system environment variable:\n\n```\nweb: image: sb_web ports: - \"8080:8080\" links: - eureka environment: USER_REGISTRATION_URL: http://REGISTRATION-SERVICE/user \n```\n\n`REGISTRATION-SERVICE` is the logical name of the service.\nIt is resolved using [Client-side discovery](client-side-discovery.html).\n\n## Resulting Context\n\nThis pattern has the following benefits:\n\n- The application runs in multiple environments without modification and/or recompilation\n\nThere are the following issues with this pattern:\n\n- How to ensure that when an application is deployed the supplied configuration matches what is expected?\n\n- The service discovery patterns, [Server-side service discovery](server-side-discovery.html) and [Client-side service discovery](client-side-discovery.html) , solve the related problem of how a service knows the network location of other application services\n\n---\n\n[pattern](/tags/pattern) [service design](/tags/service design)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 6242, "slov": 744, "odkazu": 33, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/externalized-configuration.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:12", "sha256": "898c287c6529db884ac6936e2cd4bb0b18a710366bda02b4c42253d4498a51e7", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html", "https://github.com/cer/microservices-examples", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/index.html", "titulek": "A pattern language for microservices", "h1": "A pattern language for microservices", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: A pattern language for microservices", "og:url": "http://microservices.io/patterns/"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "A pattern language for microservices", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: A pattern language for microservices"}, "url": "http://microservices.io/patterns/"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "A pattern language for microservices"}, {"uroven": 2, "text": "Architectural style"}, {"uroven": 2, "text": "Service boundaries"}, {"uroven": 2, "text": "Refactoring to services"}, {"uroven": 2, "text": "Service collaboration"}, {"uroven": 2, "text": "Transactional messaging"}, {"uroven": 2, "text": "Testing"}, {"uroven": 2, "text": "Deployment"}, {"uroven": 2, "text": "Cross-cutting concerns"}, {"uroven": 2, "text": "Communication styles"}, {"uroven": 2, "text": "External API"}, {"uroven": 2, "text": "Service discovery"}, {"uroven": 2, "text": "Reliability"}, {"uroven": 2, "text": "Security"}, {"uroven": 2, "text": "Observability"}, {"uroven": 2, "text": "UI design"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# A pattern language for microservices\n\n[pattern](/tags/pattern)\n\n---\n\nThe beginnings of a [pattern language](http://en.wikipedia.org/wiki/Pattern_language) for microservice architectures.\n\n[点击这里,访问本系列文章的中文翻译](cn/index.html)\n\n[Click here for Chinese translation of the patterns](cn/index.html)\n\n[Click here for PDF](../i/MicroservicePatternLanguage.pdf)\n\n## Architectural style\n\nWhich architectural style should you choose for an application?\n\n- [Monolithic architecture](monolithic.html) - architect an application as a single deployable unit\n- [Microservice architecture](microservices.html) - architect an application as a collection of independently deployable, loosely coupled services\n\n## Service boundaries\n\nHow to decompose an application into services?\n\n- [Decompose by business capability](decomposition/decompose-by-business-capability.html) - define services corresponding to business capabilities\n- [Decompose by subdomain](decomposition/decompose-by-subdomain.html) - define services corresponding to DDD subdomains\n- [Self-contained Service](decomposition/self-contained-service.html) - design services to handle synchronous requests without waiting for other services to respond new\n- [Service per team](/patterns/decomposition/service-per-team.html) new\n\n## Refactoring to services\n\n- [Strangler Application](/patterns/refactoring/strangler-application.html)\n- [Anti-corruption layer](/patterns/refactoring/anti-corruption-layer.html)\n\n## Service collaboration\n\nHow to implement operations that span multiple services?\n\n- [Database per Service](data/database-per-service.html) - each service has its own private database\n- [Shared database](data/shared-database.html) - services share a database\n- [Saga](data/saga.html) - use sagas, which a sequences of local transactions, to maintain data consistency across services\n- [Command-side replica](data/command-side-replica.html) - maintain a queryable replica of data in a service that implements a command\n- [API Composition](data/api-composition.html) - implement queries by invoking the services that own the data and performing an in-memory join\n- [CQRS](data/cqrs.html) - implement queries by maintaining one or more materialized views that can be efficiently queried\n- [Domain event](/patterns/data/domain-event.html) - publish an event whenever data changes\n- [Event sourcing](data/event-sourcing.html) - persist aggregates as a sequence of events\n\n## Transactional messaging\n\nHow to send messages as part of a database transaction?\n\n- [Transactional outbox](data/transactional-outbox.html)\n- [Transaction log tailing](data/transaction-log-tailing.html)\n- [Polling publisher](data/polling-publisher.html)\n\n## Testing\n\nHow to test services?\n\n- [Consumer-driven contract test](testing/service-integration-contract-test.html) - a test suite for a service that is written by the developers of another service that consumes it\n- [Consumer-side contract test](testing/service-integration-contract-test.html) - a test suite for a service client (e.g. another service) that verifies that it can communicate with the service\n- [Service component sest](testing/service-component-test.html) - a test suite that tests a service in isolation using test doubles for any services that it invokes\n\n## Deployment\n\nHow to deploy an application’s services?\n\n- [Multiple service instances per host](deployment/multiple-services-per-host.html) - deploy multiple service instances on a single host\n- [Service instance per host](deployment/single-service-per-host.html) - deploy each service instance in its own host\n- [Service instance per VM](deployment/service-per-vm.html) - deploy each service instance in its VM\n- [Service instance per Container](deployment/service-per-container.html) - deploy each service instance in its container\n- [Serverless deployment](/patterns/deployment/serverless-deployment.html) - deploy a service using serverless deployment platform\n- [Service deployment platform](/patterns/deployment/service-deployment-platform.html) - deploy services using a highly automated deployment platform that provides a service abstraction\n\n## Cross-cutting concerns\n\nHow to handle cross cutting concerns?\n\n- [Microservice chassis](/patterns/microservice-chassis.html) - a framework that handles cross-cutting concerns and simplifies the development of services\n- [Externalized configuration](/patterns/externalized-configuration.html) - externalize all configuration such as database location and credentials\n- [Service Template](/patterns/service-template.html) - a template that implements standard cross cutting concerns and is intended to be copied by a developer in order to quickly start developing a new service\n\n## Communication styles\n\nWhich mechanisms do services use to communicate with each other and their external clients?\n\n- [Remote Procedure Invocation](communication-style/rpi.html) - use an RPI-based protocol for inter-service communication\n- [Messaging](communication-style/messaging.html) - use asynchronous messaging for inter-service communication\n- [Domain-specific protocol](communication-style/domain-specific.html) - use a domain-specific protocol\n- [Idempotent Consumer](/patterns/communication-style/idempotent-consumer.html) - ensure that message consumers can cope with being invoked multiple times with the same message\n\n## External API\n\nHow do external clients communicate with the services?\n\n- [API gateway](apigateway.html) - a service that provides each client with unified interface to services\n- [Backend for front-end](apigateway.html) - a separate API gateway for each kind of client\n\n## Service discovery\n\nHow does the client of an RPI-based service discover the network location of a service instance?\n\n- [Client-side discovery](client-side-discovery.html) - client queries a service registry to discover the locations of service instances\n- [Server-side discovery](server-side-discovery.html) - router queries a service registry to discover the locations of service instances\n- [Service registry](service-registry.html) - a database of service instance locations\n- [Self registration](self-registration.html) - service instance registers itself with the service registry\n- [3rd party registration](3rd-party-registration.html) - a 3rd party registers a service instance with the service registry\n\n## Reliability\n\nHow to prevent a network or service failure from cascading to other services?\n\n- [Circuit Breaker](reliability/circuit-breaker.html) - invoke a remote service via a proxy that fails immediately when the failure rate of the remote call exceeds a threshold\n\n## Security\n\nHow to communicate the identity of the requestor to the services that handle the request?\n\n- [Access Token](security/access-token.html) - a token that securely stores information about user that is exchanged between services\n\n## Observability\n\nHow to understand the behavior of an application and troubleshoot problems?\n\n- [Log aggregation](observability/application-logging.html) - aggregate application logs\n- [Application metrics](observability/application-metrics.html) - instrument a service’s code to gather statistics about operations\n- [Audit logging](observability/audit-logging.html) - record user activity in a database\n- [Distributed tracing](observability/distributed-tracing.html) - instrument services with code that assigns each external request an unique identifier that is passed between services.\nRecord information (e.g. start time, end time) about the work (e.g. service requests) performed when handling the external request in a centralized service\n- [Exception tracking](observability/exception-tracking.html) - report all exceptions to a centralized exception tracking service that aggregates and tracks exceptions and notifies developers.\n- [Health check API](observability/health-check-api.html) - service API (e.g. HTTP endpoint) that returns the health of the service and is intended to be pinged, for example, by a monitoring service\n- [Log deployments and changes](/patterns/observability/log-deployments-and-changes.html)\n\n## UI design\n\nHow to implement a UI screen or page that displays data from multiple services?\n\n- [Server-side page fragment composition](ui/server-side-page-fragment-composition.html) - build a webpage on the server by composing HTML fragments generated by multiple, business capability/subdomain-specific web applications\n- [Client-side UI composition](ui/client-side-ui-composition.html) - Build a UI on the client by composing UI fragments rendered by multiple, business capability/subdomain-specific UI components\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 11631, "slov": 1363, "odkazu": 81, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:42", "sha256": "e627c155f35b94b27b44e81d693c359b2fd5d129d56cd3b02f4d3db3f0c74491", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "http://en.wikipedia.org/wiki/Pattern_language", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/microservice-chassis.html", "titulek": "Pattern: Microservice chassis", "h1": "Pattern: Microservice chassis", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Microservice chassis", "og:url": "http://microservices.io/patterns/microservice-chassis.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/microservice-chassis.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Microservice chassis", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Microservice chassis"}, "url": "http://microservices.io/patterns/microservice-chassis.html"}], "drobecky": [], "osnova": [{"uroven": 1, "text": "Pattern: Microservice chassis"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Want to learn more about this pattern?"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "See also"}, {"uroven": 2, "text": "Learn more"}], "markdown": "# Pattern: Microservice chassis\n\n[pattern](/tags/pattern) [service design](/tags/service design) [microservice chassis](/tags/microservice chassis)\n\n---\n\n## Context\n\n## Want to learn more about this pattern?\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\nWhen you start the development of an application you often spend a significant amount of time writing the build logic and putting in place the mechanisms to handle cross-cutting concerns.\nThe build logic builds, and tests the application and also packages into a production-ready format, such as a Docker container image.\nFor example, the majority of the build logic for a Java application is implemented using Gradle or Maven.\nIt might also consist of configuration scripts for build automation tool, such as CircleCI or Github Actions.\nOn the surface, the build logic appears to be quite simple.\nHowever, even defining a carefully curated set of dependencies can be remarkably challenging.\n\nIn addition to the build logic, you need to handle cross cutting concerns.\nExamples of cross-cutting concerns include:\n\n- Security - for example, REST APIs must be secured by requiring an [Access Token](/security/access-token.html)\n- [Externalized configuration](/patterns/externalized-configuration.html) - includes credentials, and network locations of external services such as databases and message brokers\n- [Logging](/patterns/observability/application-logging.html) - configuring of a logging framework such as log4j or logback\n- [Health check](/patterns/observability/health-check-api.html) - a url that a monitoring service can “ping” to determine the health of the application\n- [Metrics](/patterns/observability/application-metrics.html) - measurements that provide insight into what the application is doing and how it is performing\n- [Distributed tracing](/patterns/observability/distributed-tracing.html) - instrument services with code that assigns each external request an unique identifier that is passed between services.\n\nAs well as these generic cross-cutting concerns, there are also cross-cutting concerns that are specific to the technologies that an application uses.\nApplications that use infrastructure services such as databases or a message brokers require boilerplate configuration in order to do that.\nFor example, applications that use a relational database must be configured with a connection pool.\nWeb applications that process HTTP requests also need boilerplate configuration.\n\nIt is common to spend one or two days, sometimes even longer, writing the build logic and implementing cross-cutting concerns.\nIf you going to spend months or years developing a monolithic application then the upfront investment is insignificant.\nThe situation is very different, however, if you are developing an application that has the [microservice architecture](microservices.html).\nThere are tens or hundreds of services.\nYou will frequently create new services, each of which will only take days or weeks to develop.\nYou cannot afford to spend a few days setting up every service.\nWhat is even worse is that in a microservice architecture there are additional cross-cutting concerns that you have to deal with including service registration and discovery, and circuit breakers for reliably handling partial failure.\n\nOne solution is to create a [Service Template](service-template.html), which is a source code template that a developer can copy in order to quickly start developing a new service.\nThe drawback, however, of a Service Template is that it’s a form of copy/paste programming: when the build logic and cross-cutting concerns logic needs to change, each service must be updated individually.\n\n## Problem\n\nHow can a team quickly create and setup a maintainable code base for a production-ready service so they can start developing its business logic?\n\n## Forces\n\n- A service must implement\n - Build logic that builds, and tests the application and also packages into a production-ready format, such as a Docker container image.\n - Cross-cutting concerns such as externalized configuration, logging, health checks, metrics, service registration and discovery, circuit breakers. There are also cross-cutting concerns that are specific to the technologies that the microservices uses.\n- Creating a new microservice should be fast and easy\n- It should be fast and straightforward to update existing services when the requirements for build logic and cross-cutting concerns change.\n\nCreate a microservice chassis framework that can be foundation for developing your microservices.\nThe chassis implements\n\n- Reusable build logic that builds, and tests a service. This includes, for example, Gradle Plugins.\n- Mechanisms that handle cross-cutting concerns. The chassis typically assembles and configures a collection of frameworks and libraries that implement this functionality.\n\nThe [Service Template](service-template.html) is a sample service that uses the microservice chassis.\n\nExamples of frameworks that are the starting point for creating a microservice chassis:\n\n- Java\n - [Spring Boot](http://projects.spring.io/spring-boot/) and [Spring Cloud](http://cloud.spring.io/)\n - [Dropwizard](https://dropwizard.github.io/)\n- Go\n - [Gizmo](http://open.blogs.nytimes.com/2015/12/17/introducing-gizmo/?_r=2)\n - [Micro](https://github.com/micro)\n - [Go kit](https://github.com/go-kit/kit)\n\n## Resulting context\n\nThe main benefit of a microservice chassis is that it’s faster and easier to keep the dependencies, build logic and cross-cutting concern logic up to date.\nYou simply release a new version of the microservice chassis framework that contains the needed changes, and update each service to the use new version.\n\nOne issue is that you need a microservice chassis for each programming language/framework that you want to use.\nThis can be an obstacle to adopting a new programming language or framework.\n\nThere are the following related patterns:\n\n- [Service Template](service-template.html) - a template for a service that developers can copy to create a new application. It’s either an alternative to the Microservice Chassis pattern; or it uses a Microservice Chassis and simply contains the code and configuration that doesn’t belong in the chassis\n- [Microservices](microservices.html) - this pattern motivates the need for the Microservice Chassis pattern\n- [Self Registration](self-registration.html) - the microservice chassis is often responsible for registering the service with the service registry\n- [Client-side discovery](client-side-discovery.html) - the microservice chassis is often responsible for client-side service discovery\n- [Circuit Breaker](reliability/circuit-breaker.html) - the microservice chassis framework might implement this pattern\n- [Distributed tracing](observability/distributed-tracing.html) - the microservice chassis framework might instrument the code\n- [Service Template](service-template.html) often uses a Microservice Chassis\n\n## See also\n\n- This excellent [Service Template blog post](https://blog.thepete.net/blog/2020/09/25/service-templates-service-chassis/) by [@ph1](https://twitter.com/ph1)\n\n## Learn more\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.", "znaku_textu": 7362, "slov": 987, "odkazu": 49, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/microservice-chassis.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:11", "sha256": "b53a0d91b0ab83db580a4dbb0a99ceba1c5eedbb7948cf62dbbfdba5956e6ed2", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "http://projects.spring.io/spring-boot/", "http://cloud.spring.io/", "https://dropwizard.github.io/", "http://open.blogs.nytimes.com/2015/12/17/introducing-gizmo/?_r=2", "https://github.com/micro", "https://github.com/go-kit/kit", "https://blog.thepete.net/blog/2020/09/25/service-templates-service-chassis/", "https://twitter.com/ph1", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/microservices.html", "titulek": "Microservice Architecture pattern", "h1": "Microservice Architecture pattern", "popis": "The microservice architecture structures an application as a set of loosely coupled, deployable/executable components organized around business capabilities", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Microservice Architecture pattern", "og:image": "http://microservices.io/i/Microservice_Architecture.png", "og:url": "http://microservices.io/patterns/microservices.html", "og:description": "The microservice architecture structures an application as a set of loosely coupled, deployable/executable components organized around business capabilities"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/microservices.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Microservice Architecture pattern", "description": "A pattern language for microservices", "primaryImageOfPage": {"@type": "ImageObject", "contentUrl": "http://microservices.io/i/Microservice_Architecture.png", "representativeOfPage": "True"}, "mainEntity": {"@type": "Intangible", "name": "Pattern: Microservice Architecture pattern", "description": "The microservice architecture structures an application as a set of loosely coupled, deployable/executable components organized around business capabilities", "image": {"@type": "ImageObject", "name": "The microservice architecture", "width": "735", "height": "428", "url": "http://microservices.io/i/Microservice_Architecture.png"}}, "url": "http://microservices.io/patterns/microservices.html"}, {"@context": "http://schema.org", "@type": "Question", "name": "What are microservices?", "acceptedAnswer": {"@type": "Answer", "text": "The microservice architecture structures an application as a set of loosely coupled, deployable/executable components organized around business capabilities"}}], "drobecky": [], "osnova": [{"uroven": 1, "text": "Microservice Architecture pattern"}, {"uroven": 1, "text": "Pattern: Microservice Architecture"}, {"uroven": 2, "text": "Want to learn how to design a microservice architecture?"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 3, "text": "Fictitious e-commerce application"}, {"uroven": 3, "text": "Show me the code"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 3, "text": "Benefits"}, {"uroven": 3, "text": "Drawbacks"}, {"uroven": 3, "text": "Issues"}, {"uroven": 4, "text": "Designing a good (monolithic or microservice) architecture with Assemblage"}, {"uroven": 4, "text": "Designing distributed operations"}, {"uroven": 2, "text": "Known uses"}, {"uroven": 1, "text": "Examples"}, {"uroven": 1, "text": "See also"}], "markdown": "# Microservice Architecture pattern\n\n[pattern](/tags/pattern) [application architecture](/tags/application architecture) [microservice architecture](/tags/microservice architecture)\n\n---\n\n# Pattern: Microservice Architecture\n\n## Want to learn how to design a microservice architecture?\n\nTake a look at [Assemblage, a microservice architecture definition process](/post/architecture/2023/02/09/assemblage-architecture-definition-process.html).\n\nIn my workshop, you will learn about to use Assemblage to design a microsevice architecture for your application.\n\nUpcoming public workshop: [Designing Microservices: Responsibilities, APIs and Collaborations](https://exploreddd.com/workshops/designing-microservices.html) at Explore DDD 2026.\n\n## Context\n\nYou are developing a business-critical enterprise application.\nYou need to deliver changes rapidly, frequently and reliably - as measured by the [DORA metrics](/articles/glossary#dora-metrics) - in order for your business to thrive in today’s volatile, uncertain, complex and ambiguous world.\nConsequently, your engineering organization is organized into small, loosely coupled, cross-functional teams as described by [Team Topologies](/tags/team%20topologies).\nEach team delivers software using DevOps practices as defined by the [DevOps handbook](/tags/devops).\nIn particular, it practices continuous deployment.\nThe team delivers a stream of small, frequent changes that are tested by an automated deployment pipeline and deployed into production.\n\nA team is responsible for one or more subdomains.\nA subdomain is an implementable model of a slice of business functionality, a.k.a. business capability.\nIt consists of business logic, which consists of business entities (a.k.a. DDD aggregates) that implement business rules, and adapters, which communicate with the outside world.\nA Java-based subdomain, for example, consists of classes organized into packages that’s compiled into a JAR file.\n\nThe subdomains implement the application’s behavior, which consists of a set of (system) operations.\nAn operation is invoked in one of three ways: synchronous and asynchronous requests from clients; events published by other applications and services; and the passing of time.\nIt mutates and queries business entities in one or more subdomains.\n\n## Problem\n\nHow to organize the subdomains into one or more deployable/executable components?\n\n## Forces\n\nThere are five [dark energy forces](/post/microservices/2021/11/30/dark-matter-dark-energy.html):\n\n- [Simple components](/articles/dark-energy-dark-matter/dark-energy/simple-components.html) - simple components consisting of few subdomains are easier to understand and maintain than complex components\n- [Team autonomy](/articles/dark-energy-dark-matter/dark-energy/team-autonomy.html) - a team needs to be able to develop, test and deploy their software independently of other teams\n- [Fast deployment pipeline](/articles/dark-energy-dark-matter/dark-energy/fast-deployment-pipeline.html) - fast feedback and high deployment frequency are essential and are enabled by a fast deployment pipeline, which in turn requires components that are fast to build and test.\n- [Support multiple technology stacks](/articles/dark-energy-dark-matter/dark-energy/multiple-technology-stacks.html) - subdomains are sometimes implemented using a variety of technologies; and developers need to evolve the application’s technology stack, e.g. use current versions of languages and frameworks\n- [Segregate by characteristics](/articles/dark-energy-dark-matter/dark-energy/segregate-by-characteristics.html) - e.g. resource requirements to improve scalability, their availability requirements to improve availability, their security requirements to improve security, etc.\n\nThere are five [dark matter forces](/post/microservices/2021/11/30/dark-matter-dark-energy.html):\n\n- [Simple interactions](/articles/dark-energy-dark-matter/dark-matter/simple-interactions.html) - an operation that’s local to a component or consists of a few simple interactions between components is easier to understand and troubleshoot than a distributed operation, especially one consisting of complex interactions\n- [Efficient interactions](/articles/dark-energy-dark-matter/dark-matter/efficient-interactions.html) - a distributed operation that involves lots of network round trips and large data transfers can be too inefficient\n- [Prefer ACID over BASE](/articles/dark-energy-dark-matter/dark-matter/prefer-acid-over-base.html) - it’s easier to implement an operation as an ACID transaction rather than, for example, eventually consistent sagas\n- [Minimize runtime coupling](/articles/dark-energy-dark-matter/dark-matter/minimize-runtime-coupling.html) - to maximize the availability and reduce the latency of an operation\n- [Minimize design time coupling](/articles/dark-energy-dark-matter/dark-matter/minimize-design-time-coupling.html) - reduce the likelihood of changing services in lockstep, which reduces productivity\n\n## Solution\n\nDesign an architecture that structures the application as a set of two or more [independently deployable](/post/architecture/2022/05/04/microservice-architecture-essentials-deployability.html), [loosely coupled](/post/architecture/2023/03/28/microservice-architecture-essentials-loose-coupling.html), [components, a.k.a. services](/post/microservices/general/2019/02/16/whats-a-service-part-1.html).\nEach service consists of one or more subdomains.\nEach subdomain is part of a single service except for shared library subdomains that are used by multiple services.\nA service is owned by the team (or teams) that owns the (non-library) subdomains.\n\nAn [API gateway](/patterns/apigateway.html) is typically the application’s entry point.\nSome system operations will be local to a single service, while others will be distributed across multiple services.\nA distributed system operation is implemented using the [service collaboration patterns](/post/patterns/2023/07/29/service-collaboration-patterns.html).\n\nIn order to be independently deployable each service typically has its own source code repository and its own deployment pipeline, which builds, tests and deploys the service.\n\n## Examples\n\n### Fictitious e-commerce application\n\nLet’s imagine that you are building an e-commerce application that takes orders from customers, verifies inventory and available credit, and ships them.\nThe application consists of several components including the StoreFrontUI, which implements the user interface, along with some backend services for checking credit,\nmaintaining inventory and shipping orders.\nThe application consists of a set of services.\n\n### Show me the code\n\nPlease see the [example applications developed by Chris Richardson](http://eventuate.io/exampleapps.html).\nThese examples on Github illustrate various aspects of the microservice architecture.\n\n## Resulting context\n\n### Benefits\n\nThis solution has a number of benefits:\n\n- Simple services - each service consists of a small number of subdomains - possibly just one - and so is easier to understand and maintain\n- Team autonomy - a team can develop, test and deploy their service independently of other teams\n- Fast deployment pipeline - each service is fast to test since it’s relatively small, and can be deployed independently\n- Support multiple technology stacks - different services can use different technology stacks and can be upgraded independently\n- Segregate subdomains by their characteristics - subdomains can be segregated by their characteristics into separate services in order to improve scalability, availability, security etc\n\n### Drawbacks\n\nThis solution has a number of (**potential**) drawbacks:\n\n- Some distributed operations might be complex, and difficult to understand and troubleshoot\n- Some distributed operations might be potentially inefficient\n- Some operations might need to be implemented using complex, eventually consistent (non-ACID) transaction management since loose coupling requires each [service to have its own database](/patterns/data/database-per-service.html) .\n- Some distributed operations might involve tight runtime coupling between services, which reduces their availability.\n- Risk of tight design-time coupling between services, which requires time consuming lockstep changes\n\n### Issues\n\nThere are many issues that you must address when designing an architecture.\n\n#### Designing a good (monolithic or microservice) architecture with Assemblage\n\nThere are two key issues that you must address.\nThe first issue is whether to use the monolithic or microservice architecture.\nAnd then, if you choose to use the microservice architecture, the next key challenge is to define a good [service architecture](/post/architecture/2023/09/19/assemblage-part-3-whats-a-service-architecture.html).\nYou must avoid (or at least minimize) the potential drawbacks: complex, inefficient interactions; complex eventually consistent transactions; and tight runtime coupling.\n\n[Assemblage](/post/architecture/2023/02/09/assemblage-architecture-definition-process.html), is an architecture definition process that uses the [dark energy and dark matter forces](/post/architecture/2023/03/26/dark-energy-dark-matter-force-descriptions.html) to group the subdomains in a way that results in good microservice architecture.\n\nThe result of applying Assemblage is either a monolithic architecture or a microservice architecture.\n\nThe [dark energy and dark matter forces](/post/architecture/2023/03/26/dark-energy-dark-matter-force-descriptions.html) play a major role in shaping the service architecture and also heavily influence the design of the distributed operations mentioned below.\n\n#### Designing distributed operations\n\nAnother key design challenge when using microservices, is implementing distributed operations, which span multiple services.\nThis is especially challenging since each [service has its own database](/patterns/data/database-per-service.html).\nThe solution is to use the [service collaboration patterns](/post/patterns/2023/07/29/service-collaboration-patterns.html), which implement distributed operations as a series of local transactions:\n\nThere are four service collaboration patterns:\n\n- [Saga](/patterns/data/saga.html) , which implements a distributed command as a series of local transactions\n- [Command-side replica](/patterns/data/cqrs.html) , which replicas read-only data to the service that implements a command\n- [API composition](/patterns/data/api-composition.html) , which implements a distributed query as a series of local queries\n- [CQRS](/patterns/data/cqrs.html) , which implements a distributed query as a series of local queries\n\nThe Saga, Command-side replica and CQRS patterns use asynchronous messaging.\nServices typically need to use the [Transaction Outbox pattern](/patterns/data/transactional-outbox.html) to atomically update persistent business entities and send a message.\n\nThere are many patterns related to the Microservices architecture pattern. The [Monolithic architecture](monolithic.html) is an alternative to the microservice architecture.\nThe other patterns in the Microservice architecture architecture pattern address issues that you will encounter when applying this pattern.\n\n- Sservice collaboration patterns:\n - [Saga](/patterns/data/saga.html) , which implements a distributed command as a series of local transactions\n - [Command-side replica](/patterns/data/cqrs.html) , which replicas read-only data to the service that implements a command\n - [API composition](/patterns/data/api-composition.html) , which implements a distributed query as a series of local queries\n - [CQRS](/patterns/data/cqrs.html) , which implements a distributed query as a series of local queries\n- The [Messaging](/patterns/communication-style/messaging.html) and [Remote Procedure Invocation](/patterns/communication-style/rpi.html) patterns are two different ways that services can communicate.\n- The [Database per Service pattern](data/database-per-service.html) describes how each service has its own database in order to ensure loose coupling.\n- The [API Gateway pattern](apigateway.html) defines how clients access the services in a microservice architecture.\n- The [Client-side Discovery](client-side-discovery.html) and [Server-side Discovery](server-side-discovery.html) patterns are used to route requests for a client to an available service instance in a microservice architecture.\n- Testing patterns: [Service Component Test](testing/service-component-test.html) and [Service Integration Contract Test](testing/service-integration-contract-test.html)\n- [Circuit Breaker](/patterns/reliability/circuit-breaker.html)\n- [Access Token](/patterns/security/access-token.html)\n- Observability patterns:\n - [Log aggregation](/patterns/observability/application-logging.html)\n - [Application metrics](/patterns/observability/application-metrics.html)\n - [Audit logging](/patterns/observability/audit-logging.html)\n - [Distributed tracing](/patterns/observability/distributed-tracing.html)\n - [Exception tracking](/patterns/observability/exception-tracking.html)\n - [Health check API](/patterns/observability/health-check-api.html)\n - [Log deployments and changes](/patterns/observability/log-deployments-and-changes.html)\n- UI patterns:\n - [Server-side page fragment composition](/patterns/ui/server-side-page-fragment-composition.html)\n - [Client-side UI composition](/patterns/ui/client-side-ui-composition.html)\n- The [Single Service per Host](deployment/single-service-per-host.html) and [Multiple Services per Host](deployment/multiple-services-per-host.html) patterns are two different deployment strategies.\n- Cross-cutting concerns patterns: [Microservice chassis pattern](/patterns/microservice-chassis.html) and [Externalized configuration](/patterns/externalized-configuration.html)\n\n## Known uses\n\nMost large scale web sites including [Netflix](http://techblog.netflix.com/), [Amazon](http://highscalability.com/blog/2007/9/18/amazon-architecture.html)\nand [eBay](http://www.addsimplicity.com/downloads/eBaySDForum2006-11-29.pdf) have evolved from a monolithic architecture to a microservice architecture.\n\nNetflix, which is a very popular video streaming service that’s responsible for up to 30% of Internet traffic, has a large scale, service-oriented architecture.\nThey handle over a billion calls per day to their video streaming API from over 800 different kinds of devices.\nEach API call fans out to an average of six calls to backend services.\n\nAmazon.com originally had a two-tier architecture.\nIn order to scale they migrated to a service-oriented architecture consisting of hundreds of backend services.\nSeveral applications call these services including the applications that implement the Amazon.com website and the web service API.\nThe Amazon.com website application calls 100-150 services to get the data that used to build a web page.\n\nThe auction site ebay.com also evolved from a monolithic architecture to a service-oriented architecture.\nThe application tier consists of multiple independent applications.\nEach application implements the business logic for a specific function area such as buying or selling.\nEach application uses X-axis splits and some applications such as search use Z-axis splits.\nEbay.com also applies a combination of X-, Y- and Z-style scaling to the database tier.\n\nThere are [numerous other examples](../articles/whoisusingmicroservices.html) of companies using the microservice architecture.\n\n# Examples\n\nChris Richardson has [examples](http://eventuate.io/exampleapps.html) of microservices-based applications.\n\n# See also\n\n- [Jfokus 2020 - Cubes, Hexagons, Triangles, and More - Understanding Microservices](/microservices/2020/02/04/jfokus-geometry-of-microservices.html) - provides a good introduction to the microservice architecture.\n- [Microservices patterns](/book)", "znaku_textu": 15667, "slov": 1881, "odkazu": 86, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/microservices.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:43", "sha256": "552c9ed68d6858f01d4c9f37a9896ce8e721e79b506d18650e37ca004ef89ac6", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://exploreddd.com/workshops/designing-microservices.html", "http://eventuate.io/exampleapps.html", "http://techblog.netflix.com/", "http://highscalability.com/blog/2007/9/18/amazon-architecture.html", "http://www.addsimplicity.com/downloads/eBaySDForum2006-11-29.pdf", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/monolithic.html", "titulek": "Pattern: Monolithic Architecture", "h1": "Pattern: Monolithic Architecture", "popis": "The monolithic architecture structures an application as a single deployable/executable component", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Monolithic Architecture", "og:image": "http://microservices.io/i/DecomposingApplications.011.jpg", "og:url": "http://microservices.io/patterns/monolithic.html", "og:description": "The monolithic architecture structures an application as a single deployable/executable component"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/monolithic.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Monolithic Architecture", "description": "A pattern language for microservices", "primaryImageOfPage": {"@type": "ImageObject", "contentUrl": "http://microservices.io/i/DecomposingApplications.011.jpg", "representativeOfPage": "True"}, "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Monolithic Architecture", "description": "The monolithic architecture structures an application as a single deployable/executable component", "image": {"@type": "ImageObject", "name": "The Monolithic architecture", "width": "735", "height": "428", "url": "http://microservices.io/i/DecomposingApplications.011.jpg"}}, "url": "http://microservices.io/patterns/monolithic.html"}, {"@context": "http://schema.org", "@type": "Question", "name": "What is a monolithic architecture?", "acceptedAnswer": {"@type": "Answer", "text": "The monolithic architecture structures an application as a single deployable/executable component"}}], "drobecky": [], "osnova": [{"uroven": 1, "text": "Pattern: Monolithic Architecture"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Example"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 3, "text": "Benefits"}, {"uroven": 3, "text": "Drawbacks"}, {"uroven": 3, "text": "Issues"}, {"uroven": 2, "text": "Known uses"}], "markdown": "# Pattern: Monolithic Architecture\n\n[pattern](/tags/pattern) [application architecture](/tags/application architecture)\n\n---\n\n## Context\n\nYou are developing a business-critical enterprise application.\nYou need to deliver changes rapidly, frequently and reliably - as measured by the [DORA metrics](/articles/glossary#dora-metrics) - in order for your business to thrive in today’s volatile, uncertain, complex and ambiguous world.\nConsequently, your engineering organization is organized into small, loosely coupled, cross-functional teams as described by [Team Topologies](/tags/team%20topologies).\nEach team delivers software using DevOps practices as defined by the [DevOps handbook](/tags/devops).\nIn particular, it practices continuous deployment.\nThe team delivers a stream of small, frequent changes that are tested by an automated deployment pipeline and deployed into production.\n\nA team is responsible for one or more subdomains.\nA subdomain is an implementable model of a slice of business functionality, a.k.a. business capability.\nIt consists of business logic, which consists of business entities (a.k.a. DDD aggregates) that implement business rules, and adapters, which communicate with the outside world.\nA Java-based subdomain, for example, consists of classes organized into packages that’s compiled into a JAR file.\n\nThe subdomains implement the application’s behavior, which consists of a set of (system) operations.\nAn operation is invoked in one of three ways: synchronous and asynchronous requests from clients; events published by other applications and services; and the passing of time.\nIt mutates and queries business entities in one or more subdomains.\n\n## Problem\n\nHow to organize the subdomains into one or more deployable/executable components?\n\n## Forces\n\nThere are five [dark energy forces](/post/microservices/2021/11/30/dark-matter-dark-energy.html):\n\n- [Simple components](/articles/dark-energy-dark-matter/dark-energy/simple-components.html) - simple components consisting of few subdomains are easier to understand and maintain than complex components\n- [Team autonomy](/articles/dark-energy-dark-matter/dark-energy/team-autonomy.html) - a team needs to be able to develop, test and deploy their software independently of other teams\n- [Fast deployment pipeline](/articles/dark-energy-dark-matter/dark-energy/fast-deployment-pipeline.html) - fast feedback and high deployment frequency are essential and are enabled by a fast deployment pipeline, which in turn requires components that are fast to build and test.\n- [Support multiple technology stacks](/articles/dark-energy-dark-matter/dark-energy/multiple-technology-stacks.html) - subdomains are sometimes implemented using a variety of technologies; and developers need to evolve the application’s technology stack, e.g. use current versions of languages and frameworks\n- [Segregate by characteristics](/articles/dark-energy-dark-matter/dark-energy/segregate-by-characteristics.html) - e.g. resource requirements to improve scalability, their availability requirements to improve availability, their security requirements to improve security, etc.\n\nThere are five [dark matter forces](/post/microservices/2021/11/30/dark-matter-dark-energy.html):\n\n- [Simple interactions](/articles/dark-energy-dark-matter/dark-matter/simple-interactions.html) - an operation that’s local to a component or consists of a few simple interactions between components is easier to understand and troubleshoot than a distributed operation, especially one consisting of complex interactions\n- [Efficient interactions](/articles/dark-energy-dark-matter/dark-matter/efficient-interactions.html) - a distributed operation that involves lots of network round trips and large data transfers can be too inefficient\n- [Prefer ACID over BASE](/articles/dark-energy-dark-matter/dark-matter/prefer-acid-over-base.html) - it’s easier to implement an operation as an ACID transaction rather than, for example, eventually consistent sagas\n- [Minimize runtime coupling](/articles/dark-energy-dark-matter/dark-matter/minimize-runtime-coupling.html) - to maximize the availability and reduce the latency of an operation\n- [Minimize design time coupling](/articles/dark-energy-dark-matter/dark-matter/minimize-design-time-coupling.html) - reduce the likelihood of changing services in lockstep, which reduces productivity\n\n## Solution\n\nDesign an architecture that structures the application as a single deployable/executable component that uses a single database.\nThe component contains all of the application’s subdomains.\nSince there’s a single component, all operations are local.\n\n## Example\n\nLet’s imagine that you are building an e-commerce application that takes orders from customers, verifies inventory and available credit, and ships them.\nThe application consists of several components including the StoreFrontUI, which implements the user interface, along with some backend services for checking credit,\nmaintaining inventory and shipping orders.\n\nThe application is deployed as a single monolithic application.\nFor example, a Java web application consists of a single WAR file that runs on a web container such as Tomcat.\nA Rails application consists of a single directory hierarchy deployed using either, for example, Phusion Passenger on Apache/Nginx or JRuby on Tomcat.\nYou can run multiple instances of the application behind a load balancer in order to scale and improve availability.\n\n## Resulting context\n\n### Benefits\n\nSince the application consists of a single component and all operations are local this solution has a number of benefits.\nSpecifically, the dark energy forces are resolved as follows:\n\n- Simple interactions - all interactions are generally easier to understand and troubleshoot. However, interactions between subdomains could potentially be complex.\n- Efficient interactions - interactions are typically more efficient since all communication is local.\n- Prefer ACID over Base - operations can be implemented as ACID transactions (usually)\n- Minimize runtime coupling - there’s no runtime coupling between components\n- Minimize design time coupling - these’s no design time coupling between components. There can, however, be design time coupling between subdomains within the monolith.\n\n### Drawbacks\n\nThis solution has a number of (**potential**) drawbacks.\nSpecifically, an architecture might fail to resolve the dark energy forces:\n\n- Simple components - since there’s only a single component it is potentially difficult to understand and maintain due its size and complexity\n- Team autonomy - there’s potentially less team autonomy since all teams are contributing to the same code base and they need to coordinate their work more often\n- Fast deployment pipeline - the deployment pipeline is potentially slow since there’s a single large application that needs to be built and tested\n- Multiple technology stacks - the application uses a single technology stack, which might not be ideal for all subdomains. Also, if the application is large upgrading the technology stack might be very time consuming\n- Segregate by characteristics - there’s no possibility of segregating subdomains by their characteristics, which might reduce scalability, availability, security etc\n\nThese drawbacks become more severe as the application grows in size and complexity and the number of teams developing it increases.\n\n### Issues\n\nA key challenge with the monolithic architecture is minimizing the potential drawbacks, especially as the application grows in size and complexity and the number of teams developing it increases.\nThere are a few solutions that can reduce some of the drawbacks:\n\n- Increase maintainability and team autonomy by [modularizing the monolith](/post/architecture/2023/07/31/how-modular-can-your-monolith-go-part-1.html). Instead of the traditional layered architecture, the subdomains are organized into vertical slices consisting of presentation, business and persistent logic.\n- Accelerate the deployment pipeline by\n - apply [physical design principles](/post/architecture/2023/09/12/how-modular-can-your-monolith-go-part-4-physical-design.html) to the modular monolith in order to reduce build time coupling\n - implementing an automated merge queue\n - using a build tool that supports incremental building and testing\n - parallelizing and clustering the build and test steps.\n\nThe [microservice architecture](microservices.html) is an alternative pattern that addresses the limitations of the monolithic architecture.\n\n## Known uses\n\nWell known internet services such as Netflix, Amazon.com and eBay initially had a monolithic architecture.\nMost web applications developed by the author prior to 2012 had a monolithic architecture.", "znaku_textu": 8608, "slov": 1141, "odkazu": 45, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/monolithic.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:45", "sha256": "805e2c7d63610f203b92d48ee4f91fe810fac39219e88711cb78cd4050579005", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/observability/application-logging.html", "titulek": "Pattern: Log aggregation", "h1": "Pattern: Log aggregation", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Log aggregation", "og:url": "http://microservices.io/patterns/observability/application-logging.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/observability/application-logging.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Log aggregation", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Log aggregation"}, "url": "http://microservices.io/patterns/observability/application-logging.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Log aggregation"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting Context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Log aggregation\n\n[pattern](/tags/pattern) [observability](/tags/observability) [service design](/tags/service design)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\nThe application consists of multiple services and service instances that are running on multiple machines.\nRequests often span multiple service instances.\n\nEach service instance generates writes information about what it is doing to a log file in a standardized format.\nThe log file contains errors, warnings, information and debug messages.\n\n## Problem\n\nHow to understand the behavior of an application and troubleshoot problems?\n\n## Forces\n\n- Any solution should have minimal runtime overhead\n\n## Solution\n\nUse a centralized logging service that aggregates logs from each service instance.\nThe users can search and analyze the logs.\nThey can configure alerts that are triggered when certain messages appear in the logs.\n\n## Examples\n\n- [AWS Cloud Watch](https://aws.amazon.com/cloudwatch/)\n\n## Resulting Context\n\nThis pattern has the following issues:\n\n- handling a large volume of logs requires substantial infrastructure\n\n- [Distributed tracing](distributed-tracing.html) - include the external request id in each log message\n- [Exception tracking](exception-tracking.html) - as well as logging exceptions, report them to an exception tracking service\n\n---\n\n[pattern](/tags/pattern) [observability](/tags/observability) [service design](/tags/service design)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4713, "slov": 561, "odkazu": 33, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/observability/application-logging.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:25", "sha256": "8bb5bbb7434f3bc6b182a2c12b40d309cccc2b90a13292e2ce6c1ef64e8e27e0", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://aws.amazon.com/cloudwatch/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/observability/application-metrics.html", "titulek": "Pattern: Application metrics", "h1": "Pattern: Application metrics", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Application metrics", "og:url": "http://microservices.io/patterns/observability/application-metrics.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/observability/application-metrics.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Application metrics", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Application metrics"}, "url": "http://microservices.io/patterns/observability/application-metrics.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Application metrics"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Application metrics\n\n[pattern](/tags/pattern) [observability](/tags/observability) [service design](/tags/service design)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\n\n## Problem\n\nHow to understand the behavior of an application and troubleshoot problems?\n\n## Forces\n\n- Any solution should have minimal runtime overhead\n\n## Solution\n\nInstrument a service to gather statistics about individual operations.\nAggregate metrics in centralized metrics service, which provides reporting and alerting.\nThere are two models for aggregating metrics:\n\n- push - the service pushes metrics to the metrics service\n- pull - the metrics services pulls metrics from the service\n\n## Examples\n\n- Instrumentation libraries:\n - Coda Hale/Yammer [Java Metrics Library](http://metrics.dropwizard.io/3.1.0/)\n - [Prometheus client libraries](https://prometheus.io/docs/instrumenting/clientlibs/)\n- Metrics aggregation services\n - [Prometheus](https://prometheus.io/docs/introduction/overview/)\n - [AWS Cloud Watch](https://aws.amazon.com/cloudwatch/)\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- It provides deep insight into application behavior\n\nThis pattern has the following drawbacks:\n\n- Metrics code is intertwined with business logic making it more complicated\n\nThis pattern has the following issues:\n\n- Aggregating metrics can require significant infrastructure\n\n---\n\n[pattern](/tags/pattern) [observability](/tags/observability) [service design](/tags/service design)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4747, "slov": 536, "odkazu": 34, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/observability/application-metrics.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:26", "sha256": "bd42d54d801574c1ac52381036b83751578983f1e122bd9fad8248f3c312a9a9", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "http://metrics.dropwizard.io/3.1.0/", "https://prometheus.io/docs/instrumenting/clientlibs/", "https://prometheus.io/docs/introduction/overview/", "https://aws.amazon.com/cloudwatch/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/observability/audit-logging", "titulek": "Pattern: Audit logging", "h1": "Pattern: Audit logging", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Audit logging", "og:url": "http://microservices.io/patterns/observability/audit-logging.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/observability/audit-logging.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Audit logging", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Audit logging"}, "url": "http://microservices.io/patterns/observability/audit-logging.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Audit logging"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting Context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Audit logging\n\n[pattern](/tags/pattern) [observability](/tags/observability) [service design](/tags/service design)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\n\n## Problem\n\nHow to understand the behavior of users and the application and troubleshoot problems?\n\n## Forces\n\n- It is useful to know what actions a user has recently performed: customer support, compliance, security, etc.\n\n## Solution\n\nRecord user activity in a database.\n\n## Examples\n\nThis pattern is widely used.\n\n## Resulting Context\n\nThis pattern has the following benefits:\n\n- Provides a record of user actions\n\nThis pattern has the following drawbacks:\n\n- The auditing code is intertwined with the business logic, which makes the business logic more complicated\n\n- [Event Sourcing](../data/event-sourcing.html) is a reliable way to implement auditing\n\n---\n\n[pattern](/tags/pattern) [observability](/tags/observability) [service design](/tags/service design)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4218, "slov": 499, "odkazu": 31, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/observability/audit-logging", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:48", "sha256": "50a39df4bb5ed310f290d10e7c03497389db0e69324e46e43b988594aa98653e", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/observability/audit-logging.html", "titulek": "Pattern: Audit logging", "h1": "Pattern: Audit logging", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Audit logging", "og:url": "http://microservices.io/patterns/observability/audit-logging.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/observability/audit-logging.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Audit logging", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Audit logging"}, "url": "http://microservices.io/patterns/observability/audit-logging.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Audit logging"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting Context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Audit logging\n\n[pattern](/tags/pattern) [observability](/tags/observability) [service design](/tags/service design)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\n\n## Problem\n\nHow to understand the behavior of users and the application and troubleshoot problems?\n\n## Forces\n\n- It is useful to know what actions a user has recently performed: customer support, compliance, security, etc.\n\n## Solution\n\nRecord user activity in a database.\n\n## Examples\n\nThis pattern is widely used.\n\n## Resulting Context\n\nThis pattern has the following benefits:\n\n- Provides a record of user actions\n\nThis pattern has the following drawbacks:\n\n- The auditing code is intertwined with the business logic, which makes the business logic more complicated\n\n- [Event Sourcing](../data/event-sourcing.html) is a reliable way to implement auditing\n\n---\n\n[pattern](/tags/pattern) [observability](/tags/observability) [service design](/tags/service design)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4218, "slov": 499, "odkazu": 31, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/observability/audit-logging", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:27", "sha256": "50a39df4bb5ed310f290d10e7c03497389db0e69324e46e43b988594aa98653e", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/observability/distributed-tracing.html", "titulek": "Pattern: Distributed tracing", "h1": "Pattern: Distributed tracing", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Distributed tracing", "og:url": "http://microservices.io/patterns/observability/distributed-tracing.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/observability/distributed-tracing.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Distributed tracing", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Distributed tracing"}, "url": "http://microservices.io/patterns/observability/distributed-tracing.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Distributed tracing"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting Context"}, {"uroven": 3, "text": "See also"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Distributed tracing\n\n[pattern](/tags/pattern) [observability](/tags/observability) [service design](/tags/service design)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\nRequests often span multiple services.\nEach service handles a request by performing one or more operations, e.g. database queries, publishes messages, etc.\n\n## Problem\n\nHow to understand the behavior of an application and troubleshoot problems?\n\n## Forces\n\n- External monitoring only tells you the overall response time and number of invocations - no insight into the individual operations\n- Any solution should have minimal runtime overhead\n- Log entries for a request are scattered across numerous logs\n\n## Solution\n\nInstrument services with code that\n\n- Assigns each external request a unique external request id\n- Passes the external request id to all services that are involved in handling the request\n- Includes the external request id in all [log messages](application-logging.html)\n- Records information (e.g. start time, end time) about the requests and operations performed when handling a external request in a centralized service\n\nThis instrumentation might be part of the functionality provided by a [Microservice Chassis framework](../microservice-chassis.html).\n\n## Examples\n\nThe [Microservices Example application](https://github.com/cer/microservices-examples) is an example of an application that uses client-side service discovery.\nIt is written in Scala and uses Spring Boot and Spring Cloud as the [Microservice chassis](../microservice-chassis.html).\nThey provide various capabilities including [Spring Cloud Sleuth](https://cloud.spring.io/spring-cloud-sleuth/), which provides support for distributed tracing.\nIt instruments Spring components to gather trace information and can delivers it to a Zipkin Server, which gathers and displays traces.\n\nThe following Spring Cloud Sleuth dependencies are configured in `build.gradle`:\n\n```\ndependencies { compile \"org.springframework.cloud:spring-cloud-sleuth-stream\" compile \"org.springframework.cloud:spring-cloud-starter-sleuth\" compile \"org.springframework.cloud:spring-cloud-stream-binder-rabbit\" \n```\n\nRabbitMQ is used to deliver traces to Zipkin.\n\nThe services are deployed with various Spring Cloud Sleuth-related environment variables set in the `docker-compose.yml`:\n\n```\nenvironment:\n SPRING_RABBITMQ_HOST: rabbitmq\n SPRING_SLEUTH_ENABLED: \"true\"\n SPRING_SLEUTH_SAMPLER_PERCENTAGE: 1\n SPRING_SLEUTH_WEB_SKIPPATTERN: \"/api-docs.*|/autoconfig|/configprops|/dump|/health|/info|/metrics.*|/mappings|/trace|/swagger.*|.*\\\\.png|.*\\\\.css|.*\\\\.js|/favicon.ico|/hystrix.stream\"\n```\n\nThis properties enable Spring Cloud Sleuth and configure it to sample all requests.\nIt also tells Spring Cloud Sleuth to deliver traces to Zipkin via RabbitMQ running on the host called `rabbitmq`.\n\nThe Zipkin server is a simple, Spring Boot application:\n\n```\n@SpringBootApplication @EnableZipkinStreamServer public class ZipkinServer { public static void main(String[] args) { SpringApplication.run(ZipkinServer.class, args); } } \n```\n\nIt is deployed using Docker:\n\n```\nzipkin: image: java:openjdk-8u91-jdk working_dir: /app volumes: - ./zipkin-server/build/libs:/app command: java -jar /app/zipkin-server.jar --server.port=9411 links: - rabbitmq ports: - \"9411:9411\" environment: RABBIT_HOST: rabbitmq \n```\n\n## Resulting Context\n\nThis pattern has the following benefits:\n\n- It provides useful insight into the behavior of the system including the sources of latency\n- It enables developers to see how an individual request is handled by searching across [aggregated logs](application-logging.html) for its external request id\n\nThis pattern has the following issues:\n\n- Aggregating and storing traces can require significant infrastructure\n\n- [Log aggregation](application-logging.html) - the external request id is included in each log message\n\n### See also\n\n- [Open Zipkin](http://zipkin.io/) - service for recording and displaying tracing information\n- [Open Tracing](http://opentracing.io) - standardized API for distributed tracing\n\n---\n\n[pattern](/tags/pattern) [observability](/tags/observability) [service design](/tags/service design)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 7390, "slov": 886, "odkazu": 36, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/observability/distributed-tracing.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:29", "sha256": "b5e8a292ce1a072a80164515c0d373bb07e3037ef527e853e4b3f758f29e73dd", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://github.com/cer/microservices-examples", "https://cloud.spring.io/spring-cloud-sleuth/", "http://zipkin.io/", "http://opentracing.io/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/observability/exception-tracking.html", "titulek": "Pattern: Exception tracking", "h1": "Pattern: Exception tracking", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Exception tracking", "og:url": "http://microservices.io/patterns/observability/exception-tracking.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/observability/exception-tracking.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Exception tracking", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Exception tracking"}, "url": "http://microservices.io/patterns/observability/exception-tracking.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Exception tracking"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Resulting Context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Exception tracking\n\n[pattern](/tags/pattern) [observability](/tags/observability) [service design](/tags/service design)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\nThe application consists of multiple services and service instances that are running on multiple machines.\nErrors sometimes occur when handling requests.\nWhen an error occurs, a service instance throws an exception, which contains an error message and a stack trace.\n\n## Problem\n\nHow to understand the behavior of an application and troubleshoot problems?\n\n- Exceptions must be de-duplicated, recorded, investigated by developers and the underlying issue resolved\n- Any solution should have minimal runtime overhead\n\n## Solution\n\nReport all exceptions to a centralized exception tracking service that aggregates and tracks exceptions and notifies developers.\n\n## Resulting Context\n\nThis pattern has the following benefits:\n\n- It is easier to view exceptions and track their resolution\n\nThis pattern has the following drawbacks:\n\n- The exception tracking service is additional infrastructure\n\n- [Log aggregation](application-logging.html) - exceptions should be logged as well as reported to a tracking service\n\n---\n\n[pattern](/tags/pattern) [observability](/tags/observability) [service design](/tags/service design)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4578, "slov": 545, "odkazu": 31, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/observability/exception-tracking.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:30", "sha256": "b7cc689a47f92a3e645b0d13ba2db49a5759455adb32bc7377ab1dee91c92e57", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/observability/health-check-api.html", "titulek": "Pattern: Health Check API", "h1": "Pattern: Health Check API", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Health Check API", "og:url": "http://microservices.io/patterns/observability/health-check-api.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/observability/health-check-api.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Health Check API", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Health Check API"}, "url": "http://microservices.io/patterns/observability/health-check-api.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Health Check API"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting Context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Health Check API\n\n[pattern](/tags/pattern) [observability](/tags/observability) [service design](/tags/service design)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\nSometimes a service instance can be incapable of handling requests yet still be running.\nFor example, it might have ran out of database connections.\nWhen this occurs, the monitoring system should generate a alert.\nAlso, the load balancer or [service registry](../service-registry.html) should not route requests to the failed service instance.\n\n## Problem\n\nHow to detect that a running service instance is unable to handle requests?\n\n## Forces\n\n- An alert should be generated when a service instance fails\n- Requests should be routed to working service instances\n\n## Solution\n\nA service has an health check API endpoint (e.g. HTTP `/health`) that returns the health of the service.\nThe API endpoint handler performs various checks, such as\n\n- the status of the connections to the infrastructure services used by the service instance\n- the status of the host, e.g. disk space\n- application specific logic\n\nA health check client - a monitoring service, [service registry](../service-registry.html) or load balancer - periodically invokes the endpoint to check the health of the service instance.\n\n## Examples\n\nThe [Microservices Example application](https://github.com/cer/microservices-examples) is an example on an application implements a health check API.\nIt is written in Scala and uses Spring Boot and Spring Cloud as the [Microservice chassis](/patterns/microservice-chassis.html).\nThey provide various capabilities including a health check endpoint.\nThe endpoint is implemented by the [Spring Boot Actuator](http://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html) module.\nIt configures a `/health` HTTP endpoint that invokes extensible health check logic.\n\nTo enable a `/health` endpoint, first define actuator as a dependency:\n\n```\ndependencies { compile \"org.springframework.boot:spring-boot-starter-actuator\" \n```\n\nSecond, enable Spring Boot autoconfiguration:\n\n```\n@SpringBootApplication class UserRegistrationConfiguration { \n```\n\nAt this point, your application will have a health check endpoint with default behavior.\n\nYou can customize this behavior by defining one or more Spring beans that implement the `HealthIndicator` interface:\n\n```\nclass UserRegistrationConfiguration { @Bean def discoveryHealthIndicator(discoveryClient : EurekaClient ) : HealthIndicator = new DiscoveryHealthIndicator(discoveryClient) \n```\n\nA `HealthIndicator` must implement a `health()` method, which returns a `Health` value.\n\n## Resulting Context\n\nThis pattern has the following benefits:\n\n- The health check endpoint enables the health of a service instance to be periodically tested\n\nThis pattern has the following drawbacks:\n\n- The health check might not sufficiently comprehensive or the service instance might fail between health checks and so requests might still be routed to a failed service instance\n\n- [Service registry](../service-registry.html) - the service registry invokes the health check endpoint\n\n---\n\n[pattern](/tags/pattern) [observability](/tags/observability) [service design](/tags/service design)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 6465, "slov": 792, "odkazu": 34, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/observability/health-check-api.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:31", "sha256": "0f1c2bab4164e0b4e1534b71a72a6d2229dd09cbbb8f1e2f775f56310d0f9df6", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://github.com/cer/microservices-examples", "http://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/observability/log-deployments-and-changes.html", "titulek": "Pattern: Log deployments and changes", "h1": "Pattern: Log deployments and changes", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Log deployments and changes", "og:url": "http://microservices.io/patterns/observability/log-deployments-and-changes.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/observability/log-deployments-and-changes.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Log deployments and changes", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Log deployments and changes"}, "url": "http://microservices.io/patterns/observability/log-deployments-and-changes.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Log deployments and changes"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting Context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Log deployments and changes\n\n[pattern](/tags/pattern) [observability](/tags/observability)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\n\n## Problem\n\nHow to understand the behavior of an application and troubleshoot problems?\n\n## Forces\n\n- It useful to see when deployments and other changes occur since issues usually occur immediately after a change\n\n## Solution\n\nLog every deployment and every change to the (production) environment.\n\n## Examples\n\nA deployment tool can, for example, publish [a pseudo-metric](application-metrics.html) whenever it deploys a new version of a service.\nThis metric can then be displayed alongside other metrics enabling changes in application behavior to be correlated with deployments.\nSee [Tracking Every Release by Mike Brittain](https://codeascraft.com/2010/12/08/track-every-release/)\n\n[AWS Cloud Trail](https://aws.amazon.com/cloudtrail/) provides logs of AWS API calls.\n\n## Resulting Context\n\nThis pattern has the following benefits:\n\n- Enables deployments and changes to be easily correlated with issues leading to faster resolution.\n\n---\n\n[pattern](/tags/pattern) [observability](/tags/observability)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4438, "slov": 526, "odkazu": 32, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/observability/log-deployments-and-changes.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:32", "sha256": "9b137c45dcd1b98e213eea9d673e7e6fe2fc1793afb17bdf413e79be038dee85", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://codeascraft.com/2010/12/08/track-every-release/", "https://aws.amazon.com/cloudtrail/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/refactoring/anti-corruption-layer.html", "titulek": "Pattern: Anti-corruption layer", "h1": "Pattern: Anti-corruption layer", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Anti-corruption layer", "og:url": "http://microservices.io/patterns/refactoring/anti-corruption-layer.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/refactoring/anti-corruption-layer.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Anti-corruption layer", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Anti-corruption layer"}, "url": "http://microservices.io/patterns/refactoring/anti-corruption-layer.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Anti-corruption layer"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Anti-corruption layer\n\n[pattern](/tags/pattern)\n\n---\n\n## Context\n\n## Problem\n\nHow do you prevent a legacy monolith’s domain model from polluting the domain model of a new service.\n\n## Forces\n\n## Solution\n\nDefine an anti-corruption layer, which translates between the two domain models.\n\n## Examples\n\n## Resulting context\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 3601, "slov": 430, "odkazu": 27, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/refactoring/anti-corruption-layer.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:51", "sha256": "20626fa232fdc4c065ce7be768b287e4534145214f2caf4434d59f0766ecd1f0", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/refactoring/strangler-application.html", "titulek": "Pattern: Strangler application", "h1": "Pattern: Strangler application", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Strangler application", "og:url": "http://microservices.io/patterns/refactoring/strangler-application.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/refactoring/strangler-application.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Strangler application", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Strangler application"}, "url": "http://microservices.io/patterns/refactoring/strangler-application.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Strangler application"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "Learn more"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Strangler application\n\n[pattern](/tags/pattern) [application architecture](/tags/application architecture) [refactoring to microservices](/tags/refactoring to microservices) [microservices adoption](/tags/microservices adoption)\n\n---\n\n## Context\n\n## Problem\n\nHow do you migrate a legacy monolithic application to a microservice architecture?\n\n## Forces\n\n## Solution\n\nModernize an application by incrementally developing a new (strangler) application around the legacy application.\nIn this scenario, the strangler application has a [microservice architecture](/patterns/microservices.html).\n\nThe strangler application consists of two types of services.\nFirst, there are services that implement functionality that previously resided in the monolith.\nSecond, there are services that implement new features.\nThe latter are particularly useful since they demonstrate to the business the value of using microservices.\n\n## Examples\n\n## Resulting context\n\n## Learn more\n\n- [Refactoring example](/refactoring)\n- [Chapter 13 of my book](/book) describes how to refactor a monolith to microservices\n\n---\n\n[pattern](/tags/pattern) [application architecture](/tags/application architecture) [refactoring to microservices](/tags/refactoring to microservices) [microservices adoption](/tags/microservices adoption)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4542, "slov": 520, "odkazu": 32, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/refactoring/strangler-application.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:12:50", "sha256": "e800e708975dfd2c69c6843550f29613c2fade3aae55d1b421141852ad1d22de", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/reliability/circuit-breaker.html", "titulek": "Pattern: Circuit Breaker", "h1": "Pattern: Circuit Breaker", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Circuit Breaker", "og:url": "http://microservices.io/patterns/reliability/circuit-breaker.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/reliability/circuit-breaker.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Circuit Breaker", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Circuit Breaker"}, "url": "http://microservices.io/patterns/reliability/circuit-breaker.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Circuit Breaker"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Example"}, {"uroven": 2, "text": "Resulting Context"}, {"uroven": 2, "text": "See also"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Circuit Breaker\n\n[pattern](/tags/pattern) [service design](/tags/service design) [resilience](/tags/resilience) [inter-service communication](/tags/inter-service communication)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture](../microservices.html).\nServices sometimes collaborate when handling requests.\nWhen one service synchronously invokes another there is always the possibility that the other service is unavailable or is exhibiting such high latency it is essentially unusable.\nPrecious resources such as threads might be consumed in the caller while waiting for the other service to respond.\nThis might lead to resource exhaustion, which would make the calling service unable to handle other requests.\nThe failure of one service can potentially cascade to other services throughout the application.\n\n## Problem\n\nHow to prevent a network or service failure from cascading to other services?\n\n## Forces\n\n## Solution\n\nA service client should invoke a remote service via a proxy that functions in a similar fashion to an electrical circuit breaker.\nWhen the number of consecutive failures crosses a threshold, the circuit breaker trips, and for the duration of a timeout period all attempts to invoke the remote service will fail immediately.\nAfter the timeout expires the circuit breaker allows a limited number of test requests to pass through.\nIf those requests succeed the circuit breaker resumes normal operation.\nOtherwise, if there is a failure the timeout period begins again.\n\n## Example\n\n`RegistrationServiceProxy` from the [Microservices Example application](https://github.com/cer/microservices-examples) is an example of a component, which is written in Scala, that uses a circuit breaker to handle failures when invoking a remote service.\n\n```\n@Component class RegistrationServiceProxy @Autowired()(restTemplate: RestTemplate) extends RegistrationService { @Value(\"${user_registration_url}\") var userRegistrationUrl: String = _ @HystrixCommand(commandProperties=Array(new HystrixProperty(name=\"execution.isolation.thread.timeoutInMilliseconds\", value=\"800\"))) override def registerUser(emailAddress: String, password: String): Either[RegistrationError, String] = { try { val response = restTemplate.postForEntity(userRegistrationUrl, RegistrationBackendRequest(emailAddress, password), classOf[RegistrationBackendResponse]) response.getStatusCode match { case HttpStatus.OK => Right(response.getBody.id) } } catch { case e: HttpClientErrorException if e.getStatusCode == HttpStatus.CONFLICT => Left(DuplicateRegistrationError) } } } \n```\n\nThe `@HystrixCommand` arranges for calls to `registerUser()` to be executed using a circuit breaker.\n\nThe circuit breaker functionality is enabled using the `@EnableCircuitBreaker` annotation on the `UserRegistrationConfiguration` class.\n\n```\n@EnableCircuitBreaker\nclass UserRegistrationConfiguration {\n```\n\n## Resulting Context\n\nThis pattern has the following benefits:\n\n- Services handle the failure of the services that they invoke\n\nThis pattern has the following issues:\n\n- It is challenging to choose timeout values without creating false positives or introducing excessive latency.\n\n- The [Microservice Chassis](../microservice-chassis.html) might implement this pattern\n- An [API Gateway](../apigateway.html) will use this pattern to invoke services\n- A [Server-side discovery](../server-side-discovery.html) router might use this pattern to invoke services\n\n## See also\n\n- [Netflix Hystrix](https://github.com/Netflix/Hystrix) is an example of a library that implements this pattern\n\n---\n\n[pattern](/tags/pattern) [service design](/tags/service design) [resilience](/tags/resilience) [inter-service communication](/tags/inter-service communication)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 6941, "slov": 815, "odkazu": 36, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/reliability/circuit-breaker.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:23", "sha256": "baf57ce1183110ad7195203d764fccbde9069161fb465467e9e80dfd785f2d3f", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://github.com/cer/microservices-examples", "https://github.com/Netflix/Hystrix", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/security/access-token.html", "titulek": "Pattern: Access token", "h1": "Pattern: Access token", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Access token", "og:url": "http://microservices.io/patterns/security/access-token.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/security/access-token.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Access token", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Access token"}, "url": "http://microservices.io/patterns/security/access-token.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Access token"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Example"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Access token\n\n[pattern](/tags/pattern) [security](/tags/security) [service design](/tags/service design)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture](../microservices.html) and [API Gateway](../apigateway.html) patterns.\nThe application consists of numerous services.\nThe API gateway is the single entry point for client requests.\nIt authenticates requests, and forwards them to other services, which might in turn invoke other services.\n\n## Problem\n\nHow to communicate the identity of the requestor to the services that handle the request?\n\n## Forces\n\n- Services often need to verify that a user is authorized to perform an operation\n\n## Solution\n\nThe [API Gateway](../apigateway.html) authenticates the request and passes an access token (e.g. [JSON Web Token](https://jwt.io/)) that securely identifies the requestor in each request to the services.\nA service can include the access token in requests it makes to other services.\n\n## Example\n\nSee [JSON Web Token](https://jwt.io/) for usage examples and supporting libraries.\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- The identity of the requestor is securely passed around the system\n- Services can verify that the requestor is authorized to perform an operation\n\n- The [API Gateway](../apigateway.html) uses this pattern.\n\n---\n\n[pattern](/tags/pattern) [security](/tags/security) [service design](/tags/service design)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4659, "slov": 564, "odkazu": 32, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/security/access-token.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:25", "sha256": "2138728c54a5845e9dc9473faa439a4b3c582d3f95d03950d89978f02584826c", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://jwt.io/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/self-registration.html", "titulek": "Pattern: Self Registration", "h1": "Pattern: Self Registration", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Self Registration", "og:url": "http://microservices.io/patterns/self-registration.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/self-registration.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Self Registration", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Self Registration"}, "url": "http://microservices.io/patterns/self-registration.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Self Registration"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Self Registration\n\n[pattern](/tags/pattern) [inter-service communication](/tags/inter-service communication) [service discovery](/tags/service discovery)\n\n---\n\n## Context\n\nYou have applied either the [Client-side Service Discovery pattern](client-side-discovery.html) or the [Server-side Service Discovery pattern](server-side-discovery.html).\nService instances must be registered with the [service registry](service-registry.html) on startup so that they can be discovered and unregistered on shutdown.\n\n## Problem\n\nHow are service instances registered with and unregistered from the service registry?\n\n## Forces\n\n- Service instances must be registered with the service registry on startup and unregistered on shutdown\n- Service instances that crash must be unregistered from the service registry\n- Service instances that are running but incapable of handling requests must be unregistered from the service registry\n\n## Solution\n\nA service instance is responsible for registering itself with the service registry.\nOn startup the service instance registers itself (host and IP address) with the service registry and makes itself available for discovery.\nThe client must typically periodically renew its registration so that the registry knows it is still alive.\nOn shutdown, the service instance unregisters itself from the service registry.\n\nThis is typically handled by a [Microservice chassis framework](microservice-chassis.html)\n\n## Examples\n\nThe [Microservices Example application](https://github.com/cer/microservices-examples) is an example of an application that uses self-registration.\nIt is written in Scala and uses Spring Boot and Spring Cloud as the [Microservice chassis](microservice-chassis.html).\nThe application uses the [Eureka](https://github.com/Netflix/eureka/wiki/Eureka-at-a-glance) [Service Registry](service-registry.html), which is a [Netflix OSS](http://netflix.github.io/) component.\n\nService registration is configured using the `@EnableEurekaClient` on a Java config class:\n\n```\n@Configuration @EnableEurekaClient class EurekaClientConfiguration { \n```\n\nThis annotation causes the service instance to be registered with Eureka.\n\n## Resulting context\n\nThe benefits of the Self Registration pattern include the following:\n\n- A service instance knows its own state so can implement a state model that’s more complex than UP/DOWN, e.g. STARTING, AVAILABLE, …\n\nThere are also some drawbacks:\n\n- Couples the service to the Service Registry\n- You must implement service registration logic in each programming language/framework that you use to write your services, e.g. NodeJS/JavaScript, Java/Scala, etc.\n- A service instance that is running yet unable to handle requests will often lack the self-awareness to unregister itself from the service registry\n\n- [Service Registry](service-registry.html) - an essential part of service discovery\n- [Client Side Discovery](client-side-discovery.html) - one way that a service instance is discovered\n- [Server Side Discovery](server-side-discovery.html) - another way a service instance is discovered\n- [Microservice chassis](microservice-chassis.html) - self registration is the responsibility the microservice chassis framework\n- [3rd Party Registration](3rd-party-registration.html) is an alternative solution\n\n---\n\n[pattern](/tags/pattern) [inter-service communication](/tags/inter-service communication) [service discovery](/tags/service discovery)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 6633, "slov": 805, "odkazu": 37, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/self-registration.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:21", "sha256": "3f14062b7082998e03559d70c59f6c0a79d51147f8b3a3beb2b98aeb1c5b2065", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://github.com/cer/microservices-examples", "https://github.com/Netflix/eureka/wiki/Eureka-at-a-glance", "http://netflix.github.io/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/server-side-discovery.html", "titulek": "Pattern: Server-side service discovery", "h1": "Pattern: Server-side service discovery", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Server-side service discovery", "og:url": "http://microservices.io/patterns/server-side-discovery.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/server-side-discovery.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Server-side service discovery", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Server-side service discovery"}, "url": "http://microservices.io/patterns/server-side-discovery.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Server-side service discovery"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Server-side service discovery\n\n[pattern](/tags/pattern) [inter-service communication](/tags/inter-service communication) [service discovery](/tags/service discovery)\n\n---\n\n## Context\n\nServices typically need to call one another.\nIn a monolithic application, services invoke one another through language-level method or procedure calls.\nIn a traditional distributed system deployment, services run at fixed, well known locations (hosts and ports) and so can easily call one another using HTTP/REST or some RPC mechanism.\nHowever, a modern [microservice-based](microservices.html) application typically runs in a virtualized or containerized environments where the number of instances of a service and their locations changes dynamically.\n\nConsequently, you must implement a mechanism for that enables the clients of service to make requests to a dynamically changing set of ephemeral service instances.\n\n## Problem\n\nHow does the client of a service - the API gateway or another service - discover the location of a service instance?\n\n## Forces\n\n- Each instance of a service exposes a remote API such as HTTP/REST, or Thrift etc. at a particular location (host and port)\n- The number of services instances and their locations changes dynamically.\n- Virtual machines and containers are usually assigned dynamic IP addresses.\n- The number of services instances might vary dynamically. For example, an EC2 Autoscaling Group adjusts the number of instances based on load.\n\n## Solution\n\nWhen making a request to a service, the client makes a request via a router (a.k.a load balancer) that runs at a well known location.\nThe router queries a [service registry](service-registry.html), which might be built into the router, and forwards the request to an available service instance.\n\nThe following diagram shows the structure of this pattern.\n\n## Examples\n\nAn AWS Elastic Load Balancer (ELB) is an example of a server-side discovery router.\nA client makes HTTP(s) requests (or opens TCP connections) to the ELB, which load balances the traffic amongst a set of EC2 instances.\nAn ELB can load balance either external traffic from the Internet or, when deployed in a VPC, load balance internal traffic.\nAn ELB also functions as a [Service Registry](service-registry.html).\nEC2 instances are registered with the ELB either explicitly via an API call or automatically as part of an auto-scaling group.\n\nSome clustering solutions such as [Kubernetes](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/services.md) and [Marathon](https://mesosphere.github.io/marathon/docs/service-discovery-load-balancing.html) run a proxy on each host that functions as a server-side discovery router.\nIn order to access a service, a client connects to the local proxy using the port assigned to that service.\nThe proxy then forwards the request to a service instance running somewhere in the cluster.\n\n## Resulting context\n\nServer-side service discovery has a number of benefits:\n\n- Compared to [client-side discovery](client-side-discovery.html) , the client code is simpler since it does not have to deal with discovery. Instead, a client simply makes a request to the router\n- Some cloud environments provide this functionality, e.g. AWS Elastic Load Balancer\n\nIt also has the following drawbacks:\n\n- Unless it’s part of the cloud environment, the router must is another system component that must be installed and configured. It will also need to be replicated for availability and capacity.\n- The router must support the necessary communication protocols (e.g HTTP, gRPC, Thrift, etc) unless it is TCP-based router\n- More network hops are required than when using [Client Side Discovery](client-side-discovery.html)\n\n- A router uses [Service Registry](service-registry.html)\n- A router might use a [Circuit Breaker](reliability/circuit-breaker.html) to invoke services\n- [Client Side Discovery](client-side-discovery.html) is an alternative solution\n\n---\n\n[pattern](/tags/pattern) [inter-service communication](/tags/inter-service communication) [service discovery](/tags/service discovery)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 7307, "slov": 958, "odkazu": 35, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/server-side-discovery.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:20", "sha256": "35e15ea16c0b216c7150af102146e24ed6b1802695db0066a574fc3252a54731", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/services.md", "https://mesosphere.github.io/marathon/docs/service-discovery-load-balancing.html", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/service-registry.html", "titulek": "Pattern: Service registry", "h1": "Pattern: Service registry", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Service registry", "og:url": "http://microservices.io/patterns/service-registry.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/service-registry.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Service registry", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Service registry"}, "url": "http://microservices.io/patterns/service-registry.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Service registry"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Service registry\n\n[pattern](/tags/pattern) [inter-service communication](/tags/inter-service communication) [service discovery](/tags/service discovery)\n\n---\n\n## Context\n\nClients of a service use either [Client-side discovery](client-side-discovery.html) or [Server-side discovery](server-side-discovery.html) to determine the location of a service instance to which to send requests.\n\n## Problem\n\nHow do clients of a service (in the case of [Client-side discovery](client-side-discovery.html)) and/or routers (in the case of [Server-side discovery](server-side-discovery.html)) know about the available instances of a service?\n\n## Forces\n\n- Each instance of a service exposes a remote API such as HTTP/REST, or Thrift etc. at a particular location (host and port)\n- The number of services instances and their locations changes dynamically. Virtual machines and containers are usually assigned a dynamic IP address. An EC2 Autoscaling Group, for example, adjusts the number of instances based on load.\n\n## Solution\n\nImplement a service registry, which is a database of services, their instances and their locations.\nService instances are registered with the service registry on startup and deregistered on shutdown.\nClient of the service and/or routers query the service registry to find the available instances of a service.\nA service registry might invoke a service instance’s [health check API](observability/health-check-api.html) to verify that it is able to handle requests\n\n## Examples\n\nThe [Microservices Example application](https://github.com/cer/microservices-examples) is an example of an application that uses client-side service discovery.\nIt is written in Scala and uses Spring Boot and Spring Cloud as the [Microservice chassis](microservice-chassis.html).\nThey provide various capabilities including a [Netflix Eureka](https://github.com/Netflix/eureka/wiki/Eureka-at-a-glance) service registry.\n\nThe Eureka Server is a small Spring Boot application:\n\n```\n@SpringBootApplication @EnableEurekaServer public class EurekaServer { public static void main(String[] args) { new SpringApplicationBuilder(EurekaServer.class).web(true).run(args); } } \n```\n\nIt is deployed using Docker:\n\n```\neureka: image: java:openjdk-8u91-jdk working_dir: /app volumes: - ./eureka-server/build/libs:/app command: java -jar /app/eureka-server.jar --server.port=8761 ports: - \"8761:8761\" \n```\n\nOther examples of service registries (or technologies that are commonly used as service registries) include:\n\n- [Apache Zookeeper](http://zookeeper.apache.org)\n- [Consul](https://consul.io/)\n- [Etcd](https://github.com/coreos/etcd)\n\nSome systems such as Kubernetes, Marathon and AWS ELB have an implicit service registry.\n\n## Resulting context\n\nThe benefits of the Service Registry pattern include:\n\n- Client of the service and/or routers can discover the location of service instances.\n\nThere are also some drawbacks:\n\n- Unless the service registry is built in to the infrastructure, it is yet another infrastructure component that must be setup, configured and managed.\nMoreover, the service registry is a critical system component.\nAlthough clients should cache data provided by the service registry, if the service registry fails that data will eventually become out of date.\nConsequently, the service registry must be highly available.\n\nYou need to decide how service instances are registered with the service registry.\nThere are two options:\n\n- [Self registration pattern](self-registration.html) - service instances register themselves.\n- [3rd party registration pattern](3rd-party-registration.html) - a 3rd party registers the service instances with the service registry.\n\nThe clients of the service registry need to know the location(s) of the service registry instances.\nService registry instances must be deployed on fixed and well known IP addresses.\nClients are configured with those IP addresses.\n\nFor example, [Netflix Eureka](https://github.com/Netflix/eureka/wiki/Configuring-Eureka-in-AWS-Cloud) service instances are typically deployed using elastic IP addresses.\nThe available pool of Elastic IP addresses is configured using either a properties file or via DNS.\nWhen a Eureka instance starts up it consults the configuration to determine which available Elastic IP address to use.\nA Eureka client is also configured with the pool of Elastic IP addresses.\n\n- [Client-side discovery](client-side-discovery.html) and [Server-side discovery](server-side-discovery.html) create the need for a service registry\n- [Self registration](self-registration.html) and [3rd party registration](3rd-party-registration.html) are two different ways that service instances can be registered with the service registry\n- [Health Check API](observability/health-check-api.html) - the service registry invokes a service instance’s health check API to verify that it is able to handle requests\n\n---\n\n[pattern](/tags/pattern) [inter-service communication](/tags/inter-service communication) [service discovery](/tags/service discovery)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 8216, "slov": 1031, "odkazu": 41, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/service-registry.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:21", "sha256": "b5a5ff622607d4c50d518069cdbdfc3d04c7625f969d0f0f52e85a007413eb59", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://github.com/cer/microservices-examples", "https://github.com/Netflix/eureka/wiki/Eureka-at-a-glance", "http://zookeeper.apache.org/", "https://consul.io/", "https://github.com/coreos/etcd", "https://github.com/Netflix/eureka/wiki/Configuring-Eureka-in-AWS-Cloud", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/service-template.html", "titulek": "Pattern: Service Template", "h1": "Pattern: Service Template", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Service Template", "og:url": "http://microservices.io/patterns/service-template.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/service-template.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Service Template", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Service Template"}, "url": "http://microservices.io/patterns/service-template.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Service Template"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Want to learn more about this pattern?"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "See also"}, {"uroven": 2, "text": "Learn more"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Service Template\n\n[pattern](/tags/pattern) [service design](/tags/service design) [service template](/tags/service template)\n\n---\n\n## Context\n\n## Want to learn more about this pattern?\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\nWhen you start the development of an application you often spend a significant amount of time writing the build logic and putting in place the mechanisms to handle cross-cutting concerns.\nThe build logic builds, and tests the application and also packages into a production-ready format, such as a Docker container image.\nFor example, the majority of the build logic for a Java application is implemented using Gradle or Maven.\nIt might also consist of configuration scripts for build automation tool, such as CircleCI or Github Actions.\nOn the surface, the build logic appears to be quite simple.\nHowever, even defining a carefully curated set of dependencies can be remarkably challenging.\n\nIn addition to the build logic, you need to handle cross cutting concerns.\nExamples of cross-cutting concerns include:\n\n- Security - for example, REST APIs must be secured by requiring an [Access Token](/security/access-token.html)\n- [Externalized configuration](/patterns/externalized-configuration.html) - includes credentials, and network locations of external services such as databases and message brokers\n- [Logging](/patterns/observability/application-logging.html) - configuring of a logging framework such as log4j or logback\n- [Health check](/patterns/observability/health-check-api.html) - a url that a monitoring service can “ping” to determine the health of the application\n- [Metrics](/patterns/observability/application-metrics.html) - measurements that provide insight into what the application is doing and how it is performing\n- [Distributed tracing](/patterns/observability/distributed-tracing.html) - instrument services with code that assigns each external request an unique identifier that is passed between services.\n\nAs well as these generic cross-cutting concerns, there are also cross-cutting concerns that are specific to the technologies that an application uses.\nApplications that use infrastructure services such as databases or a message brokers require boilerplate configuration in order to do that.\nFor example, applications that use a relational database must be configured with a connection pool.\nWeb applications that process HTTP requests also need boilerplate configuration.\n\nIt is common to spend one or two days, sometimes even longer, writing the build logic and implementing cross-cutting concerns.\nIf you going to spend months or years developing a monolithic application then the upfront investment is insignificant.\nThe situation is very different, however, if you are developing an application that has the [microservice architecture](microservices.html).\nThere are tens or hundreds of services.\nYou will frequently create new services, each of which will only take days or weeks to develop.\nYou cannot afford to spend a few days setting up every service.\nWhat is even worse is that in a microservice architecture there are additional cross-cutting concerns that you have to deal with including service registration and discovery, and circuit breakers for reliably handling partial failure.\n\n## Problem\n\nHow can a team quickly create and setup a maintainable code base for a production-ready service so they can start developing its business logic?\n\n## Forces\n\n- A service must implement\n - Build logic that builds, and tests the application and also packages into a production-ready format, such as a Docker container image.\n - Cross-cutting concerns such as externalized configuration, logging, health checks, metrics, service registration and discovery, circuit breakers. There are also cross-cutting concerns that are specific to the technologies that the microservices uses.\n- Creating a new microservice should be fast and easy\n- It should be fast and straightforward to update existing services when the requirements for build logic and cross-cutting concerns change.\n\n## Solution\n\nCreate a source code template that a developer can copy in order to quickly start developing a new service.\nA template is a simple runnable service that implements the required build logic and cross cutting concerns along with sample application logic.\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- a developer can quickly and easily start developing a new microservice.\n- it ensures that cross-cutting concerns are implemented in a standardized consistent way\n- it encourages developers to ‘do the right thing’\n\nThis pattern has the following drawbacks:\n\n- it’s a form of copy/paste programming.\nWhen you change the service template due to changing requirements, you must update existing services individually.\nCreating service repositories by forking the service template repository can minimize the work by leveraging Git.\nHowever, there’s a risk that services created at different points in time will diverge.\n\nThis pattern has the following issues:\n\n- you need a service template for each programming language/framework that you want to use.\nThis can be an obstacle to adopting a new programming language or framework.\n\n- [Microservice Chassis](microservice-chassis.html) - it’s either an alternative to the service template pattern; or, perhaps more likely, the service template uses a Microservice Chassis and simply contains the code and configuration that doesn’t belong in the chassis.\n\n## See also\n\n- This excellent [Service Template blog post](https://blog.thepete.net/blog/2020/09/25/service-templates-service-chassis/) by [@ph1](https://twitter.com/ph1)\n\n## Learn more\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n---\n\n[pattern](/tags/pattern) [service design](/tags/service design) [service template](/tags/service template)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 9300, "slov": 1224, "odkazu": 39, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/service-template.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:13", "sha256": "493284ea9e35070943766bbdaa0af15aafc5e0ac8014d143b4a0d10656efc9bf", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://blog.thepete.net/blog/2020/09/25/service-templates-service-chassis/", "https://twitter.com/ph1", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/testing/consumer-side-contract-test.html", "titulek": "Pattern: Consumer-side contract test", "h1": "Pattern: Consumer-side contract test", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Consumer-side contract test", "og:url": "http://microservices.io/patterns/testing/consumer-side-contract-test.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/testing/consumer-side-contract-test.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Consumer-side contract test", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Consumer-side contract test"}, "url": "http://microservices.io/patterns/testing/consumer-side-contract-test.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Consumer-side contract test"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Consumer-side contract test\n\n[pattern](/tags/pattern)\n\n---\n\nVerify that the client of a service can communicate with the service.\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 3429, "slov": 406, "odkazu": 27, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/testing/consumer-side-contract-test.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 22:07:54", "sha256": "b9ef5d5a9b8f0d852eb421ef97d94d7609e542d2ccd6f0a96406ba724f918e3d", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/testing/service-component-test.html", "titulek": "Pattern: Service Component Test", "h1": "Pattern: Service Component Test", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Service Component Test", "og:url": "http://microservices.io/patterns/testing/service-component-test.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/testing/service-component-test.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Service Component Test", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Service Component Test"}, "url": "http://microservices.io/patterns/testing/service-component-test.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Service Component Test"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "See also"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Service Component Test\n\n[pattern](/tags/pattern)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture](../Microservices.html) pattern.\nThe application consists of numerous services.\nServices often invoke other services.\nYou must write automated tests that verify that a service behaves correctly.\n\n## Problem\n\nHow do you easily test a service?\n\n## Forces\n\n- End to end testing (i.e. tests that launch multiple services) is difficult, slow, brittle, and expensive.\n\n## Solution\n\nA test suite that tests a service in isolation using test doubles for any services that it invokes.\n\n## Examples\n\n[Spring Cloud Contract](https://cloud.spring.io/spring-cloud-contract/) is an open source project that supports this style of testing.\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- Testing a service in isolation is easier, faster, more reliable and cheap\n\nThis pattern has the following drawbacks:\n\n- Tests might pass but the application will fail in production\n\nThis pattern has the following issues:\n\n- How to ensure that the test doubles always correctly emulate the behavior of the invoked services?\n\n- See [Service Integration Contract Test](service-integration-contract-test.html)\n\n## See also\n\n- See [Component Testing](http://martinfowler.com/articles/microservice-testing/#testing-component-introduction)\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4600, "slov": 560, "odkazu": 31, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/testing/service-component-test.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:04", "sha256": "b9da1c2ef3a0068f8961f8334fa80920264fc38ee36766dca8608ee286f6cdb8", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://cloud.spring.io/spring-cloud-contract/", "http://martinfowler.com/articles/microservice-testing/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/testing/service-integration-contract-test.html", "titulek": "Pattern: Service Integration Contract Test", "h1": "Pattern: Service Integration Contract Test", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Service Integration Contract Test", "og:url": "http://microservices.io/patterns/testing/service-integration-contract-test.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/testing/service-integration-contract-test.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Service Integration Contract Test", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Service Integration Contract Test"}, "url": "http://microservices.io/patterns/testing/service-integration-contract-test.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Service Integration Contract Test"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 2, "text": "Examples"}, {"uroven": 2, "text": "Resulting context"}, {"uroven": 2, "text": "See also"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Service Integration Contract Test\n\n[pattern](/tags/pattern)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture](../Microservices.html) pattern.\nThe application consists of numerous services.\nServices often invoke other services.\nYou must write automated tests that verify that a service behaves correctly.\n\n## Problem\n\nHow to easily test that a service provides an API that its clients expect?\n\n## Forces\n\n- End to end testing (i.e. tests that launch multiple services) is difficult, slow, brittle, and expensive.\n\n## Solution\n\nA test suite for a service that is written by the developers of another service that consumes it.\nThe test suite verifies that the service meets the consuming service’s expectations.\n\n## Examples\n\n[Spring Cloud Contract](https://cloud.spring.io/spring-cloud-contract/) is an open source project that supports this style of testing.\n\n## Resulting context\n\nThis pattern has the following benefits:\n\n- Testing a service in isolation is easier, faster, more reliable and cheap\n\nThis pattern has the following drawbacks:\n\n- Tests might pass but the application will fail in production\n\nThis pattern has the following issues:\n\n- How to ensure that the consumer provided tests match what the consumer actually requires?\n\n- See [Service Component Test](service-component-test.html)\n\n## See also\n\n- See [Integration Contract Test](http://martinfowler.com/articles/microservice-testing/#testing-contract-introduction)\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4711, "slov": 577, "odkazu": 31, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/testing/service-integration-contract-test.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:03", "sha256": "007fc54c0e9ab39ba1877df66c56b1f2945f7e97c8c30f42f5feb529e5ab7322", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://cloud.spring.io/spring-cloud-contract/", "http://martinfowler.com/articles/microservice-testing/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/ui/client-side-ui-composition.html", "titulek": "Pattern: Client-side UI composition", "h1": "Pattern: Client-side UI composition", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Client-side UI composition", "og:url": "http://microservices.io/patterns/ui/client-side-ui-composition.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/ui/client-side-ui-composition.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Client-side UI composition", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Client-side UI composition"}, "url": "http://microservices.io/patterns/ui/client-side-ui-composition.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Client-side UI composition"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Client-side UI composition\n\n[pattern](/tags/pattern)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\nServices are developed by [business capability](../decomposition/decompose-by-business-capability.html)/[subdomain](../decomposition/decompose-by-subdomain.html)-oriented teams that are also responsible for the user experience.\nSome UI screens/pages display data from multiple service.\nConsider, for example, an Amazon-style product detail page, which displays numerous data items including:\n\n- Basic information about the book such as title, author, price, etc.\n- Your purchase history for the book\n- Availability\n- Buying options\n- Other items that are frequently bought with this book\n- Other items bought by customers who bought this book\n- Customer reviews\n- Sellers ranking\n- …\n\nEach data item corresponds to a separate service and how it is displayed is, therefore, the responsibility of a different team.\n\n## Problem\n\nHow to implement a UI screen or page that displays data from multiple services?\n\n## Forces\n\n## Solution\n\nEach team develops a client-side UI component, such an AngularJS directive, that implements the region of the page/screen for their service.\nA UI team is responsible implementing the page skeletons that build pages/screens by composing multiple, service-specific UI components.\n\n- The [Server-side page fragment composition](server-side-page-fragment-composition.html) pattern is an alternative approach\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4759, "slov": 583, "odkazu": 31, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/ui/client-side-ui-composition.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:34", "sha256": "8a9e0ace6388dfa9ad2be3cf55226ef00289ab0c33241137fc9b587b5ace9ad3", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]} {"url": "https://microservices.io/patterns/ui/server-side-page-fragment-composition.html", "titulek": "Pattern: Server-side page fragment composition", "h1": "Pattern: Server-side page fragment composition", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {"og:type": "website", "og:site_name": "microservices.io", "og:title": "Microservices Pattern: Pattern: Server-side page fragment composition", "og:url": "http://microservices.io/patterns/ui/server-side-page-fragment-composition.html"}, "jsonld": [{"@context": "http://schema.org", "@id": "http://microservices.io#website", "url": "http://microservices.io", "@type": "WebSite", "name": "Microservices.io", "alternateName": "Microservice Architecture", "about": {"@type": "Intangible", "name": "Microservices", "alternateName": "Microservice Architecture", "sameAs": ["http://dbpedia.org/resource/Microservices", "https://www.wikidata.org/wiki/Q18344624", "https://en.wikipedia.org/wiki/Microservices"]}, "publisher": {"@type": "Person", "@id": "http://www.chrisrichardson.net#chris", "name": "Chris Richardson", "image": "https://gravatar.com/avatar/a290a8643359e2495e1c6312e662012f", "sameAs": ["https://twitter.com/crichardson", "http://www.slideshare.net/chris.e.richardson", "http://www.linkedin.com/in/pojos/", "https://github.com/cer"], "description": "Chris Richardson is an experienced software architect, author of POJOs in Action and the creator of the original CloudFoundry.com. His latest startup is eventuate.io, a microservices application platform. Chris offers a comprehensive set of resources for learning about microservices including articles, an O'Reilly training video, and example code. Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "worksFor": {"@type": "Organization", "name": "eventuate.io", "logo": {"@type": "ImageObject", "url": "http://eventuate.io/i/logo.gif", "height": "33", "width": "92", "name": "eventuate.io logo"}, "url": "http://eventuate.io/"}, "jobTitle": "Founder", "affiliation": {"@type": "Organization", "name": "CloudFoundry.com", "alternateName": "CloudFoundry", "url": "http://CloudFoundry.com"}}, "copyrightYear": "2017", "offers": {"@type": "Offer", "itemOffered": {"@type": "Service", "name": "Microservices consulting and training", "description": "Chris offers a comprehensive consulting services, workshops and hands on training classes to help you use microservices effectively.", "url": "http://www.chrisrichardson.net/microserviceslanding.html"}}}, {"@context": "http://schema.org", "@type": "WebPage", "@id": "http://microservices.io/patterns/ui/server-side-page-fragment-composition.html#webpage", "isPartOf": {"@id": "http://microservices.io#website"}, "headline": "Pattern: Server-side page fragment composition", "description": "A pattern language for microservices", "mainEntity": {"@type": "Intangible", "name": "Pattern: Pattern: Server-side page fragment composition"}, "url": "http://microservices.io/patterns/ui/server-side-page-fragment-composition.html"}], "drobecky": [], "osnova": [{"uroven": 4, "text": "Microservice Architecture"}, {"uroven": 1, "text": "Pattern: Server-side page fragment composition"}, {"uroven": 2, "text": "Context"}, {"uroven": 2, "text": "Problem"}, {"uroven": 2, "text": "Forces"}, {"uroven": 2, "text": "Solution"}, {"uroven": 4, "text": "About Microservices.io"}, {"uroven": 4, "text": "Need help modernizing your architecture?"}, {"uroven": 4, "text": "Microservices Patterns, 2nd edition"}, {"uroven": 4, "text": "ASK CHRIS"}, {"uroven": 4, "text": "LEARN about microservices"}, {"uroven": 4, "text": "Get the book: Microservices Patterns"}, {"uroven": 4, "text": "Example microservices applications"}, {"uroven": 4, "text": "Virtual bootcamp: Distributed data patterns in a microservice architecture"}, {"uroven": 4, "text": "Learn how to create a service template and microservice chassis"}, {"uroven": 4, "text": "BUILD microservices"}, {"uroven": 4, "text": "Consulting services"}, {"uroven": 4, "text": "The Eventuate platform"}], "markdown": "#### [Microservice Architecture](/index.html)\n\n**Supported by [Kong](https://konghq.com/)**\n\n# Pattern: Server-side page fragment composition\n\n[pattern](/tags/pattern)\n\n---\n\n## Context\n\nYou have applied the [Microservice architecture pattern](../microservices.html).\nServices are developed by [business capability](../decomposition/decompose-by-business-capability.html)/[subdomain](../decomposition/decompose-by-subdomain.html)-oriented teams that are also responsible for the user experience.\nSome UI screens/pages display data from multiple service.\nConsider, for example, an Amazon-style product detail page, which displays numerous data items including:\n\n- Basic information about the book such as title, author, price, etc.\n- Your purchase history for the book\n- Availability\n- Buying options\n- Other items that are frequently bought with this book\n- Other items bought by customers who bought this book\n- Customer reviews\n- Sellers ranking\n- …\n\nEach data item corresponds to a separate service and how it is displayed is, therefore, the responsibility of a different team.\n\n## Problem\n\nHow to implement a UI screen or page that displays data from multiple services?\n\n## Forces\n\n## Solution\n\nEach team developers a web application that generates the HTML fragment that implements the region of the page for their service.\nA UI team is responsible for developing the page templates that build pages by performing server-side aggregation (e.g. server-side include style mechanism) of the service-specific HTML fragments.\n\n- The [Client-side UI composition](client-side-ui-composition.html) pattern is an alternative approach\n\n---\n\n[pattern](/tags/pattern)\n\n---\n\n---\n\n[Modernization Help](https://chrisrichardson.net/)\n\nCopyright © 2026 Chris Richardson • All rights reserved • Supported by [Kong](https://konghq.com/) .\n\n#### About Microservices.io\n\nMicroservices.io is created by [Chris Richardson](/about.html), software architect, creator of the original CloudFoundry.com, and author of *Microservices Patterns*. Chris helps organizations modernize their architecture to enable fast flow and GenAI-powered software delivery.\n\n#### Need help modernizing your architecture?\n\nAvoid the trap of creating a modern legacy system — a new architecture with the same old problems.\n\n Contact me to discuss your modernization goals.\n\n[Get Help](https://www.linkedin.com/in/pojos/)\n\n#### Microservices Patterns, 2nd edition\n\nI am very excited to announce that the MEAP for the second edition of my book, Microservices Patterns is now available!\n\n[Learn more](/post/architecture/2025/06/26/announcing-meap-microservices-patterns-2nd-edition.html)\n\n#### ASK CHRIS\n\n?\n\nGot a question about microservices?\n\nFill in [this form](https://forms.gle/ppYDAF1JxHGec8Kn9). If I can, I'll write a blog post that answers your question.\n\n#### LEARN about microservices\n\nChris offers numerous other resources for learning the microservice architecture.\n\n#### Get the book: Microservices Patterns\n\nRead Chris Richardson's book:\n\n---\n\n#### Example microservices applications\n\nWant to see an example? Check out Chris Richardson's example applications.\n [See code](http://eventuate.io/exampleapps.html)\n\n#### Virtual bootcamp: Distributed data patterns in a microservice architecture\n\nMy virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!\n\nIt covers the key distributed data management patterns including Saga, API Composition, and CQRS.\n\nIt consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.\n\nThe regular price is $395/person but use coupon OFFEFKCW to sign up for $95 (valid until Sept 30th, 2025).\n There are deeper discounts for buying multiple seats.\n\n[Learn more](https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html)\n\n#### Learn how to create a service template and microservice chassis\n\nTake a look at my [Manning LiveProject](/post/patterns/2022/03/15/service-template-chassis-live-project.html) that teaches you how to develop a service template and microservice chassis.\n\n[Signup for the newsletter](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76)\n\n#### BUILD microservices\n\nReady to start using the microservice architecture?\n\n#### Consulting services\n\n[Engage Chris](http://www.chrisrichardson.net/consulting.html) to create a microservices adoption roadmap and help you define your microservice architecture,\n\n---\n\n#### The Eventuate platform\n\nUse the [Eventuate.io platform](https://eventuate.io) to tackle distributed data management challenges in your microservices architecture.\n\nEventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.\n\n---\n\nJoin the [microservices google group](https://groups.google.com/forum/#!forum/microservices)", "znaku_textu": 4797, "slov": 592, "odkazu": 31, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://microservices.io/patterns/ui/server-side-page-fragment-composition.html", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-13 21:13:33", "sha256": "8b51d617f5dcc71460ff018d7207d1210c668ee8915ef4f7d1ab2002e0d8071c", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://konghq.com/", "https://chrisrichardson.net/", "https://www.linkedin.com/in/pojos/", "https://forms.gle/ppYDAF1JxHGec8Kn9", "https://chrisrichardson.net/consulting.html", "https://chrisrichardson.net/training.html", "https://premium.microservices.io/", "http://chrisrichardson.net/training.html", "https://chrisrichardson.net/consulting-office-hours.html", "http://www.chrisrichardson.net/consulting.html", "http://eventuate.io/exampleapps.html", "https://chrisrichardson.net/virtual-bootcamp-distributed-data-management.html", "http://visitor.r20.constantcontact.com/d.jsp?f=15d9bba9-b33d-491f-b874-73a41bba8a76&llr=ula8akwab&m=1123470377332&p=oi&sit=l6ktajjkb", "https://eventuate.io/", "https://groups.google.com/forum/"]}