Confusing MongoDB with Cassandra's column-family model
Thinking MongoDB uses fixed schema like relational DB
Mixing key-value with document storage
3. Given a large dataset requiring high availability and fast writes across multiple data centers, which database is most suitable?
medium
A. MongoDB
B. DynamoDB
C. SQLite
D. Cassandra
Solution
Step 1: Analyze requirements for high availability and multi-datacenter writes
Cassandra is designed for huge data with high availability and multi-region replication.
Step 2: Compare other options
MongoDB supports replication but less optimized for huge scale multi-datacenter writes; DynamoDB is scalable but less focused on multi-datacenter writes; SQLite is local and not distributed.
Final Answer:
Cassandra -> Option D
Quick Check:
High availability + multi-datacenter = Cassandra [OK]
Hint: Huge data + multi-region writes = Cassandra [OK]
Common Mistakes:
Choosing DynamoDB for multi-datacenter writes
Confusing SQLite as distributed database
Assuming MongoDB handles huge multi-region writes best
4. You try to use MongoDB's flexible document queries on DynamoDB but get errors. What is the likely cause?
medium
A. DynamoDB does not support flexible document queries like MongoDB
B. DynamoDB requires SQL syntax for queries
C. MongoDB uses column-family data model incompatible with DynamoDB
D. DynamoDB only supports relational tables
Solution
Step 1: Understand query capabilities of DynamoDB
DynamoDB supports key-value and simple queries but not rich flexible document queries like MongoDB.
Step 2: Eliminate incorrect causes
DynamoDB does not use SQL syntax, is not column-family, and is not relational.
Final Answer:
DynamoDB does not support flexible document queries like MongoDB -> Option A
Quick Check:
DynamoDB lacks MongoDB's flexible queries [OK]
Hint: DynamoDB lacks MongoDB's rich document query support [OK]
Common Mistakes:
Assuming DynamoDB uses SQL syntax
Confusing data models between MongoDB and Cassandra
Thinking DynamoDB supports relational tables
5. You need a database for an app that requires flexible JSON documents, automatic scaling, and global availability. Which approach best fits this need?
hard
A. Use DynamoDB with JSON support and global tables
B. Use MongoDB with sharding and replica sets only
C. Use Cassandra with column-family tables and no JSON support
D. Use SQLite with local JSON extensions
Solution
Step 1: Identify features needed
The app needs flexible JSON documents, automatic scaling, and global availability.
Step 2: Match features to databases
DynamoDB supports JSON documents, automatic scaling, and global tables for availability. MongoDB supports JSON but global availability requires extra setup and scaling is manual. Cassandra lacks native JSON support and SQLite is local only.
Final Answer:
Use DynamoDB with JSON support and global tables -> Option A
Quick Check:
JSON + auto scale + global = DynamoDB [OK]
Hint: DynamoDB global tables + JSON = best for scaling + availability [OK]
Common Mistakes:
Choosing MongoDB without considering scaling complexity