In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
NoSQL database overview and its comparison with SQL syntax is how, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.
HBase is a distributed storage system with high reliability, high performance, column-oriented and scalable. It is also one of the well-known NoSQL databases. The emergence of NoSQL database is to solve the challenges brought by large-scale data collection and multiple data types, especially the problem of big data's application.
The editor briefly introduces the definition, classification, characteristics and current popular NoSQL database system of NoSQL database, and makes a simple comparison between NoSQL and SQL syntax, which provides a useful reference for everyone to study NoSQL database.
First, the emergence of NoSQL
Relational database system has achieved great success in solving data storage, service and processing problems over the years. Some large companies use relational databases to build their own systems, such as online transaction processing systems and back-end analysis applications. The online transaction processing (OLTP) system is used to record transaction information in real time. The expectation for this type of system is to be able to return response information quickly (usually in milliseconds). The online Analytical processing (OLAP) system is used to analyze the data stored in the query. OLAP belongs to the category of business intelligence, and data needs to be studied, processed and analyzed in order to collect information and further drive business decisions.
The internal design of relational databases is determined by relational algorithms, and these systems need to pre-define a schema and the type of data to follow. SQL is the standard way to interact with these systems. However, in the case of object-relational mismatch, SQL is not a way to express access patterns. For example, in the hot field of big data, relational database can not work well.
Common definitions of big data include: * big data means that the data is large enough that you have to study it in order to get some insights from the data; second, big data is no longer suitable for data on a single machine. These views are not complete, we need to think about the data in a fundamentally different way, from the perspective of how to drive business value, this kind of data is big data.
In the field of big data, the system needs to be able to adapt to different kinds of data formats and data sources, does not need to define schemas strictly in advance, and can handle large-scale data. In this way, NoSQL appears.
II. The definition of NoSQL
NoSQL (NoSQL= Not Only SQL), which means "not just SQL", is a new revolutionary movement for databases. Advocates of NoSQL advocate the use of non-relational data storage. Most database technologies are not guaranteed to support ACID (atomicity, consistency, isolation, and persistence), and most of them are open source projects, which as a whole are called NoSQL.
III. Classification of NoSQL
NoSQL databases are generally divided into four categories: Key-Value storage database, column storage database, document database and graphics (Graph) database. Their data model, advantages and disadvantages, and typical application scenarios are shown in Table 1.
Table 1 Analysis of four major NoSQL databases
IV. Characteristics of NoSQL
NoSQL databases do not have a unified architecture, but they all share some common characteristics shown in Table 2.
Table 2 characteristics of NoSQL
5. Common NoSQL databases
The situations that are more suitable for using NoSQL database are: (1) relatively simple data model; (2) need a more flexible IT system; (3) higher database performance requirements; (4) do not need a high degree of data consistency; (5) for a given key, it is easier to map complex values of the environment.
Common NoSQL databases are shown in Table 3.
Table 3 Common NoSQL databases
VI. A simple comparison between NoSQL and SQL syntax
Having introduced the basic situation of NoSQL, let's take HBase and ORACLE as examples to make a simple comparison of the syntax of NoSQL and SQL. HBase database is considered to be one of the NoSQL database products with the most complete security features, and it has proved to be a powerful tool, especially when Hadoop is already used. Today, it is an Apache*** project with a large number of developers and a thriving user community.
1. Create a tabl
If you are creating a table "mytable" that contains a "info" field, then:
(1) the syntax in ORACLE is:
Create table mytable
(
Info varchar (30) not null
);
(2) the syntax in HBase is:
Create 'mytable',' cf'
This command creates a table "mytable" with a column family ("cf").
two。 Write data
If you want to write data "hello hbase" to the table, then:
(1) the syntax in ORACLE is:
Insert into mytable (info) values ('hello hbase')
(2) the syntax in HBase is:
Put 'mytable',' first', 'cf:info',' hello hbase'
This command inserts "hello hbase" into the data unit for the "cf:info" column in the "first" row of the "mytable" table.
3. Read (check) data
If you want to read a single piece of data from a table, then:
(1) the syntax in ORACLE is:
Select * from mytable where info = 'hello hbase'
(2) the syntax in HBase is:
Get 'mytable',' first'
This command outputs the data units of the row.
If you want to read all the data from the table, then:
(1) the syntax in ORACLE is:
Select * from mytable
(2) the syntax in HBase is:
Scan 'mytable'
This command outputs all the data.
4. Delete data
If you want to delete data from the table, then:
(1) the syntax in ORACLE is:
Delete from mytable where info = 'hello hbase'
(2) the syntax in HBase is:
Put 'mytable',' first', 'cf:info',' hello hbase1'
This command overwrites the old value with the value of *, which is equivalent to deleting the original data.
5. Modify data
If you want to modify the data in the table, then:
(1) the syntax in ORACLE is:
Update mytable set info = 'hello hbase1' where info =' hellohbase'
(2) the syntax in HBase is:
Put 'mytable',' first', 'cf:info',' hello hbase1'
This command overwrites the old value with the value of *, which is equivalent to modifying the original data.
6. Delete the table
If you want to delete the table, then:
(1) the syntax in ORACLE is:
Drop table mytable
(2) the syntax in HBase is:
Disable 'mytable'
Drop 'mytable'
This command drops the table "disable" and then "drop".
As we can see, the syntax of HBase is relatively simple, so you can put all the above commands into a shell script and let the commands be executed in batches. Next, let's do it in detail:
* step, write a script named "command.sh", which contains the following:
Exec / root/zhouzx/hbase-1.0.1/bin/hbase shell
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.