Introduction to the
After the exploration of the previous several articles, the preliminary data synchronization related to all go over, this article will make a summary
conclusion
Relevant mind maps are as follows:
As shown above, data synchronization is divided into two modules:
- The Bootstrap port
- The Admin side
Note that the synchronization modes on both sides must be the same so that data can be synchronized normally
During parsing, you can enable multiple data synchronization modes, but this is not recommended
The recommended synchronization methods are Zookeeper and Websocket, which are incremental data updates
HTTP and Nacos are fully updated
Data synchronization on the Admin side
The data synchronization routines on the Admin end are basically the same, and they are all implemented through event publishing
- Initialization event: Triggers reading of all data from the database for synchronization
- Update events (changes and deletes) : Trigger the appropriate processing
The only trigger entry for the update event is currently Web Controllers, with possible additions to Zookeeper
Note that in HTTP synchronization, the initialization event is triggered when the configuration is started. Update events flush the local cache before sending updates
The Bootstrap port
The basic routines of the Bootstrap end are the same. When the Bootstrap end is initialized or updated, subscribe is sent to each data
Initialization starts with the full amount of data pulled for a local cache refresh
Zookeeper and Websocket are incremental data updates, while HTTP and Nacos are full data updates