Relational data model: basic concepts, elements, characteristics. Database Models

Information is based on relationships. When the relationship crosses, new information arises. With such a non-standard, but extremely simple approach, it is most convenient to watch what has been done. In addition, it will become apparent what exactly will be done in the future. In the socio-economic sphere, it is important to foresee, and in the relations between people it is important to make informed decisions. The relational data model, as an idea that has passed the centuries-old development path, is interesting and instructive for creating new ideas, making informed decisions and creating new social relations.

From the history of the ideas of "databases"

Ideas are separated from the authors. The faster this happens, the more relevant the idea. They pass people when they already exist, and the latter only opened their eyes, and they noticed something. In programming, there are a lot of events, facts and authors to whom they attributed something or they themselves said that they were doing. Then it turned out that it was done not at all by them or not in the way it was necessary.

Information and programming, like the universe and the atom, but the last to this day does not strive to become the foundation for the development of information, is content with so far a small: formal attitude to the matter - formalization.

Knowledge and skills

Man has always created databases. He calls it knowledge and skills. In a visible embodiment, this (everything that is created by the human mind): tools, drawings, texts, documents, customs, written law, libraries, buildings, technical products and much more.

The advent of computers has become a problem. What was always obvious simply could not be formalized and recreated programmatically. Probably, it was the semantic filling of the term “formalization” that was not ready for the transfer of knowledge and skills to software products.

From the history of database models

Relationships are so familiar that they are invisible to the naked eye. Rectangular forms of tables are a disaster, which from the very first moment when the first spreadsheet appeared, is still present even in the most famous database management system.

Data equity is obvious. It is not necessary to prove that the surnames are equivalent, the names too. If you take two student groups, then both will have surnames and first names. If you take a stream, you get a hierarchy. First, the peak is the flow, then the groups, then each individual student.

Completely uncomplicated reasoning leads to the fact that the relational database model is not unique, there are also:

  • hierarchical;
  • network;
  • file;
  • object oriented.

There are many more mixed ideas and even more implementations that have not found their application. In any case, there are relations of equality or hierarchy. It’s impossible to think of anything else. In any system, relations can only be on one level: up (generalization) and down (refinement).

relational model

Important: in fact, everything happens along the time line. In addition to the "trouble" with rectangular tables, there is still a problem with the story. At the dawn of computer science and programming, nobody thought about time. But any event always occurs in time.

Database models are systems. No one will argue with this. If so, then there are only three types of relationships:

  • horizontal - equal rights;
  • vertical - hierarchy;
  • in time is history.

All other terms and details can be applied, discussed, but they will not have any objective meaning.

Database Concepts

Distributed database or local data file. Cluster, cloud or virtual container. All these are hardware or software solutions. How the body is located (the contents of the database) and the functionality is organized (program modules, control computers, etc.) - this is not a database, but technical solutions.

If a database is deployed in a raid when one hard drive is enough, or when a web resource provides database functionality by manipulating data from hundreds of thousands of other web resources, this is not a database, but also technical solutions.

Additionally (to the designated technical solutions):

  • modern hardware reliably and works great;
  • there is qualified personnel who can build an arbitrarily complex and highly organized hardware-software network design (company infrastructure or a common data center);
  • There are developers who are brilliant in application deployment and data access technologies.

All this has an auxiliary, albeit substantial, relation to the database model.

The most popular concept: a database is a named collection of structured information related to a subject area. There is another similar concept: the core of any database is a model that reflects, first of all, the structure.

Often, the network and relational data model is not only divided as something fundamentally different, but is also considered as a decentralized or centralized system that has nodes, levels, connections, to which end users join.

Actually, what is an end user? Is there infinite? As Bulgakov said, sturgeon is never second fresh. Similarly, the user is of only one kind, and he has nothing to do with the data model, no matter how it is called.

Database Elements and Features

The most valuable element is the table. Always rectangular. The table has fields and records. Typically, each table is placed in its own file, but often all tables in the same database are placed in one large file. With this idea (one file for one database) , the idea of ​​using several computers for one cumbersome DBMS began.

By tradition, the column field has:

  • name;
  • a type;
  • type description;
  • built-in check of conformity of value to type;
  • a comment;
  • trigger or inline procedure.

There are not many options for describing fields, but its most significant characteristic is its type. If you wish, you can always change the name, the comment never matters, but changing the type is difficult, especially on an existing database.

Classic DBMS Solutions

Very often, specific developers name the basic concepts of a relational data model in their own way. Recently, it has been fashionable to use the terms:

  • essence;
  • doctrine;
  • information object ;
  • requisite composition;
  • data relationships (one to one, one to many, all to all).

Analyzing the terminology for the description of specific database applications, we can say that it is based on either the experience of the development team or a specific subject area. It is usually possible to understand what is embedded, for example, in the word “essence” or “doctrine” only in a specific application. About the general criteria recognized by all so far there can be no question.

In particular, no one will argue that Oracle is a recognized leader. No one will say something bad about MySQL, but not the opinion of their creators, but the understanding of the "applicants" dominates these foundations: specific programmers, using this or that product, "think over" the elements and characteristics of the database they create.

