261
CHAPTER 6 | Tackle Business Complexity in a Microservice with DDD and CQRS Patterns
Figure 7-21. eShopOnContainers using MongoDB containers for dev-env or Azure Cosmos DB for production
The production Azure Cosmos DB would be running in Azure’s cloud as a PaaS and scalable service.
Your custom .NET containers can run on a local development Docker host (that is using Docker for
Windows in a Windows 10 machine) or be deployed into a production environment, like Kubernetes in
Azure AKS or Azure Service Fabric. In this second environment, you would deploy only the .NET
custom
containers but not the MongoDB container since you’d be using Azure Cosmos DB in the
cloud for handling the data in production.
A clear benefit of using the MongoDB API is that your solution could run in both database engines,
MongoDB or Azure Cosmos DB, so migrations to different environments should be easy. However,
sometimes it is worthwhile to use a native API (that is the native Cosmos DB API) in order to take full
advantage of the capabilities of a specific database engine.
For further comparison between simply using MongoDB versus Cosmos DB in the cloud, see the
Benefits of using Azure Cosmos DB in this page
.
Dostları ilə paylaş: