Basic Concept
Which main feature distinguishes an in-memory database from a traditional disk-based database?
- Data is primarily stored in RAM
- Data is only accessible through spreadsheets
- Requires hardware encryption
- Data is split into multiple servers automatically
- Supports only single-user access
Common Use Cases
What is a typical scenario where an in-memory database like Redis is preferred?
- Storing frequently changing leaderboard scores in a gaming application
- Archiving old payroll records for long-term compliance
- Backing up all corporate data
- Storing large media files for streaming
- Maintaining paper document records
Data Types
Which of the following is a built-in data structure supported by Redis?
- Sets
- Documents
- Records
- Graphs
- Sheets
Performance Advantage
Why are in-memory databases usually faster than disk-based databases for read and write operations?
- RAM access times are much lower than disk access times
- They use larger display screens
- They compress data before reading
- They always transmit data over the internet
- They require more user passwords
Persistence
Which statement best describes Redis's approach to data persistence?
- It can optionally save data to disk to recover after a restart
- It never provides any way to save data
- Data is always erased after every operation
- It only supports retention for one day
- Persistence requires external tools only
Key-Value Model
In Redis, how is information typically stored?
- As key-value pairs
- In sequential tables
- As fixed-length arrays
- Within XML documents
- By color-coded folders
Atomicity
When a command like INCR is used in Redis to increment a value, what property is guaranteed?
- The operation is atomic
- The operation is multilingual
- Updates happen once per week
- The value is always doubled
- Access is blocked for all users
Cache Use
How can Redis be used as a cache in a web application?
- By temporarily storing frequently accessed data for faster retrieval
- By encrypting user passwords before storage
- By generating random user locations
- By storing only email messages
- By deleting data every minute
Data Expiry
Which Redis feature allows automatic deletion of data after a specified period, such as when storing user session tokens?
- Expiration time (TTL)
- Dual locking
- Recursive resets
- Color tagging
- Mirrored sessions
Command Syntax
Which of the following commands sets a value called 'fruit' to 'apple' in Redis?
- SET fruit apple
- PUT fruit=apple
- ADD (fruit, apple)
- INSERT apple INTO fruit
- VALUE fruit: apple