Key-Value Stores in Databases
16 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is a key-value store, also referred to as?

  • object-oriented database
  • non-relational database (correct)
  • graph database
  • relational database

What is a requirement for a key in a key-value pair?

  • it must be unique (correct)
  • it must be a string
  • it can be null
  • it can be duplicated

What is the purpose of using a short key in a key-value store?

  • for better performance (correct)
  • for better data compression
  • for faster data retrieval
  • for better security

What type of data can a value in a key-value pair be?

<p>strings, lists, objects, etc. (A)</p> Signup and view all the answers

What is the purpose of the put operation in a key-value store?

<p>to insert a value associated with a key (C)</p> Signup and view all the answers

What is a characteristic of the key-value store designed in this chapter?

<p>high availability and tunable consistency (B)</p> Signup and view all the answers

What is an advantage of using a hash table to store key-value pairs in a single server key-value store?

<p>it keeps everything in memory (B)</p> Signup and view all the answers

What is a tradeoff that must be made when designing a key-value store?

<p>between consistency and availability (C)</p> Signup and view all the answers

What is a major limitation of memory access?

<p>It may not fit everything due to space constraints (A)</p> Signup and view all the answers

What is a common technique used to fit more data in a single server?

<p>Data compression (A)</p> Signup and view all the answers

What is another name for a distributed key-value store?

<p>Distributed hash table (B)</p> Signup and view all the answers

What does the CAP theorem state?

<p>It is impossible for a distributed system to provide all three guarantees: consistency, availability, and partition tolerance (B)</p> Signup and view all the answers

What does consistency mean in the context of the CAP theorem?

<p>All clients see the same data at the same time, no matter which node they connect to (C)</p> Signup and view all the answers

What is an AP key-value store?

<p>A key-value store that supports availability and partition tolerance (D)</p> Signup and view all the answers

What is a partition in the context of the CAP theorem?

<p>A communication break between two nodes (D)</p> Signup and view all the answers

What is a CA key-value store?

<p>A key-value store that supports consistency and availability (B)</p> Signup and view all the answers

Study Notes

Key-Value Stores

  • A key-value store is a non-relational database that stores unique identifiers as keys with their associated values.
  • Each key-value pair consists of a unique key and a value that can be accessed through the key.
  • Keys can be plain text or hashed values, and shorter keys are preferred for performance reasons.

Key-Value Pair Examples

  • Plain text key: “last_logged_in_at”
  • Hashed key: 253DDEC4
  • Values can be strings, lists, objects, etc.

Key-Value Store Operations

  • put(key, value): inserts “value” associated with “key”
  • get(key): gets “value” associated with “key”

Design Requirements

  • Small key-value pair size: less than 10 KB
  • Ability to store big data
  • High availability: system responds quickly, even during failures
  • High scalability: system can be scaled to support large data sets
  • Automatic scaling: addition/deletion of servers should be automatic based on traffic
  • Tunable consistency
  • Low latency

Single Server Key-Value Store

  • Storing key-value pairs in a hash table, keeping everything in memory
  • Optimizations:
    • Data compression
    • Store only frequently used data in memory and the rest on disk

Distributed Key-Value Store

  • Also called a distributed hash table, distributing key-value pairs across many servers
  • CAP theorem: it is impossible for a distributed system to simultaneously provide more than two of the three guarantees: consistency, availability, and partition tolerance

CAP Theorem Definitions

  • Consistency: all clients see the same data at the same time no matter which node they connect to
  • Availability: any client which requests data gets a response even if some of the nodes are down
  • Partition Tolerance: system continues to operate despite network partitions

CAP Theorem Classification

  • CP (consistency and partition tolerance) systems: sacrifice availability
  • AP (availability and partition tolerance) systems: sacrifice consistency
  • CA (consistency and availability) systems: sacrifice partition tolerance

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Description

Learn about key-value stores, a type of non-relational database that uses unique identifiers as keys to access associated values. Understand the properties of keys and values in this data pairing.

More Like This

Nonrelational Databases: Key-Value Pair
29 questions
Key-Value Stores Quiz
18 questions

Key-Value Stores Quiz

GlamorousPanther8038 avatar
GlamorousPanther8038
Use Quizgecko on...
Browser
Browser