How does a non-relational database help our web project where it can be used

Source: Internet
Author: User
Now I have a question about Redis or memercach. What are these non-relational databases used for in our web applications?

Reply content:

Now I have a question about Redis or memercach. What are these non-relational databases used for in our web applications?

https://www.zhihu.com/question/20059632

https://www.zhihu.com/question/20304711

You can use it when you cache it. Users browse our site when the use of the cache will not have to query the database, directly from the cache that data to reduce the pressure on the server database can also make software hardware healthy operation. There's a lot more to be used. I just give an example ^_^

First Memercach never heard, only heard Memcache
1. Non-relational databases because they are key-value, queries are very fast, relational databases support transactions, and multiple table associations can be supported.
Both 2.Redis and memcache are key-value storage systems. They are all memory-based databases, of course, some databases can be brushed to the hard disk, generally used to do more cache. There are, of course, many other scenarios, such as Redis, which can be used to queue.

This is what the individual understands. We can distinguish the database from two angles: one is the storage medium (hard disk, memory), and the other is the storage model, that is, the way to express, manipulate the data you saved, similar to the file system on the hard disk.

Back to the question of the main problem, first of all, from the storage model, the relational database is based on set and relational algebra, each table is a set, for the table of increase, delete, change, check should choose, and, intersection, connection and other relational algebra operations, it should be said that it is more comprehensive, rigorous, regardless of the mathematical level of the derivation Or for many years the practice of enterprise information testing. But at the same time it will have limitations, such as when you want to store an employee information, this employee information may have many attributes, such as posts, ranks, departments at all levels, transfer records and so on; You use a relational database to create multiple attribute tables and relational tables, and you can store them with MongoDB, Simply put it in a JSON data (PS: If it's just a query). So, NoSQL, from this point of view, represents a special kind of storage model that typically simplifies the storage of certain types of data. As an example of life, you can imagine a relational database as a standard storage box, while NoSQL imagines a special container, such as a fishing rod bucket.

Second, from the storage media, such as Memcached/redis these are memory-based databases, usually also used as a cache, storage of common data or session, etc.;

Finally, because of this optimization of nosql, it often occurs in the case of big data. This is also very well understood, if the data volume is small, the original relational database is sufficient. As a result, many NoSQL consider clustering at the beginning of the design, such as MongoDB, you can easily configure the replica set (support read-write separation), configure the Shard.

It's all about the conceptual stuff, and I think there are two ways to do that if the subject needs to know more:

1, in the online search XX database of excellent practices such as sharing, see the industry specific in what scenarios with NoSQL, such as:
Http://sanwen8.cn/p/1a7xFmh.html
2, look at the introduction of the NoSQL cloud service, usually comes with this database of typical application scenarios, such as:
Https://www.aliyun.com/product/kvstore?spm=5176.7960203.237031.34.78OO9N

Need to be updated frequently, and the data schema is different when using the Philippine relational database,
For example, there is a feature to send Weibo, some Weibo may have pictures, some may be plain text, if you use MySQL to save or use the text format JSON, or two fields.
The first approach will be detrimental to search, and the second will result in a waste of storage space

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.