DM - NOSQL EXAM QUESTIONS AND 100% CORRECT ANSWERS
NoSQL vs Relational Databases - ANSWER Relational databases use
tables/rows/columns, need a predefined schema, and are vertically scalable. NoSQL
databases are schema-less, fast, horizontally scalable, and do not guarantee ACID
transactions.
Types of NoSQL Databases - ANSWER Key-value databases, document databases,
column family databases, and graph databases.
Key-Value Databases - ANSWER Simplest NoSQL databases that get and set values
associated with a unique key.
Key - ANSWER Examples: DataCampCourse:123:name, Client456, 123456789. Keys can
be any binary sequence and are unique.
Value - ANSWER Associated with a key. Examples: numbers, strings, JSON, images.
There may be size restrictions on values.
Advantages of Key-Value Databases - ANSWER Simple key-value tuple, schema-less,
fast operations, flexible data types, horizontally scalable with sharding.
Basic Operations key value - ANSWER Put: inserts or updates a key-value pair. Get:
retrieves the value for a given key. Delete: removes a key and its value.
Limitations of Key-Value Databases - ANSWER Only search by key, not suitable for
complex queries. Some key-value databases allow secondary indexing or search by
multiple keys.
Suitable Use Cases key value - ANSWER User sessions, user profiles/preferences,
shopping carts, real-time recommendations, advertising.
, Unsuitable Use Cases key value - ANSWER Finding data by its value, or processing
relevant data having complex interrelations with each other.
Redis - ANSWER An in-memory, very fast key-value database that is also used for
caching and as a message broker. Capable of flushing the data to disk.
Redis Data Structures - ANSWER Strings, lists, sets, hashes are available. Example -
SET name Ann, RPUSH my_numbers 1 2 3, HMSET user:123 name Ann surname Smith.
Popular Uses of Redis - ANSWER Caching query results, session storage, real-time
analytics, leaderboards, messaging queues.
Redis Features - ANSWER Atomic operations, transactions, Lua scripting,
asynchronous replication, supports many programming languages: Python, R, C#, Java,
JavaScript.
Redis Cloud Services - ANSWER Available via AWS Elasticache, Microsoft Azure Cache
for Redis, and Alibaba ApsaraDB.
Case Study: Editoo - ANSWER Small business using Redis to store user sessions and
cache database queries. Results: reduced downtown improved performance and future
migrations from relational databases to Redis.
NoSQL vs Relational Databases - ANSWER Relational databases use
tables/rows/columns, need a predefined schema, are vertically scalable whereas
NoSQL databases are schema-less, fast, horizontally scalable, and do not guarantee
ACID transactions.
Types of NoSQL Databases - ANSWER Key-value databases, document databases,
column family databases, and graph databases.