-
-
Notifications
You must be signed in to change notification settings - Fork 18
[Backend] Upgrade Redis Backend for Multi-Process / Distributed Environments #5
Copy link
Copy link
Open
Labels
backendIssues involving server-side logic, databases, or APIsIssues involving server-side logic, databases, or APIsenhancementNew feature or requestNew feature or requestlevel:advancedRequires advanced implementation, bug fixing or refactoringRequires advanced implementation, bug fixing or refactoringtype:bugSmashes annoying bugsSmashes annoying bugstype:designDesign changes in codeDesign changes in codetype:docsDocumentation changeDocumentation changetype:featureAdds a new featureAdds a new featuretype:performanceFixes performance issuesFixes performance issuestype:refactorMultiple files refactoredMultiple files refactored
Metadata
Metadata
Assignees
Labels
backendIssues involving server-side logic, databases, or APIsIssues involving server-side logic, databases, or APIsenhancementNew feature or requestNew feature or requestlevel:advancedRequires advanced implementation, bug fixing or refactoringRequires advanced implementation, bug fixing or refactoringtype:bugSmashes annoying bugsSmashes annoying bugstype:designDesign changes in codeDesign changes in codetype:docsDocumentation changeDocumentation changetype:featureAdds a new featureAdds a new featuretype:performanceFixes performance issuesFixes performance issuestype:refactorMultiple files refactoredMultiple files refactored
🎯 Objective
Refactor the current Redis storage backend to properly support multi-process (e.g., multiple Uvicorn workers) and distributed environments using atomic operations or distributed locks.
💡 Why this matters
Currently, HumaneProxy supports Redis as a backend, but the rate-limiting and trajectory window logic relies on in-memory state or non-atomic Redis operations. If an enterprise deploys HumaneProxy behind a load balancer with 4 Gunicorn/Uvicorn workers, race conditions can occur in updating the session risk trajectory or rate limits. We need true distributed state handling.
✅ Acceptance Criteria
RedisBackendimplementation instorage/.INCRwithEXPIREnatively, or a Lua script for sliding window rate limits).📚 Resources