T2 2024
HI5033
Database Design
Student Name:
Student ID:
Table of Contents
Database Optimization Indexing Techniques 3
Analytical Queries Using Bitmap Indexing 3
Real-Time Performance In-Memory Databases 4
Cost-Based Query Optimization 4
Query Optimization by Heuristic 5
Scalability by using Distributed Databases 5
Horizontal Scaling with sharding 6
Replication for Fault Tolerance 6
Performance Improvement Importance of Indexing 8
Hash Indexing’s Role in Exact Searches 8
Bitmap Indexing in Analytical Databases 8
Real-time applications using Memory Databases 8
Efficiency Improving the Query Optimization 9
Dynamic Query Optimization for the Changing Workload 9
High Availability Replication 9
Introduction
Today’s data world favors businesses greatly in that they need to store, access, and manage huge quantities of data that sometimes reach their storage capacities. Optimizing database performance has become necessary as data continues to grow exponentially, as user demands become more and more complex. All of this results in low operational efficiency and user dissatisfaction when databases are not properly optimized.
The goal of the database optimization techniques is to increase query execution speed, reduce resource consumption, and increase the scalability of DBMS. The core components of these techniques are indexing, which brings down data search time; query optimization, to do so in an efficient manner; in-memory databases, brought in use to open up more RAM for accessing data faster; and distributed databases, where the job is distributed to multiple nodes to handle larger amounts of work. As businesses become more complex and applications in industries like finance, e-commerce, healthcare, and social media need to provide real-time data access and scalability, this demand for database optimization. Nevertheless, each optimization technique comes with strengths and tradeoffs so organizations should pick those which work best with their particular use cases. It explores the key database optimization techniques, including their impact on performance and resource efficiency, and discusses how those techniques can be applied in modern database systems to address the scalability and dynamicity of large-scale environments.
Literature Review
Database Optimization Indexing Techniques
Indexing is one of the best data optimization techniques that is the most required thing to speed up data retrieval. The chief purpose of an index is to speed up query execution by minimizing the data scan required. The B-tree index is the most used option for indexing in relational databases, cause it organizes the data in a hierarchical form, and makes table search operations highly important. The other method, hash indexing, maps data to a fixed place using some hash function and is also used for exact matches. Indexes enable us to drastically improve query performance but add overhead at write time because the index must be updated every time the data changes. As the workload characteristics change, so must the index management, using selective application, not indiscriminate use. Index Maintenance and optimization Strategies are needed if you over-index (Pan et al, 2024, p1(2)).
Exact Match Hash Indexing
In the case when a small number of exact matches on common properties are needed (e.g. the primary key), hash indexing is very effective. Hashing is unlike B-trees, where data is ordered, thus good for value range queries, hash indexing maps each key to a fixed position in the database according to a hash function. In favorable conditions, this method gives us constant time access which makes it much faster for certain types of lookups. Although it is limited to hash indexing. However, data is not sorted, and it is an unsuitable implementation for range queries. However, hash collisions multiple keys that are mapped to the same location—can slow down the retrieval process, and extra techniques such as chaining need to be used to resolve collisions in it. Even with these limitations, we find that hash indexing is valuable, primarily in databases where equality searches are also common. For workloads that perform frequent retrievals of single records based on unique identifiers (e.g., user IDs in web applications), its speed and efficiency make it the tool of choice (Mostafa, 2020, p28(1)).
Analytical Queries Using Bitmap Indexing
Bitmap indexing is best implemented in systems that mostly carry out read operations, including data warehouse and big data analysis. Bitmap indexing involves the conduction of a bitmap for each value that is seen in a given column, where a single bit is used to show that a certain value from the bitmap is present in the dataset. Bitmap indexes are concise in a way that benefits a database with low cardinality or a limited number of values. The main advantage of bitmap indexing is that these bitmaps can be processed with the help of common bitwise operations, which reduces filtering and aggregative functions execution time for extremely large sets significantly. Due to this, bitmap indexing is most suitable for analytical queries since huge datasets can be searched for and combined in a very fast manner. Yet, bitmap indexing is less useful for transactional databases with a high frequency of updating records because updating the bitmaps is time-consuming. As a result, it should be used where the queries are on large data subjected to data warehousing but the modifications on the data are rare to avoid wastage of resources on the upkeep of complex optimized queries at the expense of data modification performance. (Yildiz, 2021, p2(1)).
Real-Time Performance In-Memory Databases
IMDBs have been revolutionizing database performance by storing the entire datasets in the system’s main memory (RAM), instead of the usual disk storage. Compared to disk I/O, memory access is one order of magnitude faster, which makes it possible to query the database much faster, in a manner of few microseconds. IMDBs are good if you have real-time data processing requests that require low latency, e.g., financial trading platforms and online gaming environments. IMDBs provide large performance gains but at a commensurate cost from the large cost of memory over disk storage. Furthermore, IMDBs are volatile, that is, after a system crash data is lost unless the system has implemented backup mechanisms, like transaction logs or periodic snapshots. Nevertheless, in-memory databases have become a necessary component for high-performance systems for which performance and real-time processing are core requirements. IMDBs eliminate the traditional bottlenecks of disk I/O, providing the performance needed by modern, data-intensive applications (Bao & Chi, 2023, p65(2)).
Cost-Based Query Optimization
Query optimization based on cost is a sophisticated technique that decides upon the most efficient query execution plan within a set of cost metrics. For a given query, the database management system (DBMS) produces several different, resource-consuming different in terms of CPU, memory, and disk I/O, execution plans. Finally, the optimizer will calculate the cost of each plan, picking the one that requires the lowest use of resources and gives the fastest response time\ But to the extent that cost-based optimization relies on statistical information about the database tables (table sizes and index usage, data distribution, etc.), it has to be reevaluated regularly. Well-applied, cost-based optimization can be a major factor in performance improvements in particular for complex queries containing multiple joins or subqueries. It is an important tool in modern databases because it can adjust query plans in a dynamic and dependent on resource availability (Rahman et al, 2024, p4(3)).
Query Optimization by Heuristic
Heuristic-based optimization makes the query execution process easy since it allows the query optimizer to follow pre-defined heuristics to give the query execution a manageable option. Heuristic-based optimization differs from cost-based based in that, unlike the latter, it relies on basic principles such as pushing down selections or performing joins early in the execution when calculating the cost of different plans. In environments where the statistical information needed for cost-based optimization is not available in the database, this method is particularly useful. While heuristic-based optimization is not always the most optimal plan, it is cheaper and still enables special performance improvement for fairly simple queries. More specifically, it is particularly useful in data distribution that doesn’t change very much, as well as in cases where workloads are simple. For more complex queries or more dynamic environments, however, heuristic-based methods may not perform to the best they can, and cost-based or dynamic optimizations may be more appropriate (Endris, 2020, p29(1)).
Dynamic Query Optimization
Dynamic query optimization first borrows from traditional query optimization in the sense that current query plans are considered when optimizing new queries (Kossmann et al, 2022, p3(4)). However, query plans can be adjusted on the fly according to the conditions at execution time. Dynamic optimization differs from static optimization since it determines a query execution plan given the current system load and data distribution every time the query is submitted, rather than once at query start time (statically). It is particularly appealing when evaluations may occur across different operating conditions with highly dynamic workloads, or in cases where the query pattern is unpredictable. Dynamic optimization makes these adjustments and keeps query execution as efficient as possible as the system’s state changes. Dynamic query optimization in a cloud-based environment provides resources dynamically and helps maintain performance by changing query plans according to resources. Although this technique adds a cost due to continuous monitoring overhead, its capability to cope with changing conditions is an important tool to ensure high performance in complex, real-time systems.
Scalability by using Distributed Databases
Databases distributed store data over multiple nodes or servers and so provide better scalability, availability, and fault tolerance when compared to traditional databases running on a single node. Distributing the data, lets organizations use more users (currently concurrently) without overwhelming the single server. Sometimes used techniques for distributed databases are partitioning (sharding) and replication to improve performance. Sharding creates the database as a set of smaller chunks, placed on separate servers, which the queries can pick from just what they need instead of the entire database. Replication makes sure that the data is saved across multiple nodes to ensure redundancy (data presence) in case the server crashes. However, with distributed databases, the question of data consistency across nodes also becomes complicated in the high transaction environment. Distributed databases have the option of pushing updates asynchronously and performing some sort of eventual consistency, trading consistency for performance. However, because of synchronous replication, there is a potential for latency especially where data is geographically distributed. As large-scale applications like global e-commerce platforms or cloud services, the applications on the databases that are distributed are very important (Krechowicz et al, 2021, p69027(2)).
Horizontal Scaling with sharding
Horizontal partitioning, or sharding, in a distributed database chops up large datasets into smaller more manageable parts, called shards. The system spreads out each shard in a subset of the data on a separate server, making it easier to handle higher loads, with queries distributed across multiple nodes. Performance and scalability are both ensured because each server is responsible for a smaller part of the dataset, such that less data has to be processed for each query. This technique is good in large applications, such as social media platforms and e-commerce websites, because the generated user data size increases so rapidly. However, sharding causes problems in transaction multi-shard management. These transactions are distinctly transactional, in that their coordination is complex and may require additional infrastructure such as a distributed transaction manager. All this should not sound discouraging as sharding is an easily implemented and widely adopted technique for increasing performance in systems that grow in scale horizontally. (Solat, 2024, p14(3)).
Replication for Fault Tolerance
A critical technical method for maintaining high availability and fault tolerance in distributed databases is replication. Replication ensures that the data is duplicated across different servers therefore if one server fails, another will continue to run and stop the time of the data loss. This can be replication which is synchronous (updates of data on replicas are propagated immediately across replicas) or asynchronous (updates of data on replicas are delayed to improve performance). Latency introduced by synchronous replication may exist especially in geographically distributed systems, but we guarantee data consistency. In contrast, Asynchronous replication performs well because it allows background updates to progress more quickly than all replicas being fully synchronized, then results in temporary data inconsistencies. High availability systems, for example, banking platforms or online marketplaces, have to perform well and must not auto-down, hence replication is a fundamental requirement. Replication ensures critical services are running by copying the data onto multiple nodes so that if any hardware or network failure occurs, important services will still be there (Srinivasan et al, 2023, p3684(1)).
Discussion
Performance Improvement Importance of Indexing
Today, indexing is one of the most powerful ways to improve query performance, especially in a read-heavy workload. To improve query times in reduced time without performing full table scans, techniques such as B-TV indexing are necessary.
Strength: It helps with faster retrieving data from large datasets.
Weakness: Overhead of index maintenance can degrade performance in write-heavy systems.
Hash Indexing’s Role in Exact Searches
It facilitates constant time access for equality searches, hash indexing is the go-to option for use cases in which there are a lot of exact matches.
Strength: Provides fast lookup time for a particular data set and enhances overall system performance in more practical uses like identity verification, or unique key retrieval.
Weakness: It doesn't support range queries and has a hashtable collision that needs additional handling strategies.
Bitmap Indexing in Analytical Databases
In data warehouses, bitmap indexing is very efficient, since there is always a large scale of analytical queries to be processed as quickly as possible.
Strength: Useful when the data considered is very low cardinality, is good for filtering, but also aggregating.
Weakness: Bitmap maintenance can be expensive, and thus less efficient in transactional systems with frequent updates.
Real-time applications using Memory Databases
IMDBs remove the bottleneck of disk I/O so that applications can retrieve and process data on the fly, in real-time.
Strength: it provides extremely fast access speeds that are critical to applications that need real-time analytics such as financial trading.
Weakness: Memory is too expensive, so it is impractical for large datasets, and volatile data has to be backed up in addition to the usual means of memory.
Efficiency Improving the Query Optimization
In large and relational databases, you need to do query optimization to select the best execution plan for your complex query.
Strength: For complex queries that provide multiple tables and joins it reduces execution time and resource consumption.
Weakness: To perform optimally, cost-based optimization requires detailed statistical data about the database to work out.
Dynamic Query Optimization for the Changing Workload
To cope with the changing appearance of data, dynamic query optimization makes the query plan adjust in real time to the changes in the system load and data distribution.
Strength: It makes the database bear high performance when conditions change, making it fit for dynamic environments.
Weakness: It additionally has overhead that requires monitoring and adjusting execution plans at runtime.
Distributed system sharding
Sharding distributes data over many servers so we don’t have to handle large datasets in a single server without being overwhelmed.
Strength: It spurs the load to other servers to improve scalability and system performance.
Weakness: It’s complex to implement and manage distributed transactions across different shards.
High Availability Replication
The replicability of the system makes sure data will be even in case of hardware failure.
Strength: It provides strength against faults and reduces downtime.
Weakness: On the one hand, synchronous replication may cause an added latency, on the other hand, the asynchronous one may result in temporary inconsistencies.
Conclusion
This report explores the key techniques and shows how the ability to optimize database pace is a mission-critical feature to enhance the performance and scalability of Database Administering Systems (DBMS). Each one of these techniques—such as indexing, in-memory databases, query optimization, and distributed databases—gives its benefit for a certain kind of business application. B-tree, hash indexing, and bitmap indexing allow for faster data retrieval, but they must be controlled well if there are too many writes. Real-time data access through in-memory databases is great but it comes for a price. Query optimization guarantees query execution efficiency, and dynamic optimization provides increased flexibility for an ever-changing environment. Finally, distributed databases also enable horizontal scaling and fault tolerance using techniques such as sharding and replication, but come with a price of complexity in figuring out how to maintain consistency. All things considered, it was found that an effective and efficient database administration depends not just on the techniques themselves, but rather on the workload, the characteristics of the data, and the performance goals that are best used.
References
Bao, D.Q. & Chi, N.K., 2023. Database Optimization Techniques for Enterprise Systems: Strategies for Enhancing Performance, Scalability, and Reliability in Large-Scale, Mission-critical Architectures, International Journal of Sustainable Infrastructure for Cities and Societies, vol.8, no.9, pp.54-85, https://vectoral.org/index.php/IJSICS/article/download/142/131
Endris, K.M. 2020. Federated Query Processing over Heterogeneous Data Sources in a Semantic Data Lake (Doctoral dissertation, Universitäts-und Landesbibliothek Bonn), pp.1-157, https://core.ac.uk/download/pdf/322961743.pdf
Kossmann, J., Papenbrock, T. & Naumann, F. 2022. Data dependencies for query optimization: a survey, The VLDB Journal, vol.31, no.1, pp.1-22, https://link.springer.com/article/10.1007/s00778-021-00676-3
Krechowicz, A., Deniziak, S. & ?ukawski, G. 2021. Highly scalable distributed architecture for NoSQL datastore supporting strong consistency, IEEE Access, 9, pp.69027-69043, https://ieeexplore.ieee.org/iel7/6287639/9312710/09424000.pdf
Mostafa, S.A. 2020. A case study on B-Tree database indexing technique, Journal of Soft Computing and Data Mining, vol.1, no. 1, pp.27-35, https://penerbit.uthm.edu.my/ojs/index.php/jscdm/article/download/6828/3723
Pan, J.J., Wang, J. & Li, G. 2024. Survey of vector database management systems, The VLDB Journal, pp.1-25, https://arxiv.org/pdf/2310.14021
Rahman, M.M., Islam, S., Kamruzzaman, M. & Joy, Z.H. 2024. Advanced Query Optimization in SQL Databases For Real-Time Big Data Analytics, Academic Journal on Business Administration, Innovation & Sustainability, vol.4, no.3, pp.1-14, https://www.allacademicresearch.com/index.php/AJBAIS/article/download/77/72
Solat, S. 2024. Sharding Distributed Databases: A Critical Review, arXiv preprint arXiv:2404.04384, pp.1-19, https://www.researchgate.net/profile/Siamak-Solat/publication/379753203_Sharding_Distributed_Databases_A_Critical_Review/links/664bb71822a7f16b4f3e14f3/Sharding-Distributed-Databases-A-Critical-Review.pdf
Srinivasan, V., Gooding, A., Sayyaparaju, S., Lopatic, T., Porter, K., Shinde, A. & Narendran, B. 2023. Techniques and Efficiencies from Building a Real-Time DBMS, Proceedings of the VLDB Endowment, 16(12), pp.3676-3688, https://aerospike.com/developer/p3676-srinivasan.pdf
Yildiz, B. 2021. Optimizing bitmap index encoding for high-performance queries, Concurrency and Computation: Practice and Experience, vol.33, no. 18, pp.1-9, https://onlinelibrary.wiley.com/doi/abs/10.1002/cpe.5943


