https://github.com/axnjr/authlambda
Serverless AWS Lambda function to handle Authentication & Rate limit for Spark my SAAS, written in Rust.
https://github.com/axnjr/authlambda
api authentication authorization aws aws-lambda background-jobs background-service cargo-lambda db rate-limit rate-limiter rust rust-lang rust-on-aws serverless
Last synced: about 1 month ago
JSON representation
Serverless AWS Lambda function to handle Authentication & Rate limit for Spark my SAAS, written in Rust.
- Host: GitHub
- URL: https://github.com/axnjr/authlambda
- Owner: Axnjr
- Created: 2024-03-05T04:01:17.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-07T14:34:12.000Z (about 1 year ago)
- Last Synced: 2025-02-15T22:34:41.232Z (3 months ago)
- Topics: api, authentication, authorization, aws, aws-lambda, background-jobs, background-service, cargo-lambda, db, rate-limit, rate-limiter, rust, rust-lang, rust-on-aws, serverless
- Language: Rust
- Homepage:
- Size: 21.5 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### A Lambda function to authenticate and rate limit the incomming user request's according to their respective subscriptions in the background without increasing the overall latency for my new Real time SAAS Spark.
### Spark will have 3 plans viz:- Hobby (Free): 100 Daily Requests
- Priority: 5000 Daily Requests
- Enterprize: Infinite Daily Requests ( Not planned lmao 😅 )### However after running a few benchmark tests I was disappointed. Rust lambda's are not that fast & efficient.
### Processing Each request took around **2s** each that's indeed fast for what I am doing but I still felt that it could be more fast, so I researched and found that: Lambda's have some issues with Tokio Async Runtime.# Solution
I re-wrote it in Go & now each request takes around **800ms** 🚀🤘 https://github.com/Axnjr/authLambdaGo