<<

Comparative Study of SQL and NoSQL Ruihan Wang; Zongyan Yang University of Rochester

Introduction NoSQL and Non-Relational Our result can also be supported Yishan Li and Sathiamoorthy Manoharan found that while NoSQL databases are generally good at storing key-value data. They also observed that in NoSQL • For the discussion of our paper, we will narrow the SQL vs • By the middle of the 2000’s, relational supremacy was database, different types of operation will to various NoSQL topic down to the comparison and performance just about to end. In particular, the difference in application performance [2]. Although not all NoSQL databases perform better advantage of NoSQL over SQL based on models and theorems, architectures between the client-server era and the era of than SQL database in terms of speed, NoSQL still have advantages together with the limitations that result from those factors. massive web-scale applications created pressures on the generally. • SQL stands for Structured , invented as a that could not be relieved through standard high-level interface for most of databases, usually used incremental innovation Conclusions as DDL and DML for the management of relational database • Relational databases use ACID transactions to handle management system (RDBMS). Databases based on the consistency across the whole database. However, this inherently include MySQL, MS-SQL Server, Oracle clashes with a cluster environment, so NoSQL databases offer a In a word, it‘s hard to simply say SQL is better than NoSQL, or database and so on, each of them supports SQL as the query range of options for consistency and distribution. The common vice versa. Both SQL and NoSQL have advantages and language. characteristics of NoSQL databases are: relational-model free, disadvantages under different situations. As for speed, NoSQL is • NoSQL, which stands for Not Only SQL, however is a non- running well on clusters, open-sourced, and the most important generally faster than SQL, especially for key-value storage in our relational database management system. Leading NoSQL one, schema less. Speed Comparisons experiment; while SQL generally has much stronger consistency databases include MongoDB, Cassandra, CouchDB, HBase, etc. • NoSQL databases operate without a schema, allowing freely check that keep all data valid. With the current popularity of “”, NoSQL databases adding fields to database records without having to define any We did the comparison of reading and writing speed SQL databases, for the reason that they are oriented, have were pioneered and improved a lot by top internet companies changes in structure first, which is particularly useful when between MySQL, Oracle and MongoDB from advantages of vertical and strong consistency. As like Amazon, Google and LinkedIn. dealing with non-uniform data and custom fields which forced stssoft.com/benchmarks, developed by STS SOFT Company. consistency is prioritized in SQL databases, the database manage • The main difference between non-relational data model and the relational databases to use names like custom field tables that The machine we tested on has the following configurations: system has to do lots of work to maintain the consistent state, are awkward to process and understand. which will definitely compromise the performance. It's also traditional one is, the non-relational model is designed for • OS: Microsoft Windows 10 Pro 64 bit processing huge amount of data in a second, with relatively low expansive to add new columns in SQL systems. NoSQL databases, • CPU: Intel () Core (TM) i5-3210M CPU @ 2.50GHz as they are designed to be flexible and fast, have less constrains consistency requirement. As a consequence, it relaxes the ACID General Comparisons constrains provided by many relational database systems, in • RAM: DDR3 8GB 1333MHz than SQL. As a result, they can reduce the overhead of consistency exchange for the improvement of performance. • Storage: SAMSUNG MZ7PC128HAFU-000H1 checking and process faster. Besides, NoSQL store data as objects • NoSQL is like a movement rather than a technology. Relational • Database Settings: InsertsPerQuery, 5000; Indexing (documents or key-value pair), which means it can be store data databases can not be replaced and are the most common form Technology, BTree; Randomness, 100% distributed. On the other hand, NoSQL database may not fully SQL and Relational Databases of database in use. The familiarity, stability, feature set, and support ACID transactions, which may result data inconsistency. available support are compelling arguments for most We gathered data like average speed and number of records, got projects.[3] The change is that now we see relational databases the results from below. We could see NoSQL, especially Oracle ACID properties: In order to maintain consistency in a relational as just one option for data storage. has a big speed advantage over MySQL. References database, before and after transaction, certain properties are followed. These are called ACID properties, standing for • Normalization can help manage data in an efficient way at the cost of the performance of data processing, because RDBMS atomicity, consistency, isolation, durability. [1] International Journal of Advanced Research in Computer has to meet the constraint of ACID. NoSQL requires a lower • The atomicity property requires that each transaction be "all or Science and Software Engineering, ‘SQL and NoSQL Databases’ degree of normalization than RDBMS and offers an alternative nothing": if one part of the transaction fails, then the entire by Vatika Sharma, Meenu Dave. by eliminating schemas at the expense of relaxing ACID transaction fails, and the database state is left unchanged. principles to satisfy the speed, flexibility, and distribute [2] IEEE Pacific RIM Conference on Communications, • The consistency property ensures that any transaction will bring requirement. The following chart shows how the same data Computers, and Signal Processing ‘ A performance comparison of the database from one valid state to another. Any data written to appears within schema in SQL and without schema in NoSQL SQL and NoSQL databases’ by Li Yishan, Manoharan the database must be valid according to all defined rules looks like: Sathiamoorthy including constraints, cascades, triggers and any combination [3] ‘Comparative Study of SQL & NoSQL Databases’ by Supriya thereof. S. Pore, Swalaya B. Pawar • The isolation property ensures that the concurrent execution of [4] Rick Cattell. 2011. Scalable SQL and NoSQL data stores. transactions results in a system state that would be obtained if SIGMOD Rec. 39, 4 (May 2011), 12-27. transactions were executed sequentially. [5] Han J, Haihong E, Le G, et al. Survey on NoSQL database[C] • The durability property ensures that once a transaction has been Figure 2. Reading Speed vs Records Pervasive computing and applications (ICPCA), 2011 6th committed, it will remain so, even in the event of power loss, international conference on. IEEE, 2011: 363-366. crashes, or errors. [6] S. H. Aboutorabi, M. Rezapour, M. Moradi and N. Ghadiri, “Perfor- mance evaluation of SQL and MongoDB databases for big The ACID properties, in totality, provide a mechanism to ensure e-commerce data,” 2015 International Symposium on Computer correctness and consistency of a database in a way such that each Science and Software Engineering (CSSE), Tabriz, 2015, pp. 1-7. transaction is a group of operations that acts a single unit, produces consistent results, acts in isolation from other operations and Acknowledgement and Contact updates that it makes are durably stored.

Ruihan Wang, Department The following gives a rough description of those differences [email protected] and we will go in deep and specifically to focus on the performance of speed of SQL and NoSQL. Zongyan Yang, Data Science Department Figure 3. Writing Speed vs Records [email protected]

RESEARCH POSTER PRESENTATION DESIGN © 2015 www.PosterPresentations.com