In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
Xiaobian today takes you to understand what the five mainstream database models are, and the knowledge points introduced in this article are very detailed. Friends who feel helpful can browse the content of the article together with Xiaobian, hoping to help more friends who want to solve this problem find the answer to the question. Let's learn more about "what are the five mainstream database models respectively" together with Xiaobian.
What is a data model?
Access to data in a database depends on the data model implemented by the database. The data model affects how clients manipulate data through APIs. Different data models may provide more or less functionality. In general, the data model does not provide much functionality directly, and many of the features must be implemented by the client itself.
The data model determines how clients encode and store data. Applications require some kind of domain model to map to the characteristics supported by the storage technology.
So far, the dominant data model has been relational. Here, we mainly want to introduce you to the non-relational model, as a contrast, this article will also briefly introduce the relational model.
Data Model Overview
1. relational model
Relational models are stored using records (made up of tuples) stored in tables, which are defined by the schema. Each column in the table has a name and type, and all records in the table must conform to the definition of the table. SQL is a specialized query language that provides syntax to find records that meet criteria, such as table joins. Table joins can query records between multiple tables based on relationships between the tables.
Records in tables can be created and deleted, and fields in records can be updated individually.
Relational model databases typically provide transaction processing mechanisms that provide solutions for automated processing involving multiple records.
For different programming languages, tables can be thought of as arrays, lists of records, or structures. Tables can be indexed using B-trees and hash tables for high-performance access.
2. key-value store
Key-value stores provide access based on key-pair values.
Key-value pairs can be created or deleted, and values associated with keys can be updated.
Key-value stores generally do not provide transaction processing mechanisms.
For different programming languages, key-value stores are similar to hash tables. Different programming languages have different names for this (Java calls it "HashMap," Perl calls it "hash," Python calls it "dict," PHP calls it "associative array"), and C++ calls it "boost::unordered_map."
Key-value stores support own implicit indexes on keys.
Key-value stores may not seem useful, but they can store a lot of information on "values." A value can be an XML document, a JSON object, or any other serialized form.
Importantly, the key-value store engine doesn't care about the internal structure of the "value"; it relies on the client to interpret and manage the "value."
3. document storage
Document stores support access to structured data, and unlike relational models, document stores have no enforced schema.
In fact, document storage is stored in packaged key-value pairs. In this case, the application takes some conventions about the packages to retrieve, or takes advantage of the storage engine's ability to divide different documents into different collections to manage the data.
Unlike relational models, document storage models support nested structures. For example, the document storage model supports XML and JSON documents, and the "value" of a field can nest other documents. The document storage model also supports array and column-valued keys.
Unlike key-value stores, document stores care about the internal structure of documents. This allows the storage engine to directly support secondary indexing, allowing efficient queries on arbitrary fields. The ability to support nested document storage enables query languages to search nested objects. XQuery is an example. MongoDB achieves similar functionality by supporting specifying JSON field paths in queries.
4. Column storage
If you flip the data, columnar storage will be very similar to relational storage. Unlike relational model storage records, columnar storage stores all data in columns as streams. For any record, an index can quickly fetch the data on a column.
Map-reduce implementation Hadoop stream data processing efficiency is very high, the advantages of column storage are reflected in the extreme. Therefore, HBase and Hypertable are often used as non-relational data warehouses to support Map-reduce data analysis.
Relational type labels do not work well for data analysis, so users often store more complex data in columnar databases. This is directly reflected in Cassandra, which introduces a "column family" that can be thought of as a "super-column."
Columnar storage supports row retrieval, but this requires retrieving matching column values from each column and reassembling the rows.
5. graph database
Graph database stores vertex and edge information, some support adding comments.
Graph databases can be used to model things, such as social graphs, real-world objects. The IMDB (Internet Movie Database) site's content forms a complex image, with actors and movies intertwined.
The query language of graph database is generally used to find the path of graph break point, or the attribute of path between endpoints. Neo4j is a typical graphical database.
Which data model to choose?
Data models have their own strengths and weaknesses, and they are applicable to different domains. Whether you choose a relational model or a non-relational model, you have to make a choice based on the actual application scenario. You may find that a single data model does not fit your solution, and many large applications may require integration of multiple data models. (Zhang Zhiping/Compilation)
Thank you for your reading. The above is the whole content of "What are the five mainstream database models?" Friends who have learned to operate quickly. I believe that Xiaobian will definitely bring you better quality articles. Thank you for your support of the website!
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.