databend icon indicating copy to clipboard operation
databend copied to clipboard

feature: Allow execute databend-query in AWS lambda

Open flaneur2020 opened this issue 3 years ago • 1 comments

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

flaneur2020 avatar Jul 21 '22 03:07 flaneur2020

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

Xuanwo avatar Jul 21 '22 08:07 Xuanwo