Is it better to store the administrative rights menu data in the background of the website or to write to the configuration file?

do a background website, in which there are a lot of permissions operation menu, add, delete, change and search permissions. Is it better to store this data in a database or write it directly to a config.php configuration file, which is more efficient?

Php
Feb.28,2021

generally just put it in the database;
background permissions are more complex and easy to change, so they are not suitable to be placed in the configuration file;
and the permissions of each user and role are different, so write to the configuration file, add, delete, check and change without the convenience of the database, directly.


is generally placed in the database. Consider that it might be faster to generate cached php files at run time.


configuration file is also fine, and the database can also be
background. You don't have to think about efficiency.
the database is definitely convenient, you can query it out and add it to the redis cache.


if you can introduce a set of off-the-shelf RBAC, do it with an off-the-shelf one. If handwritten, it is recommended to use a database (you can refer to the off-the-shelf RBAC implementation). If there is a need for speed, consider adding a cache layer. As for whether to use memcached or redis, then you can evaluate it.

Menu