Menu

πŸ“°
0

Redis-backed permissions for high-volume Laravel apps: v4.0.0-beta.1

DEV Community: laravelΒ·Sebastian CabarcasΒ·about 1 month ago
#xDOtmvG0
#dev#code#class#redis#permissions#article
Reading 0:00
15s threshold

I just shipped v4.0.0-beta.1 of laravel-permissions-redis , and I want to share both what's in it and the specific problem it exists to solve. The problem Spatie's laravel-permission is the de-facto permissions package in the Laravel ecosystem and it's great. But it was designed for the common case: users have roles, roles have permissions, you check them a handful of times per request, you hit the DB, everyone's happy. What happens when you scale that model? An admin panel rendering 200+ ACL-gated widgets per page An API gateway fanning out to 30 microservices, each check needing authorization context A reporting dashboard pulling user-filtered data with permission checks on every field At that point, each permission check is a DB roundtrip (even if cached at query level), and your p99 latency is now dominated by authorization. What this package does Moves the entire read path to Redis.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More