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:
- 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:
- 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.
- HBase (main):012:0> put ' blog_user ', ' www.aboutyun.com ', ' userinfo:user_name ', ' Aboutyun '
- 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:
- HBase (main):015:0> put ' blog_user ', ' www.aboutyun.com ', ' Userinfo:user_password ', ' Aboutyun '
Copy Code
Query results again:
- HBase (main):016:0> scan ' Blog_user '
- ROW Column+cell
- Www.aboutyun.com Column=userinfo:user_name, timestamp=1400663775901, Value=aboutyun
- Www.aboutyun.com Column=userinfo:user_password, timestamp=1400665203430, Value=aboutyun
- 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:
- 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