Support the ongoing development of Laravel.io →
Cache Database Architecture
Last updated 2 weeks ago.
0

My inclination would be to set redis as your cache system, store the permissions in the database but have your app attempt to read the permissions from the cache, if they are not there - then build the cache. Make sure you tag the cache keys so you can delete them when permissions are changed.

Don't try and use a cron to build the permissions as that will fail when you get too many users, plus redis is meant to store only semi-persistant data - updating it via a cron turns it into a completely persistent data store.

Although all this only applies for high traffic systems, if you're not building a high traffic site then you're doing premature optimization.

0

Looks like loading the whole two tables into cache would be best seeing as these will not be updated very often and I can hook those events to flush the cache.

0

@hailwood thanks for the reply, sorry didn't see it before I wrote my own after some research.

This is a generic platform that will be used by some high traffic installs (in my mind anyway; generally ~20 people on the site at any one time during the day).

Yeah, with the Laravel Cache class I've seen that events should be enough and I don't need a cron job. It's my Linux brain clicking on before my web dev one does.

0

Sign in to participate in this thread!

Cloudways

Your banner here too?

beaverusiv beaverusiv beaverusiv Joined 10 Apr 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.