NoSQL Aggregation Data Model

Source: Internet
Author: User

Features of the NoSQL aggregation data model

The aggregation data model is characterized by putting frequently accessed data together (aggregated in one piece);
The benefits are obvious, and for a query request, you can take all the data out in one interaction with the database;
Of course, storing inevitably in this way will be repetitive and repetitive for less interaction;

Disadvantages
    • The aggregation structure is advantageous to some interactions, but hinders other interactions;
      For example: students to learn to aggregate student information (including student name, class, age, and other information, and even English subjects), through the study number query, can be in one interaction to find out all the information of the student, but if you want to query through the name of students, it is very difficult;

    • Acid transactions that span multiple aggregates are not supported
      Aggregation structures are limited in terms of transactional support; there are some nosql products that implement simple transactional support, but are not perfect for transactions that span multiple aggregation structures;

Plan data Access Methods

Using NoSQL database, the first task is to design key names and stored data;
The principle of design is to minimize the number of aggregation required to access, in the least possible interaction to get the required data;
If you find that you need to obtain data through multiple query criteria, it may not be appropriate to use NoSQL; relational databases are preferred;

Aggregation-oriented database
    • Key-Value Database
      can store arbitrary data, the stored data is opaque to the user, from the outside, but contains not much meaning of large chunks of data;

      Access: by key to find

    • Document Database
      When the document database is stored, it defines its allowable structure and data type, and from the outside, it can see the internal structure;
      The advantage of restricting the data stored in storage is that it provides more flexible access to the data;
      Access method:
      1. Available Key Name query
      2. Field queries in the available aggregations (the benefits of defining the structure of stored data)
      3. Index can be created according to aggregated content

Related: Relational data model

For the data model, we are most familiar with the relational data model;
Relational data model is a kind of "aggregation ignorance model";
When organizing data, use the E-R model to plan clearly;
The benefit is that it's easy to query the data in different ways (various where conditions and even joins)
Relational databases are all using relational data models, such as Oracle;

Attached Mind Map

Reference

The essence of NoSQL

Posted by: Big CC | 27apr,2014
Blog: blog.me115.com [Subscribe]
Weibo: Sina Weibo

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.