RTUComputer ScienceYr 2023 · Sem 82023

Q20Big Data Analytics

Question

10 marks

Classify NoSQL databases and explain the CAP Theorem in detail.

Answer

NoSQL databases fall into four categories, each making specific trade-offs according to the CAP Theorem.

NoSQL Classifications: 1. Key-Value Stores (e.g., Redis, DynamoDB): Store data as a hash table where a unique key points to an item. 2. Document Stores (e.g., MongoDB, Couchbase): Store semi-structured data like JSON; queries can be made on document attributes. 3. Wide-Column Stores (e.g., Cassandra, HBase): Store data in tables with flexible columns, optimized for fast aggregations. 4. Graph Databases (e.g., Neo4j): Store data as nodes and edges to handle complex relationships. The CAP Theorem: Proposes that a distributed system can provide at most two of the following: - Consistency (C): Every read receives the most recent write or an error. - Availability (A): Every request receives a response, without guarantee it contains the most recent write. - Partition Tolerance (P): The system continues to operate despite arbitrary network partitions. Since network partitions (P) are unavoidable in distributed systems, NoSQL systems typically choose between CP (e.g., HBase, MongoDB) and AP (e.g., Cassandra).

CAP Theorem Triangle Diagram
CAP Theorem Triangle Diagram
Back to Paper