databend
databend copied to clipboard
feature: Allow execute databend-query in AWS lambda
Summary
there're some short run tasks like:
- CREATE/ALTER USER
- SHOW USERS/TABLES
- GRANT privileges to user1
- Generate Presign URLs
these tasks may requires the same role of the current tenant, like generating presign URLs, it needs the tenant's role to access the protected s3 prefix.
aws lambda supports:
- running functions in an assumed role, allows protect data among each tenant
- do not cost when no relevant tasks get executed
- built-in mTLS which requires trust between two parties (like the Sharing case)
I dunno whether aws lambda could fit databend-query for the short run tasks scenaries. maybe we could make an experiment about this.
Related Links
https://github.com/awslabs/aws-lambda-rust-runtime
Providing a fn databend_query(sql: &str) -> Result<[u8]> seems really cool (even not for wasm or lambda).
We only need to fill service_fn: https://docs.rs/lambda_runtime/0.6.0/lambda_runtime/fn.service_fn.html