Diagram of the difference between NoSQL (hbase) and traditional databases

Source: Internet
Author: User

Diagram of the difference between NoSQL (hbase) and traditional databases
Http://www.aboutyun.com/thread-7804-1-1.html
(Source: About Cloud development)

Questions Guide:
1.nosql Database can delete columns
How a 2.nosql database deletes a record
What is the difference between a 3.nosql database column family and a lieder?
What is the difference between 4.nosql operations and traditional database operations?

For most people who do technology, we know what our traditional database looks like, so the object we manipulate is the line, as shown.
That is, adding and deleting changes, are the object.

1. Introduction to traditional database additions and deletions
Figure 1
Let's take MySQL for example:



Inserting data

Mysql>insert into Blog_user (' user_name ', ' user_password ', ' user_emial ') VALUES (' Aboutyun ', ' Aboutyun ', ' [email Protected] ');




Delete data:

    1. Mysql> Delete from Blog_user where user_name= "Aboutyun";
Copy Code




2.Nosql Database Add Delete Introduction


Figure 2
Take HBase as an example:
To create a table:

    1. Create ' Blog_user ', ' userInfo '
Copy Code





Inserting data
This is a key point, and it's a place that many people don't understand easily.

    1. HBase (main):012:0> put ' blog_user ', ' www.aboutyun.com ', ' userinfo:user_name ', ' Aboutyun '
    2. 0 row (s) in 1.7530 seconds
Copy Code

 
above we see the
1 shows what we don't have in the traditional data block, which is unique to NoSQL, a rowkey , which is the system's own, is also the only identity of a record in NoSQL. But this unique identifier is somewhat different from our traditional database. As shown in 1, "Record 1" is rowkey.

2 shows the column we inserted user_name , This is also the most difficult place to understand, the column can be inserted. and its ' value ' is 3 is ' Aboutyun '

We've inserted the column, let's look at the effect:
 


Here's what it means:
we'll see
1 for rowkey , insert Data ' www.aboutyun.com ',
2 is the name user_name
3 in the column family. The is designed to add this column family, so this is the system comes with, this is the operating time of the record, in the form of timestamps into hbase inside.
4 is the value of the user_name we insert.

We're inserting password:

    1. HBase (main):015:0> put ' blog_user ', ' www.aboutyun.com ', ' Userinfo:user_password ', ' Aboutyun '
Copy Code





Query results again:

  1. HBase (main):016:0> scan ' Blog_user '
  2. ROW Column+cell
  3. Www.aboutyun.com Column=userinfo:user_name, timestamp=1400663775901, Value=aboutyun
  4. Www.aboutyun.com Column=userinfo:user_password, timestamp=1400665203430, Value=aboutyun
  5. 1 row (s) in 0.0390 seconds
Copy Code




Here we see two rows of records, traditional chunks think that this is two rows of data, and for NoSQL, this is a record.


Delete column data

Delete data into delete columns and delete records
1. Delete Columns
This inside of the delete, did not delete
Delete ' Blog_user ', ' www.aboutyun.com ', ' Userinfo:user_password '


From above, we see that the column was deleted.
2. Delete records:

    1. DeleteAll ' Blog_user ', ' www.aboutyun.com '
Copy Code


This is deleted before the results are displayed, here is already


Results after deletion





Summarize
For traditional databases, adding columns to a project, the change is very large. But for NoSQL, inserting columns and deleting columns is similar to adding records and deleting records in a traditional database

Diagram of the difference between NoSQL (hbase) and traditional databases

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.