{"id":83760,"date":"2025-01-05T02:39:29","date_gmt":"2025-01-05T02:39:29","guid":{"rendered":"https:\/\/www.essaybishops.com\/dissertations\/relational-v-s-key-value-stores-information-technology-essay\/"},"modified":"2025-01-05T02:39:29","modified_gmt":"2025-01-05T02:39:29","slug":"relational-v-s-key-value-stores-information-technology-essay","status":"publish","type":"post","link":"https:\/\/www.homeworkacetutors.com\/assessments\/relational-v-s-key-value-stores-information-technology-essay\/","title":{"rendered":"Relational V S Key Value Stores Information Technology Essay"},"content":{"rendered":"<div class=\"content position-relative mb-4\">\n<p>RDBMS is a database management system which describes the data as a relational model. It defines the data and the relations in form of tables. Tables consist of rows and columns. Relational models have a data model in place along with various defined constraints. SQL query is used to retrieve data from the database. SQL includes a lot of complex queries which involves integrity constraints and joins.<\/p>\n<p>Key-value distributed stores allows storage as a simple hash table. It stores keys and the keys map to a value. The search is conducted on the keys and it returns the value. The value is either stored as binary object or semi-structured like JSON.<\/p>\n<p>\u201cSQL databases are like automatic transmission and NoSQL databases are like manual transmission. Once you switch to NoSQL, you become responsible for a lot of work that the system takes care of automatically in a relational database system. Similar to what happens when you pick manual over automatic transmission. Secondly, NoSQL allows you to eke more performance out of the system by eliminating a lot of integrity checks done by relational databases from the database tier. Again, this is similar to how you can get more performance out of your car by driving a manual transmission versus an automatic transmission vehicle.\u201d[1]<\/p>\n<p>Key-Value store is part of the NoSQL community (Not Only SQL).<\/p>\n<p>Comparison<\/p>\n<h2>Relational<\/h2>\n<h2>Key-Value<\/h2>\n<p>Retrieving and storing data may require multiple tables<\/p>\n<p>They store data about a particular item (which is used as the key) along with that item<\/p>\n<p>Defines the model and application is developed to map to the model<\/p>\n<p>Application-driven model in the sense that the application needs to decide the model for storing and retrieving the data<\/p>\n<p>Data integrity and constraint checks are enforced by the defined model<\/p>\n<p>Data integrity and constraint checks have to be enforced at the application-level<\/p>\n<p>Data is accessed by using a query language like SQL<\/p>\n<p>Data is accessed by using the API of the key-value store<\/p>\n<p>As the data model and business logic are independently developed, the same data model can be re-used for a different application<\/p>\n<p>The data in the store is application-specific and the chances of reuse are less as compared to relational model<\/p>\n<p>Queries<\/p>\n<h2>Relational<\/h2>\n<p>We will store the information about books in a table. Consider the books table as below:<\/p>\n<p>id<\/p>\n<p>book<\/p>\n<p>author_name<\/p>\n<p>1<\/p>\n<p>A Whole New Mind<\/p>\n<p>Daniel Pink<\/p>\n<p>2<\/p>\n<p>The Black Swan<\/p>\n<p>Nassim Taleb<\/p>\n<p>3<\/p>\n<p>Power of Now<\/p>\n<p>Eckhart Tolle<\/p>\n<p>We will write the query in SQL as follows:<\/p>\n<p>Query 1: To get all books from a particular author<\/p>\n<p>select * from books where author_name = \u201cDaniel Pink\u201d;<\/p>\n<p>Query 2: To get all authors<\/p>\n<p>select author_name from books;<\/p>\n<h2>Key-Value<\/h2>\n<p>Consider that we have to run the same queries for a key-value database. We will have to store the information in 2 key-value pairs as below:<\/p>\n<p>authors =&gt; {\u201cDaniel Pink\u201d,\u201dNassim Taleb\u201d, \u201cEckhart Tolle\u201d}<\/p>\n<p>author:Daniel Pink =&gt; {\u201cA Whole new mind\u201d, \u201cDrive\u201d}<\/p>\n<p>We will write the query using the key-value store\u2019s API as follows:<\/p>\n<p>Query 1: To get all books from a particular author<\/p>\n<p>get(author:Daniel Pink );<\/p>\n<p>Query 2: To get all authors<\/p>\n<p>get(authors);<\/p>\n<p>The logic for searching is pretty complex in key-value but they are way faster than database.<\/p>\n<p>Performance<\/p>\n<p>There are some relational database operations that are a performance hit:<\/p>\n<p>Altering a table consists of:<\/p>\n<p>Updating the schema<\/p>\n<p>Inserting or deleting values for the (new\/old) rows and columns<\/p>\n<p>It may take hours to complete this operation for millions of rows. While performing such operations, the database tends to lock the tables and this results in a performance hit.<\/p>\n<p>Joins<\/p>\n<p>Joins are relatively slow. They are one of the main reasons of using relational models. Excluding joins would be as good as not using relational databases.<\/p>\n<p>Results of MySQL, Redis and Tokyo Tyrant performance comparison[2]<\/p>\n<h2>.<\/h2>\n<p>Scalability<\/p>\n<p>Relational databases tend to scale well when the entire database is located on a single server. The problem starts when the single server can no longer handle the requests and the data has to be partitioned across servers.<\/p>\n<p>One of the way to do that would be to use replication. The problem with that it that it takes time for the replication to initially sync with the master and be on par with the database. This might be a huge problem if the system is a social networking site and is used by lots of users.<\/p>\n<p>Another aspect is to shard the database. One of the techniques of database sharding involves horizontal partitioning. It basically divides the rows of a table to make a new partition. Each partition is called a shard.<\/p>\n<p>id | name<\/p>\n<p>| Daniel Pink<\/p>\n<p>| Nassim Taleb<\/p>\n<p>id | name<\/p>\n<p>| Daniel Pink<\/p>\n<p>| Nassim Taleb<\/p>\n<p>| Eckhart Tolle<\/p>\n<p>| David Hansson<\/p>\n<p>id | name<\/p>\n<p>| Eckhart Tolle<\/p>\n<p>| David Hansson<\/p>\n<h2>Problems with Database Sharding<\/h2>\n<p>You will have to shard the database keeping in mind the access patterns of the end-users<\/p>\n<p>Also, sharding means that you cannot run queries that involve join operations across shards as this would be inefficient<\/p>\n<p>Using referential integrity across databases is also a problem in sharding the database<\/p>\n<p>It\u2019s a complex system to implement in practice<\/p>\n<p>So, essentially sharding the database means that you lose all the advantages of the relational model.<\/p>\n<p>Key-Value databases can scale really well as it\u2019s not a single point of failure and can tolerate multiple failures. Addition of new nodes can also be done easily and thereby helps to make the application scalable.<\/p>\n<p>Application specifics<\/p>\n<p>Applications need to decide if they have to support more features or scaling.<\/p>\n<p>CAP<\/p>\n<p>\u201cThe CAP theorem, also known as Brewer\u2019s theorem, states that it is impossible for a distributed computer system to simultaneously provide all three of the following guarantees\u201d[3][4]<\/p>\n<p>Consistency states that every client has the same version or view of the data<\/p>\n<p>Availability states that the service will always be able and read and write can be performed on the server<\/p>\n<p>Partition tolerance means that the system can work even if some of the nodes go down<\/p>\n<p>Visual guide to NoSQL [5]<\/p>\n<p>Relational Database<\/p>\n<p>Consistency is the core of relational model and it is the reason for its massive usage in applications.<\/p>\n<p>If you design your database for consistency and availability then if the node fails there is no failover<\/p>\n<p>If you design by keeping consistency and partition-tolerance in mind then it means that the data would not be available till the failover node gets to a consistent state in case of any failure<\/p>\n<p>Key-Value stores provide Availability and Partition tolerance at the cost of Consistency<\/p>\n<p>You can adopt a model depending on the requirements of the application. If you are using a banking application, consistency is the most important aspect and you have to use a relational database.<\/p>\n<p>If you are building a social networking website used by millions of users, it\u2019s important that the data is available to the users immediately. In that case you can opt for a Key-Value database.<\/p>\n<p>Advantages of relational database<\/p>\n<p>Relational databases support transactions and all ACID properties. These are essential for business and critical applications to always have consistent data Example: payroll or banking applications<\/p>\n<p>RDMS tools are mature and have been tested over a period of time to solve various kinds of problems<\/p>\n<p>As SQL is a standard language used by all the relational database vendors with relatively minor changes in implementation, you have the flexibility to move to a different product as most of them use SQL for querying the database.<\/p>\n<p>It considers storing as well as searching as the same problem<\/p>\n<h2>Disadvantages of relational database<\/h2>\n<p>The developer has the overhead of making sure that the data model maps to the business logic<\/p>\n<p>Relational database is not distributed by nature and stores all the data in one server and this acts as a single point of failure<\/p>\n<p>Also in case of massive deployments, it requires specialized hardware such as SAN\u2019s to scale it<\/p>\n<p>Relational databases are not scalable<\/p>\n<p>Advantages of Key-Value stores<\/p>\n<p>It does not have any schema and so you are not bound by the model<\/p>\n<p>Simple queries like get, put and delete in most cases allows the system\u2019s performance to be a lot more predictable<\/p>\n<p>It can tolerate failures depending upon the configuration<\/p>\n<p>It can run on less-expensive hardware<\/p>\n<p>High performance as compared to relational databases<\/p>\n<p>Easy to scale by adding an extra nodes<\/p>\n<p>There is no need of a DBA to manage the database<\/p>\n<h2>Disadvantages of Key-Value stores<\/h2>\n<p>Generating dynamic reports from data is difficult<\/p>\n<p>There is no easy way to export data from the store<\/p>\n<p>Migrating from one product to another product is difficult in as the API used to access data is store specific<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>RDBMS is a database management system which describes the data as a relational model. It defines the data and the relations in form of tables. Tables consist of [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9800],"tags":[9809,9808,9810,9806],"class_list":["post-83760","post","type-post","status-publish","format-standard","hentry","category-uk-academic-help-for-students","tag-instant-assignment-help-australia-2026-nursing-case-study-report-writing","tag-homework-market-superior-essay-writers-take-my-online-class-exams-usa","tag-pay-me-to-do-your-assignment-uk-masters-phd-level-native-writers-only","tag-superior-essay-papers-writers-professional-2000-word-apa-essay-in-24-hours"],"_links":{"self":[{"href":"https:\/\/www.homeworkacetutors.com\/assessments\/wp-json\/wp\/v2\/posts\/83760","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.homeworkacetutors.com\/assessments\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.homeworkacetutors.com\/assessments\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.homeworkacetutors.com\/assessments\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.homeworkacetutors.com\/assessments\/wp-json\/wp\/v2\/comments?post=83760"}],"version-history":[{"count":0,"href":"https:\/\/www.homeworkacetutors.com\/assessments\/wp-json\/wp\/v2\/posts\/83760\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.homeworkacetutors.com\/assessments\/wp-json\/wp\/v2\/media?parent=83760"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.homeworkacetutors.com\/assessments\/wp-json\/wp\/v2\/categories?post=83760"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.homeworkacetutors.com\/assessments\/wp-json\/wp\/v2\/tags?post=83760"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}