An Approach for Modeling Polyglot Persistence
Total Page:16
File Type:pdf, Size:1020Kb
An Approach for Modeling Polyglot Persistence Cristofer Zdepski, Tarcizio Alexandre Bini and Simone Nasser Matos Federal Technological University of Parana, Av Monteiro Lobato, s/n - Km 04, 84016210, Ponta Grossa, Parana, Brazil Keywords: NoSQL, Database Design, Polyglot Persistence, Logical Level Design. Abstract: The emergence of NoSQL databases has greatly expanded database systems in both storage capacity and performance. To make use of these capabilities many systems have integrated these new data models into existing applications, making use of multiple databases at the same time, forming a concept called ”Polyglot Persistence”. However, the lack of a methodology capable of unifying the design of these integrated data models makes design a difficult task. To overcome this lack, this paper proposes a modeling methodology capable of unifying design patterns for these integrated databases, bringing an overview of the system, as well as a detailed view of each database design. 1 INTRODUCTION cations also brings out some weaknesses of the relati- onal model by working with static schemas. The popularization of Web 2.0 brought an dramati- Inspired by this limitations, NoSQL databases cally increase in data generation. Nowadays databa- have emerged as the solution to the growing need ses easily exceed petabytes scale, with daily increase of systems for information. As they expand over rates in the terabytes scale. As an example we can the Internet its data increases even faster. Accor- take the Facebook database, which in 2014 had a size ding to (Sadalage and Fowler, 2012) and (Cattell, of 300 petabytes, and a daily increase rate of 600 tera- 2011) the biggest goal of NoSQL databases is their bytes, according to (Wilfong and Vagata, 2014). Thus scalability skills that are required for next genera- the recent changes, mainly caused by Web 2.0, at the tion web applications. While relational databases rely level of users, infrastructure and applications charac- on high consistency, provided by ACID properties, teristics has transformed the use of relational model many NoSQL databases works with BASE (Basically an increasingly difficult task. Available, Soft state, Eventually consistent) proper- Relational databases have been the market leaders ties which aims to provide high levels of availability for the past 40 years due to their great ability to adapt and resilience even though this may compromise con- to most problems. The long time of existence also sistency for a few moments. gives it a high level of maturity, and is still the most There are many different NoSQL databases no- recommended for many applications, mainly the ones wadays and their data structures vary from one anot- that need a high level of consistency on data mani- her. According to (Sadalage and Fowler, 2012; Has- pulation and storage. One of the main characteris- hem and Ranc, 2016; Kaur and Rani, 2013; Abra- tics of relational databases is the implementation of mova et al., 2014) NoSQL databases can be classi- ACID properties (Atomicity, Consistency, Isolation fied into the following data models, grouped by their and Durability). These properties ensures a strong main characteristics: (1) Key-value; (2) Document- consistency and guarantees validity of data even in the Oriented; (3) Column-family; (4) Graph databases. event of errors, like power or network failures. Even among the different categories, the concept of Despite meeting the needs of many different cur- ”schema-less” is widely used in the NoSQL databa- rent applications, the relational model begins to show ses. Many of them have no schema definition or data problems when dealing with very large databases, constraints. Even object creation that is mandatory in mainly with performance problems. The main reason relational databases is often not required in NoSQL is in fact that they were not designed to be scaled, es- databases as they are created when used. pecially when it comes to horizontal scalability. The Database design spends a great deal of time on inherent need for dynamic schema of Web 2.0 appli- developing conceptual, logical, and physical models. 120 Zdepski, C., Bini, T. and Matos, S. An Approach for Modeling Polyglot Persistence. DOI: 10.5220/0006684901200126 In Proceedings of the 20th International Conference on Enterprise Information Systems (ICEIS 2018), pages 120-126 ISBN: 978-989-758-298-1 Copyright c 2019 by SCITEPRESS – Science and Technology Publications, Lda. All rights reserved An Approach for Modeling Polyglot Persistence The main purpose of these models is to ensure that the deling systems based on what we can call a ”Polyglot structures needed to store the data will be properly Database System”, which uses multiple different data constructed and will meet the system requirements. models, each one with their own particular objectives. Even so, database design is not commonly applied This paper aims to propose a modeling methodology to NoSQL databases. The so-called ”schema-less” in capable of integrating multiple different data models NoSQL databases may give the impression of an at- into a single system, making the best of each one and tempt to eliminate the need for data modeling, but the maintaining an unified view of the system as a whole. modeling aims more than just the schema definition. This paper is organized as follows. Section 2 pre- Database modeling mainly seeks a better understan- sents some fundamental concepts of database design ding and easier visualization of the data structures to and related works. Section 3 presents the suggested be used. modeling proposal and finally, Section 4 concludes (Sadalage and Fowler, 2012) mentions that the al- and presents future works. legation of absence of schema in NoSQL databases is misleading. Even if the database does not consider a schema associated with the data being stored, such 2 BACKGROUND AND RELATED a schema must be defined by the application because data needs to be understood by the application in or- WORKS der to be processed or stored. If the application fails to parse the data, we have a schema mismatch and The absence of design methodologies for NoSQL da- the application could not function. Therefore, even tabases is a topic already explored by several authors in ”schema-less” NoSQL databases, it is important to who proposed different solutions. Many of these so- have a suitable design so that the data can be properly lutions are limited to specific data models or steps in stored and processed. database design and none attempts to explore a met- The correct use of NoSQL databases have to be al- hodology that can standardize the complete design of ways considered. Despite its current popularity, many databases for emerging data models in conjunction applications do not justify the use of a NoSQL data- with existing ones. The combination of multiple da- base and, if done, can lead to more losses than gains. tabases with different data models in a single system, Some systems will require the use of a NoSQL data called by (Sadalage and Fowler, 2012) of ”Polyglot model only for part of their data, while the other parts Persistence” is also a topic barely explored in data- may be more suitable for another NoSQL or even a base design. relational data model. It is a consensus among several authors such as Complex applications can take better advantage of (Rob and Coronel, 2007; Ramakrishnan and Gehrke, using different data models for storing and processing 2000; Martyn, 2000) that the database design is es- different parts of their data. An e-commerce system sentially divided into 3 steps: (1) Conceptual Design, could, for example, be implemented according to Fi- (2) Logical Design and (3) Physical Design. Con- gure 1. This would bring distinct structures to system ceptual design aims to translate the requirements into parts, making the best use of the capabilities of each a conceptual database schema. According to (Korth data model. Still, an unified view would simplify the and Silberschatz, 1986), the model developed at this visualization of interactions between the parts, allo- step provides a detailed overview of the whole system wing an overview of the system as a whole. context. It is well known that the conceptual design is technology-independent and for this reason it can be applied to both relational database and NoSQL. Unlike the conceptual design, the logical design brings the conceptual model previously developed to a step much more dependent on the adopted data mo- del. According to (Rob and Coronel, 2007), the lo- gical design realizes the translation of the conceptual model for the internal model of a DBMS (Database Management System) and for this reason it is depen- dent on data model to be employed. Many of the spe- cificities of each database should be explored, such as Figure 1: Suggested E-Commerce Platform Database. the supported data types and the format the data will be stored, such as tables, documents or nodes and ed- These kind of complex applications are the object ges. of study of this paper. It explores a proposal for mo- In the physical design step physical peculiarities 121 ICEIS 2018 - 20th International Conference on Enterprise Information Systems of each database software are treated. These pe- that uses IDEF1X to represent the aggregate structu- culiarities involve specific types of data, forms of res. But graph structures still can not be represented storage, partitioning, clustering capabilities among by this modeling style. others. (Martyn, 2000) mentions that the main pur- We can therefore note that several efforts exist in pose of physical design is to make the data model order to elaborate processes capable of assisting in the machine efficient. The physical definition is neces- design of these NoSQL databases, but generally are sary to ensure a better match of the data to the storage isolated efforts in specific areas.