celebrity style jewelry wholesale
1 thought on “celebrity style jewelry wholesale How to use Zeromq and Docker in Python to build a microservice architecture”
Leave a Comment
You must be logged in to post a comment.
celebrity style jewelry wholesale
You must be logged in to post a comment.
agate wholesale gemstone beads for jewelry making What is the micro service?
Mouver service is a architectural style that includes independent processes that communicate with each other. In terms of design, these processes have high scalability, interdependence, and only one smaller task at a time. These services have their own resources and the process of achieving each other through the Internet.
Compared with the single structure of the back end
The traditional client of all server logic -server architecture (C/S architecture), the difference in microservices architecture is reflected in the reflection Follow point separation (of
concern). This design model is more easy to maintain, making it more flexible, scalability and fault tolerance. However, the disadvantage of this distributed architecture is reflected in the unreasonable design, which will make the discharge and the dimension
complicated.
The example of a simple microservices
. Let's analyze such a scene: You are using microservices to build an e -commerce online store.
For a common product in an e -commerce online store, like the iPhone, the details page will show:
. Product and basic information
. Your purchase history
. Who bought the iPhone and bought a mobile phone case
. Discounts and discounts related to Apple mobile phones
. The data of the store
. Delivery method
. Recommended products, etc.,
It the interface of this simple product detail page will have multiple versions to match Web, mobile terminals, and REST APIs for third -party applications.
The data in the micro -service mode is distributed between multiple services. In this example, the service includes:
. Product details service
. Merchant service
. Payment service
. Discount service
. Inventory service
. Price service
. Looking back at
. Recommended service
Mas these independent services have been accessed?
This solution is to use an API network tube, which is a single inlet of all clients and calls specific microservices distributed in the entire infrastructure according to needs. The industry application case of the above model is the Netflix API gateway, which has multiple API clients that support different devices. You can click here to learn more.
In a simple microservices
The many ways can be used to build your microservices.
In this article we will use Zeromq to create communication between two processes. Zeromq provides a built -in block for developing scalable and distributed System on top of the jacking word. It uses the elliptical curve password system (fourth edition) to achieve security and provides a communication mode that is turned on immediately.
About ZMQ, there are many advantages. MQ is a thread -based message queue designed for asynchronous work. Talking about too much zeromq content has exceeded the category of this article. You can read the use of Zeromq and Zeromq for distributed systems.
The other tool we want to use is docker. This article assumes that readers have a basic understanding of Docker.
zeromq has many communication modes. In order to start our work, let's use Zeromq and Flask to configure a simple PUB -SUB. The figure below shows the relationship and data flow between components.
1