Database design and optimization
It is important to clarify in connection with database design that this is not always a necessary process. Database design and optimization is only required for complex web applications, web pages within which entities and their properties must function as a complex system, such as searchable listing, sorting, grouping, editing and modifying, purchasing, or other relational and operational operations.
What is a database and why is it needed at all?
A database is a group of (mostly) structured data that is managed by a software tool capable of storing, retrieving, and editing that data. - not to be confused with the database manager, which is a tool for operating the database and organizing its processes. The purpose of databases is to provide (reliable) long-term (in other words: persistent) storage of data and to ensure its relatively fast retrieval.
So by the database of any application or website, we mean the set of data that the application must use or manage directly or indirectly.
Designing the logical structure of the database is not an underestimated task. Although there are a number of aspects that need to be taken into account in the design, such as the storage, breakdown, complexity of the data to be implemented and their relationship to other data, malfunctions resulting from long-term use of the database must be taken into account, and that the storage space of the data storage is minimized as much as possible. Database design and optimization deals with answering these questions
Why plan a database in advance?
The need for proper structural preparation / design of databases increases in direct proportion to the complexity of the website / application. The more complex an application we want to make, no matter what platform it is designed for, the more important it is to design the database. During the design of the database, a number of discoveries can be made, which at this planning stage can save us up to hundreds of thousands of forints, depending, of course, on the size of the project. A relation, or structural connection, recognized in the beginning, can save us hundreds of hours in development later on.
What can happen if we design a database poorly?
Poor database design can have a number of drawbacks, here are some of the disadvantages of poor database design:
- There is redundant data in the database (if modified, this must be done separately for each occurrence)
- Due to an unoptimized database, the website is slowly searching / listing
- Unauthorized users have access to certain elements and their properties (although this can still be corrected on the development page)
- Each subsequent extension requires more and more developer intervention
- Possible critical server error due to "foreign keys" pointing to each other in the database (these are extra important to pay attention to due to the vulnerability)
- more ...
To cite an example, we recently had a client who had to help with a fairly complex webshop system. However, the design of the database was not or not carefully enough, so the system was not suitable for managing the products and purchases of several partners at that time.
Because the testing was done with only one partner during the development, this problem was not revealed until we reviewed the system, pointed it out, and suggested and made changes to it. The end result is a system that not only dynamically manages the partners, but also sends the individual properties of the partners for each product / customer user / order to each system, and none of the partners see other partner`s properties to those entities. In addition, the product / order / customer edit view does not list all the properties (making the interface opaque) of all partners, but each partner only sees the properties of the entities to which they have rights.
Overall, however, we believe and consider it important to note that while in-depth database design is not always required and in many cases developers themselves can perfectly design the necessary structure and logic, it is worth taking this segment of development seriously, and at least review it and validate, because a poorly designed database can cost us a lot in the future.
18 years of experience in development, more than 200 finished project, hungarian and international clients Can we help in creating business supportive website?