Affinity Group Mapping for Database Request Routing
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In multi-node database systems, maintaining cache coherency and efficiently routing requests across nodes is challenging, leading to performance and scalability issues due to the need for locking and updating mechanisms, and existing approaches either require frequent updates or limit direct access to data across nodes.
Innovation Solution
The database system partitions database objects into affinity groups, assigning each group to a specific node, where the master node handles lock requests, and generates an affinity group mapping to route queries directly to the target node based on the query's affinity group key, allowing nodes to process requests quickly without inter-node locking requests.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If data items are cached in volatile memory of multiple nodes to enable concurrent access, then accessibility and speed are improved, but cache coherency maintenance complexity and inter-node communication overhead increase
Solution Approach 1:
The patent segments the database objects into affinity groups and assigns each group to a specific master node. This segmentation allows nodes to access data without requiring complex inter-node locking mechanisms, as each affinity group has a dedicated owner node that manages access control.
Solution Approach 2:
The patent introduces an affinity group mapping as an intermediary structure that maps affinity groups to their master nodes. This mapping enables direct routing of requests to the appropriate node without requiring nodes to communicate with each other for lock management, thereby reducing inter-node communication overhead.
2Speed
If work is shipped to the node that pre-loaded the object to utilize cached data, then data access speed is improved, but request routing complexity and inter-node communication overhead increase
Solution Approach 1:
The patent performs preliminary action by pre-computing and storing the affinity group mapping that directly associates affinity groups with their master nodes. This pre-established mapping enables clients to directly route requests to the correct node using the affinity group key, eliminating the need for dynamic work shipping and reducing request routing time.
3Device complexity
If database data is divided and stored in separate databases assigned to particular nodes to avoid cache coherency issues, then cache coherency maintenance is simplified, but direct access to data across nodes is limited and request completion time increases
Solution Approach 1:
The patent implements universality by allowing all nodes to access any database object through the affinity group mapping mechanism. While data is physically stored on specific nodes, the mapping system enables any node to efficiently locate and access data from any affinity group by routing requests to the appropriate master node, thus maintaining both simplicity and high productivity.
4Productivity
If database applications are hard-coded to route requests to particular nodes based on data-to-node mappings, then request routing efficiency is improved, but system adaptability and scalability decrease
Solution Approach 1:
The patent implements dynamics by making the affinity group mapping configurable and adaptable. The mapping between affinity groups and master nodes can be dynamically adjusted based on data distribution, access patterns, and system configuration changes. This allows the system to maintain efficient request routing while adapting to changing requirements, thereby achieving both high productivity and system scalability.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
Techniques are described herein for routing queries to particular nodes of a multi-node database system based on the query. A database table is partitioned into a plurality of affinity groups. Each affinity group is assigned a particular node as the master node of the affinity group. A mapping is sent to a query router indicating the master node for each affinity group of the plurality of affinity groups. The query router determines, for a particular query, a target node to which to send the particular query based on the mapping and the particular query.