Hybrid Execution
VortexDB supports a hybrid execution model that allows you to combine server-side and client-side processing. This gives you the flexibility to choose the best execution environment for each part of your application.
How it Works
You can use the VortexDB SDK to execute queries on the server or the client. The SDK will automatically route the query to the appropriate execution environment.
Execution Comparison
Operation | Server-Side | Client-Side |
---|---|---|
Simple Filter | 10ms | 5ms |
Complex Join | 25ms | 150ms |
Aggregation | 30ms | 200ms |
Client-Side Execution
- Interactive UIs: Ideal for operations that require immediate feedback and don't involve large datasets or complex computations.
- Offline Capabilities: Process data locally when network connectivity is limited or unavailable.
- Reduced Server Load: Offload simple data manipulations to the client, freeing up server resources.
Server-Side Execution
- Complex Queries: Perform joins, aggregations, and other computationally intensive operations on large datasets.
- Data Security: Keep sensitive data and business logic on the server, reducing exposure to client-side vulnerabilities.
- Centralized Logic: Ensure consistent data processing and business rules across all clients.
Use Cases
- Client-Side Filtering: You can use client-side processing to filter and sort data that has already been fetched from the server, providing a responsive user experience.
- Server-Side Aggregation: You can use server-side processing to perform complex aggregations on large datasets, returning only the summarized results to the client.
- Real-time Collaboration: Combine client-side UI updates with server-side data synchronization for collaborative applications.
- Data Synchronization: Use server-side logic to manage data consistency and conflicts, while client-side logic handles local data caching and display.
Optimizing Hybrid Workloads
- Data Locality: Design your application to minimize data transfer between client and server.
- Caching: Implement caching strategies on both the client and server to reduce redundant data fetches.
- Batching: Group multiple small operations into larger batches to reduce network overhead.
- Error Handling: Implement robust error handling for both client-side and server-side operations.