-
Notifications
You must be signed in to change notification settings - Fork 33
Load Balancing
The Versity Gateway (versitygw) is designed as a stateless service for handling S3-compatible requests. In a stateless system, each request is independent and no persistent session or state is maintained between requests. This means that every request contains all the necessary information for the gateway to process it, without needing to rely on the history or state of previous requests. This includes multipart upload requests. The initiate/upload parts/complete can all be handled on any Versity Gateway instance as long as the instances are all configured with a consistent backend storage system. The part uploads can be handled on multiple Versity Gateway instances simultaneously as well. This allows uploading of large objects to be scaled across any number of Versity Gateway instances up to the limitations of the backend storage system.
A stateless design provides significant benefits when scaling and distributing requests across multiple Versity Gateway instances. Here's how this design enables efficient load balancing:
Since each request is independent, you can scale the number of Versity Gateway instances horizontally by simply adding more gateway instances to handle increased traffic. There’s no need to synchronize state or session information between gateways, as each gateway instance can process any incoming request without needing to know what other instances are doing.
Statelessness allows load balancers (e.g., HAProxy, or hardware load balancers such as F5 and Cisco) to distribute incoming S3 requests across any available Versity Gateway instance. Since no session affinity (also known as "sticky sessions") is required, the load balancer can:
- Distribute requests evenly across available instances.
- Route traffic to the least-loaded instance to optimize performance.
- Dynamically add or remove gateway instances without disrupting ongoing requests.
This leads to more efficient resource usage and better load distribution, ensuring that no single gateway becomes a bottleneck.
A stateless design improves the resilience of the system. If a Versity Gateway instance fails, the load balancer can simply route future requests to another instance without losing any state or data. This ensures high availability and fault tolerance, as the system does not depend on the continuous availability of any specific instance.
In contrast, a stateful system would require complex mechanisms for state synchronization between instances, leading to potential delays or data loss if an instance were to fail.
Because each gateway instance is stateless, you can perform maintenance or upgrades on individual gateways without affecting the overall system. Instances can be updated or replaced one at a time, while others continue handling requests, minimizing downtime and allowing for rolling updates.
The stateless design also allows Versity Gateway to be deployed in diverse environments, including cloud platforms, on-premises data centers, and hybrid setups. It can run behind load balancers or in containerized environments (e.g., Kubernetes), where instances can be dynamically created or terminated based on demand without the need for state synchronization.
Load balancing is critical for distributing traffic across multiple servers to ensure high availability, reliability, and scalability. Different load balancers, such as HAProxy, DNS-based load balancing, and hardware load balancers, offer unique approaches, each with its own strengths and weaknesses. Below will describe a high level of a few options, but may not be complete for all possible situations.
HAProxy is a popular open-source software load balancer capable of distributing TCP and HTTP traffic across multiple backend servers. It is widely used for both small and large-scale systems due to its flexibility, performance, and configurability. Example HAProxy configuration is described in HealthCheck
Pros: Cost-effective, Highly configurable, High performance
Cons: High Complexity, Typically needs to be installed on every S3 client system
DNS-based load balancing relies on the Domain Name System (DNS) to distribute traffic. Multiple IP addresses (corresponding to different servers) are associated with a single domain name, and DNS resolves the request to one of those addresses. The lack of service health check compatibility makes it in appropriate for services needing high availability during partial service outages.
Pros: Global distribution, Simple setup, No single point of failure
Cons: High DNS TTL lag, No advanced traffic management, Limited load balancing algorithms with no service health awareness, Caching issues
Hardware load balancers are dedicated physical devices that sit between the clients and the servers, handling all the incoming traffic and distributing it across the backend servers. Since all traffic must go through the load balancer, there must be consideration for peak performance requirements and capabilities of the load balancer.
Pros: High performance, Advanced traffic management, Built-in redundancy, Security features
Cons: Cost, Limited scalability, Vendor lock-in, Physical maintenance
- Home
- User:
- Quickstart
- System Requirements
- Install
- Workflow
- Global Options
- TLS
- HA/Load Balancing
- Event Notifications
- Docker
- PreSignedURL
- Multi-Tenant/IAM
- Example Client Configs
- Metrics
- Admin APIs
- Backends:
- Logging:
- Developer:
- Articles: