Multi-tenant Data Stream Leader Election and Routing

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current data streaming systems face inefficiencies in distributing streaming requests across multiple servers in multi-tenant environments, leading to resource wastage due to events being multiplexed onto aggregate topics, resulting in skipped data when clients request specific tenant data.

Innovation Solution

Implement a system where service instances elect leaders for topic streams, using a consensus protocol to coordinate leader election and manage a mapping table, and leverage load balancers to redirect requests through cookies, ensuring efficient data distribution and caching techniques to improve resource utilization.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Quantity of substance

If events from multiple tenants are multiplexed onto aggregate topics, then the streaming system can handle large volumes of data from thousands of tenants, but clients requesting data from specific tenants must skip or drop a large number of unrelated events, resulting in resource wastage and reduced efficiency

Engineering Contradiction:
Improvedata volumeVSAvoiddata delivery efficiency
Core Design Contradiction:
Quantity of substanceVSProductivity

Solution Approach 1:

The patent segments the aggregate topic stream by creating distinct initial topics and partitions for each tenant. This segmentation allows clients to subscribe to tenant-specific partitions rather than filtering through all events in an aggregate topic, eliminating the need to skip unrelated events while maintaining the ability to handle data from thousands of tenants.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces an intermediary mapping mechanism that maps initial topic partitions to aggregate topics. This intermediary layer enables the system to present a unified aggregate topic interface to clients while internally routing events through tenant-specific initial topics, thus improving data delivery efficiency without losing the multi-tenant aggregation capability.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Adaptability or versatility

If multiple servers are employed to serve aggregate topics, then the system can distribute load across multiple instances, but requests from multiple consumers requiring the same initial topic are spread across multiple servers, causing each server to provide events that are ultimately skipped

Engineering Contradiction:
Improvesystem scalabilityVSAvoidresource utilization
Core Design Contradiction:
Adaptability or versatilityVSLoss of energy

Solution Approach 1:

The patent implements preliminary action by having service instances elect leaders for each initial topic partition before clients connect. This pre-assignment ensures that when clients subscribe to specific tenant data, their requests are directed to the correct server instance that has the relevant data, preventing the waste of resources on servers that would otherwise provide events that need to be skipped.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent employs feedback mechanisms where service instances communicate leadership status and topic partition assignments to each other and to the load balancer. This feedback loop enables dynamic routing of client requests to the appropriate server instances, ensuring that servers process only relevant events for their assigned partitions, thus improving resource utilization while maintaining system scalability.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS11159625B1Efficiently distributing connections to service instances that stream multi-tenant data
Publication Date: 2021.10.26 SALESFORCE INC
  • US11159625B1 patent drawing
  • US11159625B1 patent drawing
  • US11159625B1 patent drawing

AI summary

Described is a system (and method) for efficiently distributing connections to service instances that stream multi-tenant data. The system may efficiently distribute requests to stream data by grouping (or “binning”) requests for a particular topic stream to a service instance that is elected a leader for that topic. The election of the leaders may be coordinated by the service instances themselves. The service instances may initiate the redistribution of the requests to the elected leaders by updating a cookie of a client to identify the service instance determined to be the elected leader of the requested topic stream. This cookie may be respected by a load balancer when directing clients to particular service instances. For example, the load balancer may be configured to implement session persistence (or session stickiness, session affinity, etc.) between the client and service instances based on the cookie.