[英]Navbar on Mysql? or bad idea?
I have a simple doubt, its bad way creates a navbar menu from mysql? 我有一个简单的疑问,它的坏方法是从mysql创建导航栏菜单吗?
100 users = 100 queries, 1000 users = 1000 queries.
What's its the best way? 最好的方法是什么?
I never worked with cache, maybe this is the way? 我从未使用过缓存,也许是这样吗? Please guide me in the best way.
请以最佳方式指导我。
It depends on what you need to do. 这取决于您需要做什么。 Like Mark Barker said in the comments, if you have a custom navigation bar per user, then you obviously will use the database.
就像Mark Barker在评论中说的那样,如果每个用户都有一个自定义的导航栏,那么您显然将使用该数据库。 MySQL is totally built to handle your queries and on most setups, small queries like this get tossed into Qcache (cached).
MySQL完全是为处理您的查询而构建的,并且在大多数设置中,像这样的小型查询都被扔到Qcache(缓存)中。
I personally never feel like HTML should be stored in MySQL, and if that is what you want to do, it just seems sloppy to me. 我个人从来没有觉得HTML应该存储在MySQL中,如果那是您想要做的,对我来说似乎很草率。 HTML should be in a file.
HTML应该在文件中。
1000 queries is totally acceptable for MySQL. MySQL完全可以接受1000个查询。 It is perfect for these small queries.
对于这些小的查询,它是完美的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.