Different Data model of different Database: structuring the data with different levels of granularit

本文探讨了数据库中数据结构的重要性,尤其是在互联网和大数据时代。关系型数据库提供最精确的数据细节描述,而NoSQL数据库提供了不同粒度的数据模型。数据类型不仅涉及数据元素之间的关系,还涉及与对象类型的统一性。数据库通过将数据结构和数据组合在一起,实现自描述,方便其他系统使用。不同的数据库系统提供了固定的数据模型,但面对动态的半结构化和非结构化数据,其描述数据关系的能力有限。设计师需要根据业务选择合适的数据库系统,并理解数据库专注于数据存储和输入输出,而非解析数据对象类型。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

The relation among logical related data is very special with comparing to other style of relation. It can be described by data structure.  

In internet and big data time, the data structure of a data instance, the value, is different and variant and specified. Every data structure of data instance is unique, there is no general predefined data type which describes the structure of data instance any more. This makes data user rethink the nature of data structure deeply. Then relational data model and relation database system provide the precisest granularity, aggregate-ignorant, to describe the all details of data structure. This pro or con would make the database designer crazy and the designing complex and more easy proven error. The NoSQL database system have provided more data model with levels of granularity, such as no type limitation in cell, to describe the structure of data.

How does the different data structure make the different data type? The nature of data type is about not only the relationship among data elements, such as the order, but also the relationship between the data elements and the unity of object type. Abstract data structure is a way to express different relationship among data, different structure means different relation expressing. However, the data structure is just static, determining the properties or nature of data, not the objective dynamic relation or operations which can change the state of data.  

The type of data elements(node) and the order or space location of composing elements(hierarchy) make a different data structure or type. The information of order and type of elements is significant.   

The information of data stored in a database includes two independent aspects, the location information and the type information. Location information should not maintain the type information. But the relation data model in relational database intertwines the location information and the type information together, that means the column in the table of database has two kind information of data, the location and the type. This is the trade-off of relational data model.    

Data is the abstract formal object which means invisible software object in contrast with real world substance. The data model is the abstract of data, which means the key part information, the subtraction, of data object. 

Database groups the information of data structure and data together to represent the unit to obtain the self-description. When the other systems try to extract the data from the database, the most perfect situation is that the data type is also stored directly in database or can be get from the database indirectly. The fact is that database really maintains the data and the data type--the information describing the data. In short, database is self-description. This makes other systems easy, to some extent, to use the data with explicit data type without any hard working to get the abstraction of data.

This style of data storage invokes a nice principle or method about how human can learn knowledge quickly just like the program can access and read the data quickly from database. 

The principle is that human can get full cognition from the unity of opposites information, such as the data type and data, the data object type and data object. The data object is complex, but the system has the data object type to manage it. The data type is the abstraction of data in software system, knowing the data type means know about the data.   

In abstract software world, data structure is everything, determining the inner state structure of object, the abstract data type, and the information of data, the data model, in database. 

Data structure, with the simplest method of grouping related data, is a kind of abstract structure or formal object, simulating real-world object or abstract invisible object. Data structure is also the description and information of data, the nature of data structure determines the operations coupled with data. Data object is self-described with data structure and operations, is the unity of opposite pair--interface and implementation. Data model and data abstraction are different methods to describe the data in different system, such as database and program. 

Data abstraction, a kind of processing in computer program, emphasizes that separating off the object’s implementation from operations that the data object could perform and hiding the data structure and implementation. The result of data abstraction is the separating of explicit interface of the data object--the abstraction of object, which reflects the reality of object--and implicit hidden implementation. The system can define and use the object by the abstract data type. When system defines an object, the object must be self-described with the type information. The program can use the object with the information of abstract data type without the caring about the concrete detailed implementation.  

Different database system provides different fixed structure of database or data model describing data relationship which database designer must enjoy. On one hand, data model of a database not only provides the smallest data object--the char, int, string, array of bytes and BSON, specified by the type library in the relation database, the array bytes in columns family database, the XML, JSON and BSON document in document database--but also the structure model determined by the smallest data object. On the other hand, structured data, semi-structured data and flex but identical unstructured data--using XML to generate the data type, require database designer to choose different database system describing data relationship to meet the business. However, before the tool of database system block the designer’s thinking, designer must realize that database could only provide limited structure facility, the limited ability of structuring data, facing dynamic semi-structured data and unstructured data, to describe the data relationship. 

With a limited ability of modeling data relation, database could describe the structure of related data precisely. The best solution of coping with unstructured data is treating the data as an unity data object, for example, as a value, or as a document. The nature of database is not, precisely, describing the data structure. It serves the data storing and using. For example, facing the complex unstructured data, database is impossible to provide the facilities to describe the detail of data structure, database just does the data storing and inputting and outputting, the job about describing the detailed data structure is delegated to some other uniformed language or tool or format, such as in XML and JSON and an array of bytes and blob; also it is the application’s responsibility to understand the stored type of data object. Another example is that database, such as Key/Value model, can provide some limited facilities to describe partial data structure of the related data, then leaving the other parts as a type of data object. All of these real problems lead new database and data model, even the rethinking about of the real nature of database--1, leaving alone the inner structure of data object; 2, moving the job of data structure describing to other structure description language; 3, separating the description of data structure from the database designing and decoupling the data type from the database database type dictionary; 4, letting the database focus on resolving the real problems which database is good at handling on--the data storing structurally, inputting and outputting, not interpreting data objects type.    

In data-oriented science and industry field, people like the data with a precise and clear structure granularity. But the issue is the emerging of semi-structured data and unstructured data which normal people are habitual and good at creating.  

Document is still a collection of key-value with the detailed structure. A document in document database can be a table in HBase.   

No matter in which database, database designer hopes to put the related data together as a unity and that the storage structure could be used to reflect the primary relationship directly and explicitly. In RDBS, what the database designer really concerns is that the basic lowest-level relationship among smallest data objects type, such as the the string, int, not the bigger concepts aggregating, could be projected into the basic storage infrastructure, the relation. In NoSQL database, there is only one basic lowest-level data object type, the uniformed array of bytes or XML or JSON, database designer would not have to describe the lowest-level data structure in database. What the designer concerns is the bigger concepts aggregating, not the structure or relationship among data in the  basic uniformed array of bytes or XML or JSON or Protocol Buffer. 

Every different database system provides different facility or ability to design the storing structure, so called data model, even bonding a style of thinking, at last making the data explicit and self-described. Database system provides the space and the methods for the designer to put the raw data into the database with the additional value. 

To satisfy the different demanding and the different given granular data materials in real application, the every different database system could only provide limited framework tools to structure the data. This had leaded the evolution of database also revealed the nature, the basic function, of database system, that is the data storing with structuring and detaching the flexible data type describing via delegating and uniforming the data into structured data such as array of bytes or XML or Protocol Buffer binary file. 

Quantitative change, the structured data, leads qualitative change, the nature of data type and data abstraction. The designer uses the law of unity of opposites to create everything via the major four pairs of opposite methods--inducting and deducting, analyzing and concluding, abstracting and concreting, logical and history.       

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值