Query Engine Frontend Proxy API for Secure User-Defined Function Execution
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Distributed databases face challenges in achieving security without compromising performance and flexibility, particularly in multiuser environments where user-defined functions can pose security risks by executing code that interferes with security filters or accesses unauthorized data.
Innovation Solution
Implementing a query engine frontend with a proxy API that isolates user programs from the query engine, wrapping user-defined functions into enveloped functions executed in a sandboxed security environment, thereby preventing direct interaction with the query engine and reducing security risks.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If user-defined functions are executed directly in the query engine, then flexibility and performance are improved, but security risks increase due to potential code interference with security filters
Solution Approach 1:
The system segments the execution environment by creating a separate sandboxed domain for user-defined functions, isolating them from the main query engine. This allows flexible execution of user code while preventing security risks through environmental separation.
Solution Approach 2:
A proxy API serves as an intermediary layer between user-defined functions and the query engine. The proxy validates and mediates all interactions, enabling flexible function execution while maintaining security by filtering and controlling access to the query engine.
2Reliability
If security filters are implemented in the query engine, then security is improved, but performance deteriorates due to additional processing overhead
Solution Approach 1:
Security validation and filtering are performed preliminarily at the proxy API layer before code execution. By establishing security controls in advance, the system maintains high security while allowing optimized execution without repeated security checks during runtime.
Solution Approach 2:
The proxy API acts as a mediator that handles security filtering separately from the main query processing path. This allows security checks to be performed efficiently without adding overhead to the critical query execution path.
3Ease of operation
If user programs are installed on the query engine, then ease of operation is improved, but device complexity increases due to integration requirements
Solution Approach 1:
The proxy API serves as an intermediary that provides a simplified interface for users while handling complex integration and isolation requirements in the background. Users interact with the simple proxy interface, while the complex sandboxing and security mechanisms operate transparently.
Solution Approach 2:
The system creates a copied interface (proxy API) that mirrors the original query engine interface. This copying allows users to operate with a simplified view while the underlying complexity of isolation and security management is handled by the proxy layer.
Data Source
AI summary
A distributed database keeps user-defined functions separate from a query engine by using a frontend. The frontend allows a user-defined function to interact with a proxy application processing interface (API) that is based on an API of the query engine. The frontend sends serialized data to the query engine in order to interact with the API of the query engine. The user-defined function is executed in security environments separate from the frontend and the query engine.


