Query-Based Aggregation and Partitioning in the NoSQL Abstract Model (NOAM)

P2MI-Community Service March - November 2024

Fazat Nur Azizah
STE-ITB

NG Kyle
STEI ITB

Abstrak
NoSQL Abstract Model (NOAM) is a data modeling technique for NoSQL databases. NoAM logical data modeling considers the communality of aggregate-based NoSQL databases. Although it is stated in NOAM modeling that data access patterns should be considered, there is no clear procedure on how to utilize data access patterns (queries) in the modeling process. In this study, data access patterns in the form of partitions and aggregations based on queries are applied in the NOAM modeling stage by utilizing three modeling artifacts: UML Class Diagram, query document, and frequency document as conceptual models. Modifications to the aggregate design method of Chen et al. are used as the aggregate formation procedure. The Navathe & Ra vertical partitioning algorithm is used as the aggregate partitioning method. Experiments to see the performance of the resulting data model were conducted on NoSQL databases of key-value store and document store types. The results of the experiments showed good performance in query operations with shortcomings in create/update operations in both key-value and document-store databases.

Kata kunci: basis data, pemodelan data, NoSQL, NOAM, UML class diagram

Pendahuluan
NoSQL is a database system that stores data in a format other than relational. The distinguishing feature of NoSQL databases is their schema-less nature, which gives developers flexibility in defining database structures. However, this doesn't mean a good data modeling process isn't necessary. Data modeling is necessary not only to define the required data structures but also to accommodate the development, maintenance, and operational needs of applications that utilize the database.

The NoSQL Abstract Model developed by Atzeni et al. (2020) as a data modeling technique for NoSQL databases has three activities in transforming conceptual models into data models on target NoSQL database systems, namely (1) conceptual data modeling and aggregation design; (2) NoAM data representation and aggregate partitioning process, and (3) implementation, namely transformation into target NoSQL database group data models.

The purpose of this research is to develop a NOAM data modeling process by utilizing data access patterns (queries) to support the aggregation and partitioning processes. As a conceptual model, a UML Class Diagram is used to define the structure of the data to be modeled, supplemented by query documents and query frequency documents.

Metodologi
The NoAM data model is defined as a collection of blocks that are uniquely identified by a key and consist of a non-empty set of entries identified as pairs <ek,ev> with ek: entry key and ev: entry value. There are three types of NoAM logical model representations, namely, (1) Entry per Aggregate Object (EAO), where each aggregate block is represented as an entry with ek empty and ev being the complex value of the aggregate object; (2) Entry per Top-level Field (ETF), where each aggregate is represented as a collection of unique entries where key is the name of the data attribute and value is the possibly complex attribute data; (3) Aggregate Partitioning, which is an intermediate form between ETF and EAO.

Gambar 1. Metode Pemodelan

This study develops two aspects of NOAM data modeling that have not been well defined, namely aggregation modeling at the conceptual modeling stage and aggregate portioning at the logical modeling stage of NoAM. The method developed in this study can be seen in Figure 1. This method is divided into two stages, namely (1) conceptual data modeling and aggregate model design and (2) transformation of the aggregate model into a logical NoAM model. The aggregation of the conceptual model is carried out in two stages, namely grouping based on relations and grouping based on queries. Each stage is intended for the aggregation of classes in the class diagram.

The conceptual model aggregation procedure is carried out in two stages: relation-based grouping and query-based grouping. Each stage is intended to aggregate the classes in the class diagram.

Pengujian
Two groups of tests were conducted: modeling and performance. Modeling tests aimed to generate schemas for the three NoAM logical models from UML Class Diagrams and other artifacts. Performance tests aimed to generate metrics in the form of the speed of each read/write operation on the database based on each schema generated from the modeling. The target database groups used were Document Store, namely MongoDB, and Key-Value Store, namely RiakKV. Performance tests were compared with previous work by Valiandi and Aizah (2022) and the method of Shin et al. (2017). The test results on the key-value database for read and update operations can be seen in Figures 2 and 3.

Test results show that the read query operations of all three NoAM models outperform the benchmark model. This demonstrates the results of class aggregation, which reduces the number of read queries needed to obtain all the required information. This contrasts with the benchmark model, which is more normalized. However, for the same reason, there are drawbacks to the update/create operations required for some collections, as the aggregate model has data duplication properties.

Gambar 2. Performa Query Read Key-Value
Gambar 3. Performa Update/Create Key-Value

Kesimpulan
The three NoAM logical models developed by the developed method have better read query performance and read query capability than the comparison models. The EAO logical model has the best query performance among the three NoAM models. The aggregate partitioning model has read query performance similar to EAO for key-value databases with relatively small data sets. Aggregate partitioning is less suitable for document-based data models.