Before you start modeling

The knowledge and skills of the programmer should be sufficient, and if the design of the relational data model is performed by the team, there must be complete understanding and the absence of conflict situations.

There are only two scenarios:

  • a classic model is being designed;
  • an object-oriented model (OOM) is created.

The difference between the words “designed” and “created” is that in the first case everything goes according to the standard plan, which is accepted by the programming community and is understood by the classic customer. There is work, not creativity. The result: a reliable, safe and fully working model. But there will be no dynamics, self-adaptation and no development.

The task will be set in the context of the formalization of the subject area and the formation of tables, relationships, queries and serving functionality. When creating an object-oriented database, the task will look something like this: all elements of the relational data model are objects.

If the work is needed simple or it needs to be done extremely quickly, the first option is chosen. One can think about creating an object-oriented database only if there is time and opportunity for the creative process. And even then, everything should be carefully weighed. In any case, the contractor and the customer must come to an agreed decision to complete the work begun - this is the main condition for the successful completion of work.

Design Basis: Simple

A relational data model can be created using existing tools, for example, MySQL has a Workbench. The manufacturer of each popular database offers its own tools; there are dozens of offers from third-party developers. Whether or not to rely on such tools is a matter of taste and ability to work with them. If there is no experience, it is better not to even think. If there is an extra month or two, you can consult with colleagues and make a decision.

The issue of modeling and design is paper, pencil and computer, for example, with a PHP interpreter, MySQL server and hosting on Apache. For Oracle or MS SQL Server, the issue is resolved in the same way, but paper and pencil are reliable classics of the process.

Modeling and design process

A relational data model is a formalization of the problem domain, but the erroneous experience of many projects should not be repeated. Not everything is determined by the quantity and quality of the tables. Not everything depends on the reasonableness of the connections:

  • one to one;
  • one to many;
  • many to many.

There is absolutely no need to think about requests: who and when, on which join will sit - on the left or on the right?

database models

It is known from the history of the ideas of “human” databases: he creates them constantly and he calls it knowledge and skills. This is not a join and not "how many to how many." In classical design, you can start modeling from the query side (this is the output) or from the table side (this is the input). Actually, a database is a system of tables.

The word "systematization" refers to each table in particular and to all tables in the aggregate. The keys are used to establish connections between them, but this is not a “how many to how many” option. This is a meaningful connection of one data structure to another. With this approach, semantics will be more visual, and the result will be more practical.

Classic design doesn't need more. In any case, we get a rectangular, but working version on the plane. That is, natural reality is three types of relationships:

  • horizontal - equal rights;
  • vertical - hierarchy;
  • in time is history.

The resulting formality is only the first two. If you can figure out how to use the time line, roll back events, and keep a history of events - good. But it is doubtful that natural information in its full form is formalized in classical design.

OOM: point and point system

The current level of knowledge and skills does not allow to determine priorities. Where to start: from a point or from a system of points? This, as in the conceptual philosophical question: "What happened before - a chicken or an egg"? In both cases, an auxiliary condition is required. Most likely, the task domain will help determine priority.

Often, a relational data model can be more effectively modeled and created precisely from a point, since the system includes subsystems and creates the required hierarchy of relations, ensuring equal relations at each level. However, there are many tasks when systems can arise simultaneously, at the same time at several levels, and then line up in a common system. For example, a web resource for parsing information with accumulation for each visitor.

basic concepts of a relational model

In such a task, creating one system for all visitors is unreasonable. It is not known how many there will be and at what level of the hierarchy they will be at any given time. The aggregate characteristic of the relational data model here will be constantly changing. To make a general decision, it will be necessary to merge the data into a common system that will redistribute the answers according to the formed levels, and their number will also dynamically change.

OOM: creation

To create an object-oriented database, one table is enough. Initially, object orientation means activity. Therefore, the database here is the storage location. But this approach will not give the desired performance, since storing the entire database in RAM is unpromising with the current level of technology development.

How to create an object-oriented database? This is the competence of the developer, whose main task is to implement the necessary knowledge and skills in the form of a system of objects. With this approach, tables lose their rectangularity; all three types of relations work:

  • horizontal - equal rights;
  • vertical - hierarchy;
  • in time is history.
relational model elements

Questions about what kind of connections will be and who will sit on which join lose all meaning. The developer creates a system of objects, which themselves realize their knowledge and skills with other objects. Here the main rule is: an object is a real element of information from a specific subject area, which gives it the necessary knowledge and skills.

Challenges and Prospects

It is difficult to implement the idea of ​​OOM, this is evidenced by the dynamic development of industry leaders who are constantly updating their “park” of rectangular tools, that is, they are developing classic relational database management systems. But natural information does not fit into rectangular tables!

World of information

The world of information is real knowledge and skills that, at the current level of development, can be put into orderly systems of objects and make solving specific problems dynamic and self-developing.

Source: https://habr.com/ru/post/A9185/


All Articles