Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Overview of database softwar

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. Relational database

Relational database refers to a database that uses a relational model to organize data.

Relational model was first proposed by Dr. E.F.Codd, a researcher of IBM, in 1970. in the following decades, the concept of relational model has been fully developed and gradually become the mainstream model of the mainstream database structure.

To put it simply, the relational model refers to the two-dimensional table model, and a relational database is a data organization composed of two-dimensional tables and their relationships.

Concepts commonly used in relational models:

Relationship: can be understood as a two-dimensional table, each relationship has a relationship name, which is commonly referred to as the table name

Tuple: can be understood as a row in a two-dimensional table and is often referred to as a record in a database

Attribute: can be understood as a column in a two-dimensional table, often referred to as a field in a database

Domain: the value range of an attribute, that is, the value limit of a column in the database

Keyword: a set of attributes that uniquely identify a tuple, often called a primary key in a database, and consisting of one or more columns

Relationship pattern: refers to the description of a relationship. Its format is: relational name (attribute 1, attribute 2,., attribute N), which becomes the table structure in the database.

Advantages of relational databases:

Easy to understand: two-dimensional table structure is a concept that is very close to the logical world, and the relational model is easier to understand than other models such as mesh, hierarchy and so on.

Easy to use: the general SQL language makes it very convenient to operate relational databases.

Easy to maintain: rich integrity (physical, referential, and user-defined integrity) greatly reduces the probability of data redundancy and data inconsistencies

two。 Relational database bottleneck

High concurrent read and write requirements

The concurrency of users of the website is very high, often reaching tens of thousands of read and write requests per second. For traditional relational databases, the hard disk Istroke O is a big bottleneck.

Efficient reading and writing of massive data

The amount of data generated by the website every day is huge, and for relational databases, it is very inefficient to query in a table containing huge amounts of data.

High scalability and availability

In the web-based structure, the database is the most difficult to scale out. When the number of users and visits of an application system is increasing day by day, the database has no way to expand the performance and load capacity as simply as web server and app server by adding more hardware and service nodes. For many websites that need to provide round-the-clock service, it is very painful to upgrade and expand the database system, which often requires downtime maintenance and data migration.

For websites, many of the features of relational databases are no longer needed:

Transaction consistency

Relational databases have a lot of overhead in maintaining the consistency of things, but now many web2.0 systems do not have high consistency in reading and writing things.

Real-time reading and writing

For a relational database, it is certainly possible to read a piece of data immediately after inserting it, but for many web applications, it does not require such high real-time performance. For example, after sending a message, it is entirely acceptable to see the dynamic after a few seconds or even more than ten seconds.

Complex SQL, especially multi-table association queries

Any web system with a large amount of data is very taboo to query the association of multiple large tables, as well as complex data analysis types of complex SQL report queries, especially the SNS type of websites, from the point of view of demand and product class, to avoid this situation. Often it is only the primary key query of a single table and the simple conditional paging query of a single table, so the function of SQL is greatly weakened.

In relational databases, the main reasons for poor performance are multi-table associated queries and complex SQL report queries with complex data analysis types. In order to ensure the ACID characteristics of the database, we must try our best to design according to its required paradigm. The tables in the relational database are all stored in a formatted data structure. The composition of each tuple field is the same, even if not every tuple needs all fields, but the database assigns all fields to each tuple. This structure can facilitate operations such as linking between slogan tables, but from another point of view, it is also a factor in the performance bottleneck of relational databases.

3.mysql and mariadb

MySQL Mariadb, these two open source software are written by the same person.

A brief introduction to the concept of open source software

Many people think that open source software is free. In fact, it is not accurate. Open source means software that can spread freely. Including the modified software is open. What I have to mention here is the GPL agreement (GNU General Public license). Through this agreement, the rights and obligations of using open source software are stipulated. In popular terms. That is to say, after modifying the open source software, the software is also open source. If it becomes a paid version of commercial software, it will violate the GPL agreement. Sanctions will be imposed accordingly.

So open source software greatly enhances the potential of human beings. As a result, the it world blossoms and develops rapidly.

4. Relational database V.S. Non-relational database

The most important feature of relational database is transaction consistency: the traditional read and write operations of relational database are transactional and have the characteristics of ACID, which makes relational database can be used in almost all systems that require consistency, such as typical banking systems.

However, in web applications, especially in SNS applications, consistency is not so important. It is tolerable that what user A sees is inconsistent with user B seeing the same user C content update, or that the time difference between two people seeing the same friend's data update is tolerated by a few seconds. Therefore, the biggest feature of relational database is useless here, at least not so important.

On the contrary, the huge price paid by relational databases to maintain consistency is their poor read and write performance, while SNS applications such as Weibo and facebook require extremely high concurrent read and write capabilities, and relational databases can no longer cope with them. (in terms of reading, traditionally, in order to overcome the shortcomings of relational databases and improve performance, one level of memcache is added to static web pages, while in SNS, it changes too fast. Memchache is powerless, so a new data structure storage must be used instead of relational databases.

Another characteristic of relational database is that it has a fixed table structure, so its expansibility is very poor, but in SNS, the upgrade of the system and the increase of functions often mean great changes in data structure, which is difficult for relational databases to cope with and requires new structured data storage.

Therefore, the non-relational database arises at the historic moment, because it is impossible to use a kind of data structured storage to meet all the new requirements, therefore, the non-relational database is not strictly a kind of database, it should be a collection of data structured storage methods.

It must be emphasized that the persistent storage of data, especially the persistent storage of massive data, still needs a kind of relational database.

5. Non-relational database classification

Because of the natural diversity of non-relational database itself and the short time of its emergence, there are several databases that can unify the country without relational database. There are many non-relational databases, and most of them are open source.

In fact, most of these databases are relatively simple, except for some commonalities, a large part of them are aimed at some specific application requirements, therefore, for this kind of application, it has extremely high performance. According to the different structured methods and applications, they are mainly divided into the following categories:

Key-value databases for high-performance concurrent read and write:

The main characteristics of key-value database even if it has very high concurrent read and write performance, Redis,Tokyo Cabinet,Flare is the representative of this kind of database.

Document-oriented database for massive data access:

The characteristic of this kind of database is that it can query data quickly in huge amounts of data, such as MongoDB and CouchDB.

Extensibility-oriented distributed database:

The problem that this kind of database wants to solve is that the traditional database has the defect of scalability, and this kind of database can adapt to the increase of data quantity and the change of data structure.

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report