10 Best Practices database design

Author | Emily Williamson

Translator | Sun Wei , Zebian | Tu Min

Exhibition | CSDN (ID: CSDNnews)

The following is the translation:

Database is the core element of the application and the computer is responsible for storing all important data needed to run the software application. In order to ensure the normal operation of the application, there is always an even multiple databases in silent operation. We can warehouse databases as information, in a structured way to store a lot of information, and reasonable classification, easy to search and use.

Therefore, the database design has become an important part of software development, for developers to design an efficient database is essential. Why, then, the database design is important, what is "good" standard is? This article will do the introduction.

Why database design is important?

We ordered shirts with online mall site, for example. Today, ordering shirts from the website process seems simple, but involves a lot of information exchange. For example: The first time you browse the web, the system will show you a range of information, including product classification, all available goods, the corresponding price, available sizes, colors, and other relevant information. The site will be retrieved from the database to store data when the user selects the desired product and continue to buy, the site will ask personal details, delivery address, payment details and confirm the order. The new data currently generated in this process, such as user details, order details, purchase and payment will be adding and updating the same database.

Database design is important because for building scalable and software applications to run at high workloads, it is essential. First of database design, the choice of database software is critical. Currently the database can be used to build software applications have hundreds to choose from, we can choose from some of the best free database software, then that is designed to meet the requirements of the database. Listed below are 10 best practices database design.

10 Best Practices database design

The owner of view into consideration

To design a good database, you must consider the views of all stakeholders. Before building the database, go to gather information about what they expect the database and operating proficiency of the database. This will provide the technical level database should be used, and whether you want to train on the function of the database user.

Select the database type that meets your needs

There are many types of database, select the correct type is the key to database design. Our database can be classified in two ways. One is based on a database query language for defining and manipulating data. Database using SQL is the most common type of structured data. However, due to scalability, flexibility and speed of NoSQL databases better, they are more suitable for machine learning, and network analysis of things (the IoT) use.

The second classification is based on the data model. Such classification will have four types: relational databases, hierarchical databases, network databases, and object-oriented database.

Different types of research databases, and make a choice for applications, which is the initial step necessary.

In a manner consistent with the definition of tag tables and columns

When you define a data item and marking tables and columns, to comply with the principle of consistency is very important, it can help us better understand the data. Named one of the tables and columns of best practice is to use a simple name to define the data it contains. For example: Just the user name contains the column labeled as "CustomerName" ( "username") can be.

Should avoid the use of the plural name (such as CustomerNames), abbreviations (such as CN), and the name can not use spaces (such as Customer Name). If you insist on compliance with these rules, the future users will be easier when using the database.

Standardization is the key

Normalization refers to the database of all the information in the database and it is able to avoid data duplication and redundancy. Briefly, the normalized data is broken up into a plurality of smaller distribution related table, instead of all the presence of a large table.

The data normalization is a good database design practice helps improve efficiency. But be sure not to over-standardization, otherwise data will be scattered into too many small tables, but caused confusion.

Database design, documentation is important

In fact, the documentation is not cute, because it is too tired. But remember, documentation is critical for good database design, you can keep track of all the little details. Database design should be instructions, ER diagram, stored procedures and all other relevant information attached. Documentation should also provide sufficient information for programmers and end users to ensure that they are able to understand and use.

Privacy is a primary consideration

In many cases, the information stored in the database is encrypted information, privacy has become a matter of concern. In order to achieve maximum security, we should encrypt the password, use authentication to restrict access to databases, and use another server to host the database, not the server application resides. This will ensure that threaten your data from attack and invasion of privacy.

Consider long-term needs

Good database design should have the scalability, namely: in the case of increasing the amount still can withstand high workloads, and to guarantee running application. The workload may change the business, keep in mind this is essential in the design of the database. For example: If an e-commerce website, when sales growth is expected, visitors will increase rapidly in a month, so when designing a database that should these into account, so that the database can respond to the rapid growth of visitors and keep working at high operation under load.

Code, and use stored procedures

One of the common mistakes in database design, that is, without the use of stored procedures. Refers to a program stored in the operation data is readily available at hand code string stored in advance. For example, if you have a SQL query is a commonly used operating instructions, it will be stored procedures written in advance, rather than re-write when in use, will make work easy for them. Once you have stored procedures, you can step in and perform this SQL query load when necessary.

Write a lot of stored procedures is a difficult job, but if you take the time to complete and file with the record, then, the end user, using the database even more relaxed.

Invest time in database modeling and design

One of the best professional database design technique is to invest time and effort in database modeling and design. Developers common mistake is to ignore this step to save time, to focus on software development is more important to others. However, the database design is critical for the function of the application for protection. If you always want to save time, I do not think carefully about the design, then the future will need to spend more time maintaining the database, even redesign.

Test design

The test is also very critical step in database design, and will often be negligent treatment, or even skipped altogether, just to catch the DDL. We shall, before publishing project, take the time to thoroughly test database design to ensure that it meets the needs of all planned and running.

Epilogue

For data-centric projects, the database design is extremely important to the development process, we should also be tricky. Database design practice mentioned in the text, as carried out for the long-term needs proper planning, choosing the right database type, use consistent names and labels, data normalization, database design, documentation, and test ahead of us these are excellent in design the key issues to consider when database.

Original: https: //medium.com/quick-code/10-best-database-design-practices-1f10f3441730

This article CSDN translation, please indicate the source of the source.

【End】

Recommended Reading 

engage in vain! Docker quickly pull you into the door | Force program

Huawei P40 "a cell three children", the most expensive price of 10,854 yuan

no code era, the programmer how to keep their jobs?

GitHub suspected to have been the middleman attacks, you can not access the greatest Dark Web hosting providers no longer be black!

Why do you think the SaaS always fail? Clearly thought these four reasons may continue to fail!

million words a good text: the preparation of the contract Solidity intelligent programming Raiders, recommended collection!

You look at every point, I seriously as a favorite

Released 1895 original articles · won praise 40000 + · Views 17,280,000 +

Guess you like

Origin blog.csdn.net/csdnnews/article/details/105172298