In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
The purpose of this article is to share with you about how to manage data in micro-services. The editor thinks it is very practical, so I hope you can learn something after reading this article. Let's take a look at it with the editor.
Randy Shoup, vice president of engineering from the Stitch Fix team, discussed how to manage data and isolate persistence in microservice-based applications at the QCon New York 2017 conference. He also introduced events (Event) as the first type of construction for microservices. He introduced his team to apply machine learning techniques to all parts of the business, such as buying, inventory management, and style recommendations.
Personalized recommendation runs machine learning based on inventory to create a recommendation algorithm. These recommendation algorithms will then be supervised by designers across the country to form personalized style recommendations.
The micro-service architecture is evolving gradually. Organizations like eBay, Twitter, and Amazon have gone through some architectural iterations, moving from monolithic applications to microservices.
In addition to having a single purpose, well-defined interface, modularity, and independence, microservices are also responsible for isolating persistence. Shoup discusses some ways of persistence, such as operating your own data store or using persistence services. In the first approach, the data is stored in its own database instance, which is owned and maintained by the service team. If the persistence service is used, we will store the data in a separate schema in the database, which will be operated and maintained by other teams or third-party vendors in the form of services. The data should be isolated from other consumers of the service.
Events are the first type of construct in the micro-service architecture. They represent how the real world works and ensure that applications meet certain domain requirements, such as finance. Events are an important part of the service interface, and it should contain all events generated by the service and all events consumed by the service.
Extracting micro-services from a single shared database generally involves the following steps:
Create a service: the service boundary should contain the service itself and the database it faces
Applications use services: decouple applications from shared databases by using newly created services
Transfer the data to the private database: then transfer the data from the shared database to the new private database. This will not have any impact on client applications because they are no longer directly dependent on the database
Repetitive operations: follow the same process for other business functions that need to be extracted into independent micro-services in the application.
Shoup also discusses that microservice use cases involve shared data (Shared Data), connections (join), and transactions.
Shared data: the service created is a single system record (System of Record,SoR) and has all its own data. Other copies of the data are read-only and are just non-authoritative caches. To access shared data, we have three options: synchronous lookup (one service invokes another service to get data), asynchronous events with caching, or shared Metabase
Connection: shredding data into separate services makes it difficult to connect. In the field of microservices, we can make data connections in client applications, or create a "materialized view (Materialized Views)" by listening for events of two services, and maintain the connection results of two denormalized datasets in local storage.
Transactions: in a single application, transaction management is very easy, but in a micro-service architecture it is very difficult because the data is split into several different services. We can implement the transaction as a workflow that uses compensation operations in reverse order to form a rollback mechanism. Many real-world systems have adopted this approach, such as payment processing and fee approval systems. These processes are also ideal candidates for adopting function as a service (Serverless architecture).
The above is how to manage data in micro-services, and the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.