Cluster State Synchronization Using Event Snapshots and Compacted Keys
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In large-scale multi-tenant Software as a Service (SaaS) enterprises, maintaining consistency of state across multiple nodes in a cluster is complex and resource-intensive, leading to performance degradation and data inconsistencies due to continuous polling, which can cause incorrect computations or decisions based on out-of-date information.
Innovation Solution
Implementing a state synchronization system using an event bus, compacted key/tuple representations, and snapshot-based state restoration, where nodes publish state changes as CREATE, UPDATE, and DELETE operations, and destination nodes compact these operations into a compacted key/tuple representation, with periodic multi-entry snapshots and heartbeats to facilitate rapid state restoration.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If continuous polling is used to maintain state consistency across cluster nodes, then state synchronization is achieved, but system resource consumption increases and performance degrades
Solution Approach 1:
The system replaces continuous polling with periodic snapshots and event-driven updates. Nodes take periodic snapshots of their state and only poll for updates when changes are detected via event bus notifications, significantly reducing resource consumption while maintaining consistency.
Solution Approach 2:
Nodes autonomously detect state changes through event bus subscriptions and automatically synchronize their local state without requiring continuous external polling. The system self-regulates by only initiating synchronization when actual changes occur.
2Reliability
If continuous polling is used to maintain state consistency, then state synchronization is achieved, but data inconsistencies occur due to out-of-date information
Solution Approach 1:
The event bus provides real-time feedback to nodes about state changes in the database. When changes occur, events are immediately published and subscribed nodes receive notifications, ensuring they have up-to-date information without delay.
Solution Approach 2:
Nodes pre-register event subscriptions and set up event listeners in advance. When state changes occur, the event bus immediately pushes notifications to subscribed nodes, eliminating the delay inherent in polling mechanisms.
3Reliability
If detailed state updates are transmitted across the network, then complete state synchronization is achieved, but network bandwidth consumption increases
Solution Approach 1:
The system extracts and transmits only the specific state changes (CREATE, UPDATE, DELETE events) rather than transmitting complete state snapshots. This selective transmission of only necessary information reduces network bandwidth consumption while maintaining synchronization completeness.
Solution Approach 2:
State changes are segmented into discrete event types (CREATE, UPDATE, DELETE) that are transmitted individually. This allows receiving nodes to process only relevant changes and efficiently reconstruct their state without handling unnecessary data.
4Reliability
If nodes frequently synchronize state with the database, then data consistency is maintained, but database load increases
Solution Approach 1:
Nodes autonomously subscribe to database change events via the event bus and only synchronize their state when actual changes occur. This eliminates unnecessary synchronization attempts and reduces database load while maintaining data consistency.
Solution Approach 2:
Instead of frequent periodic synchronization attempts, nodes use event-driven periodic updates where synchronization only occurs when the database state actually changes, reducing overall database interaction frequency and load.
Data Source
AI summary
Disclosed are some implementations of systems, apparatus, methods and computer program products for synchronizing data. A source device processes an update to data in a database. The source device transmits, via a message bus, a first event message pertaining to the update, the first event message having an associated indicator. A target device accessing the message bus detects the indicator. Responsive to detecting the indicator, the target device skips the first event message on the message bus and identifies a snapshot link in a second event message subsequent to the first event message. The target device accesses a snapshot event identified by the snapshot link, stores data of the snapshot event, and processes one or more event messages subsequent to the snapshot event.


