Want to ask, Segmentfault's question label is how to store the design, because we also have this demand, looked up the information, if the simple use of MySQL storage, Too cumbersome. I think it is possible to store multiple tags in the form of an array in MongoDB, the ID of the MySQL storage tag, because we need user input tag auto prompt, and MongoDB just can use regular expression query tag, but MongoDB is looking not to go index, so efficiency does not know how?
Reply content:
Want to ask, Segmentfault's question label is how to store the design, because we also have this demand, looked up the information, if the simple use of MySQL storage, Too cumbersome. I think it is possible to store multiple tags in the form of an array in MongoDB, the ID of the MySQL storage tag, because we need user input tag auto prompt, and MongoDB just can use regular expression query tag, but MongoDB is looking not to go index, so efficiency does not know how?
Spend 4 hours to read Http://t.cn/RArNl90 confirm the selection right, see tags This is why I jumped out of the always redis it
No, the label storage is very simple, 2 tables can be solved ah, with MySQL, a label table, a relational table, it is OK, and later maintenance is easy to update. You're making the problem complicated.
In their own development of the long AI network, the idea is this: in the table to store the article has a category field, used to store the article tags, of course, an article may have a number of tags. After getting to tags, if an article has two or more tags, I will split it, split into a single, stored in the tags table. Of course will be judged, if tags in the table already exist, just increase the number of tags, if not, then insert a new record.
Or use a decision to use Redis.