简体   繁体   English

导航栏在Mysql上? 还是坏主意?

[英]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 Ba​​rker在评论中说的那样,如果每个用户都有一个自定义的导航栏,那么您显然将使用该数据库。 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.

相关问题 在MySQL数据库中存储MySQL查询......不好主意? - Storing a MySQL query in a MySQL database… Bad Idea? PHP / MYSQL:消除用户输入 - 这是一个坏主意吗? - PHP / MYSQL: Sanitizing user input - is this a bad idea? 利用MySQL的“注释”部分来处理PHP中的变量,好还是坏主意? - Utilizing the MySQL “Comments” section to process variables in PHP, good or bad idea? 好主意/坏主意?在一小组子查询结果之外使用MySQL RAND()? - Good Idea/Bad Idea? Using MySQL RAND() outside of a small set of subquery results? 在析构函数中保存 - 不好主意? - Saving in the destructor - bad idea? 当使用PHP连接到MySql数据库时,根据用户输入修改db config是一个坏主意吗? - While connecting to a MySql database with PHP, is it a bad idea to modify the db config based on user input? PHP:将共享的用户数据作为JSON字符串存储在MySQL中有多么糟糕的主意? - PHP: How bad of an idea is it to store shared user data in MySQL as a JSON string? 通过HTML表单使用PHP更改MySQL表上的ENUM列是一个坏主意吗? - Is it a bad idea to alter an ENUM column on a MySQL table with PHP via an HTML form? 在 PHP 中执行此操作有多糟糕? - How bad of an idea is it to do this in PHP? 电子邮件验证链接是个坏主意 - Is email verification with a link a bad idea
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM