Traditional Culture Encyclopedia - Traditional stories - Difference between hbase and traditional database (hbase vs traditional relational database)
Difference between hbase and traditional database (hbase vs traditional relational database)
The difference between HBase and traditional relational database?
Answer: mainly in the following aspects: 1. data type. Relational databases use a relational model with a rich set of data types and storage. HBase uses a simpler data model, which stores data as an uninterpreted string, users can serialize structured and unstructured data in different formats into strings to be saved in HBase, users need to write their own programs to parse the strings into different data types.
2. Data manipulation. Relational databases contain a wealth of operations, such as insertion, deletion, update, query, etc., which will involve complex multi-table connection, usually with the help of multiple tables between the primary and foreign key associations to achieve the HBase operation there is no complex table-to-table relationship, only a simple insertion, query, deletion, emptying, etc., because the HBase in the design of the avoidance of complex table-to-table relationship, usually only a single-table primary key associations to achieve the HBase operation. Because HBase is designed to avoid complex table-to-table relationships, it usually uses only single-table primary key lookups, so it can't implement table-to-table join operations like those in relational databases.
3. Storage model. Relational databases are based on row mode storage, where metazoans or rows are stored sequentially in disk pages. When reading data, each tuple needs to be scanned sequentially and then filtered from it to find the attributes needed for the query. If only a small number of attribute values per tuple are useful for a query, then row-mode storage wastes a lot of disk space and memory bandwidth.HBase is column-based, with each family of columns stored in several files, and the files for the different families of columns are separated, which has the advantage of lowering the I/O overhead, and supporting a large number of concurrent user queries, since only the columns that can answer them need to be processed, rather than the columns that are irrelevant to the query. rather than dealing with a large number of rows of data that are not related to the query; data in the same column family is compressed together, and a high data compression ratio can be obtained because of the high similarity of data within the same column family.
4. Data indexing. Relational databases can usually build complex multiple indexes for different columns to improve data access performance. Unlike relational databases, HBase has only one index - the row key. Through clever design, all access methods in HBase are either accessed through the row key or scanned through the row key so that the whole system will not slow down. Since HBase sits on top of the Hadoop framework, you can use HadoopMapRece to generate indexed tables quickly and efficiently.
6. Data Maintenance. In a relational database, the update operation replaces the old value in the record with the latest current value, and the old value is overwritten and does not exist. In HBase, when an update operation is performed, the old version of the data is not deleted, but a new version is generated, and the old version is still retained.
7. Scalability. Relational databases are difficult to scale horizontally and have limited room for vertical expansion. In contrast, distributed databases such as HBase and BigTable were developed to enable flexible horizontal scaling, and therefore can easily scale performance by adding or subtracting hardware in a cluster.
However, HBase has its own limitations compared to relational databases, such as the fact that HBase does not support transactions and therefore cannot achieve atomicity across rows.
Note: I would have liked to ask this question and copy it. As a result, I couldn't find it, so I had to type it by hand, and the students who copied it and used it nodded their approval.
- Previous article:What are the top 10 food snacks in Zhoukou?
- Next article:A story about morality
- Related articles
- What is the best traditional calendar in Jiangxi?
- Types of Traditional Buildings in China
- Composition of traditional food in Linfen, Shanxi Province
- What were the main features of the feudal marriage and family system in old China?
- The object of legal regulation is to divide the sectoral law of what
- How to make a poster for Dragon Boat FestivalHow to make a poster for Dragon Boat Festival
- Yu Junbo's life
- What are the dress characteristics and living habits of Miao people?
- The importance and role of English grammar
- What is the dialing principle of the old dial-up phone?