Unit III: SQL Using R 3.1
Total Page:16
File Type:pdf, Size:1020Kb
Unit III: SQL using R 3.1. Introduction to NoSQL: Define Nosql Database: NoSQL is originally referring to "non SQL" or "non-relational” and also called "Not only SQL” to emphasize that they may support SQL-like query languages. The RDBMS database provides a mechanism for storage and retrieval of data that is modeled in means other than the tabular relations used in relational databases. NoSQL databases are increasingly used in big data and real-time web applications. Benefits of NoSQL Database: No SQL databases are more scalable and provide superior performance. The NoSQL data model addresses several issues that the relational model is not designed to address: • Large volumes of structured, semi-structured, and unstructured data • Agile sprints, quick iteration, and frequent code pushes • Object-oriented programming that is easy to use and flexible • Efficient, scale-out architecture instead of expensive, monolithic architecture Classification of NoSQL databases based on data model: A basic classification based on data model, with examples: Document: Clusterpoint, Apache CouchDB, Couchbase, DocumentDB, HyperDex, Lotus Notes, MarkLogic, MongoDB, OrientDB, Qizx Key-value: CouchDB, Oracle NoSQL Database, Dynamo, FoundationDB, HyperDex, MemcacheDB, Redis, Riak, FairCom c-treeACE, Aerospike, OrientDB, MUMPS Graph: Allegro, Neo4J, InfiniteGraph, OrientDB, Virtuoso, Stardog Multi-model: OrientDB, FoundationDB, ArangoDB, Alchemy Database, CortexDB Differences between SQL database and NoSQL Database: SQL Databases NOSQL Databases Many different types including key-value One type (SQL database) with minor 1. Types stores, document databases, wide-column variations stores, and graph databases Developed in 2000s to deal with limitations of Development Developed in 1970s to deal with first 2. SQL databases, particularly concerning scale, History wave of data storage applications replication and unstructured data storage 3. Examples MySQL, Postgres, Oracle Database MongoDB, Cassandra, HBase, Neo4j Page | 1 Individual records (e.g., "employees") are stored as rows in tables, with each column storing a Varies based on database type. specific piece of data about that For example: record (e.g., "manager," "date hired," key-value stores function similarly to SQL etc.), much like a spreadsheet. databases, but have only two columns Separate data types are stored in ("key" and "value"), with more complex separate tables, and then joined Data Storage information sometimes stored within the 4. together when more complex queries Model "value" columns. are executed. For example, "offices" Document databases do away with the might be stored in one table, and table-and-row model altogether, storing all "employees" in another. When a user relevant data together in single "document" wants to find the work address of an in JSON, XML, or another format, which employee, the database engine joins can nest values hierarchically. the "employee" and "office" tables together to get all the information necessary. Typically dynamic. Records can add new Structure and data types are fixed in information on the fly, and unlike SQL table advance. To store information about rows, dissimilar data can be stored together as 5. Schemas a new data item, the entire database necessary. For some databases (e.g., wide- must be altered, during which time column stores), it is somewhat more the database must be taken offline. challenging to add new fields dynamically. Vertically, meaning a single server must be made increasingly powerful Horizontally, meaning that to add capacity, a in order to deal with increased database administrator can simply add more 6. Scaling demand. It is possible to spread SQL commodity servers or cloud instances. The databases over many servers, but database automatically spreads data across significant additional engineering is servers as necessary. generally required. Mix of open-source (e.g., Postgres, Development 7. MySQL) and closed source (e.g., Open-source Model Oracle Database) Supports Yes, updates can be configured to In certain circumstances and at certain levels 8. Transactions complete entirely or not at all (e.g., document level vs. database level) Page | 2 Specific language using Select, Data Insert, and Update statements, e.g. 9. Through object-oriented APIs Manipulation SELECT fields FROM table WHERE… Depends on product. Some provide strong Can be configured for strong 10. Consistency consistency (e.g., MongoDB) whereas others consistency offer eventual consistency (e.g., Cassandra) Page | 3.