1. Home
  2. Explore
  3. Computer Science
  4. Database Selection in System Design

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Database Selection in System Design

  • 59Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Database Selection
In system design, the choice of database most directly affects how well a design meets its
requirements.

59 questions

  1. 1
    In system design, the choice of database most directly affects how well a design meets its
    _____
    requirements.
    Hint

    Think about requirements such as scale and performance.

    Answer

    non-functional

    Explanation

    The content distinguishes functional requirements, which can often be met with different databases, from non-functional requirements that database choice can strongly affect.

  2. 2
    The three main factors for choosing a database are data structure, query pattern, and required
    _____
    .
    Hint

    Consider how much demand or data the system must handle.

    Answer

    scale

    Explanation

    Database selection depends on the structure of the data, the queries the system performs, and the scale it must support.

  3. 3
    A database optimized for one data structure or query pattern may not be the best choice for a different
    _____
    .
    Hint

    Think of the specific needs the system must satisfy.

    Answer

    use case

    Explanation

    Different databases are optimized for different kinds of data structures, query patterns, and scale requirements, so the best fit depends on the use case.

  4. 4
    A user profile with standard fields such as name, email, and city is an example of
    _____
    data.
    Hint

    This kind of information can be modeled as rows and columns.

    Answer

    structured

    Explanation

    Structured information can be readily organized into tables with defined rows and columns, as with standard user profile fields.

  5. 5
    When data can be modeled as tables containing rows and columns, it is considered
    _____
    data.
    Hint

    Think about data with a predictable, tabular organization.

    Answer

    structured

    Explanation

    The content defines structured information as information that can easily be modeled in tables with rows and columns.

  6. 6
    A system design interview may require a combination of databases to satisfy functional and
    _____
    requirements.
    Hint

    These include constraints such as scale and performance.

    Answer

    non-functional

    Explanation

    Real-world designs may combine databases because a single system can have several different data and query needs, along with non-functional requirements.

  7. 7
    A cache commonly stores a
    _____
    and a value, where the key identifies the requested data.
    Hint

    It is the lookup part of a key-value pair.

    Answer

    key

    Explanation

    Caching solutions commonly store data as key-value pairs, with the key used to retrieve the corresponding value.

  8. 8
    In a cached database query, the cache key can correspond to the query's
    _____
    clause.
    Hint

    This SQL clause specifies which records to find.

    Answer

    where

    Explanation

    The content notes that a cache key can be based on the query's where clause, or on request parameters for an API call.

  9. 9
    When a remote service call has high latency, storing its response locally in a cache can reduce repeated
    _____
    calls.
    Hint

    These calls go to another service.

    Answer

    remote

    Explanation

    A cache can store a remote system's response locally, avoiding repeated calls whose latency is high.

  10. 10
    Redis, Memcached, etcd, and Hazelcast are examples of
    _____
    solutions.
    Hint

    They can store values for quick retrieval by key.

    Answer

    caching

    Explanation

    The content lists Redis, Memcached, etcd, and Hazelcast as commonly used caching solutions.

  11. 11
    For storing image and video files that are served as files rather than queried like records, a suitable storage type is
    _____
    storage.
    Hint

    The name refers to storage for large binary objects.

    Answer

    Blob

    Explanation

    Blob storage is used for image, video, and similar file content, which is generally served as-is rather than queried like database records.

  12. 12
    Amazon
    _____
    is a cost-effective example of Blob storage for images and videos.
    Hint

    It is a widely used object storage service from Amazon.

    Answer

    S3

    Explanation

    The content identifies Amazon S3 as a common and relatively cost-effective option for storing images, videos, and similar files.

  13. 13
    A CDN distributes copies of content to servers in different
    _____
    so users can access it more quickly.
    Hint

    The distribution places content closer to users around the world.

    Answer

    geographical locations

    Explanation

    A Content Delivery Network distributes content geographically so that users can retrieve it from a nearby server rather than a distant origin.

  14. 14
    For globally accessed Blob content, a common design pairs Amazon S3 with a
    _____
    .
    Hint

    This network caches and serves content from locations closer to users.

    Answer

    content delivery network

    Explanation

    The content recommends using S3 as primary Blob storage together with a Content Delivery Network to distribute files and improve access speed.

  15. 15
    Elastic Search and Solr provide text-search capabilities and are built on top of Apache
    _____
    .
    Hint

    This underlying technology provides text-search functionality.

    Answer

    Lucene

    Explanation

    Apache Lucene provides the underlying text-search capabilities used by Elastic Search and Solr.

  16. 16
    Searching product titles, descriptions, movie names, genres, or cast and crew names is a use case for a
    _____
    engine.
    Hint

    The system finds content based on words and phrases.

    Answer

    Text Search

    Explanation

    The content describes text search for product and movie information as a common use case for a Text Search Engine.

  17. 17
    A search engine that can return a likely intended result despite a misspelling supports
    _____
    search.
    Hint

    This kind of search tolerates small differences in the query text.

    Answer

    Fuzzy

    Explanation

    Fuzzy search helps find intended terms even when the user's input contains spelling errors or other small differences.

  18. 18
    In the example, changing AIRPROT into AIRPORT requires two character changes, giving an edit distance of
    _____
    .
    Hint

    Count the characters that must be changed in the example.

    Answer

    two

    Explanation

    The example describes correcting AIRPROT to AIRPORT by changing two characters and calls this an edit distance of two.

  19. 19
    The amount of spelling variation a fuzzy search engine will tolerate can be controlled by a
    _____
    factor.
    Hint

    This setting is related to how much a query may differ from a matching term.

    Answer

    fuzziness

    Explanation

    The content says a search engine can be configured with a fuzziness factor, roughly related to edit distance.

  20. 20
    Unlike a primary database, Elastic Search and Solr should not be treated as the primary source of
    _____
    .
    Hint

    This phrase describes the authoritative version of stored data.

    Answer

    truth

    Explanation

    The content warns that these search engines may lose data, so the authoritative data should be stored elsewhere and loaded into them for searching.

  21. 21
    The content characterizes Elastic Search and Solr as search engines rather than
    _____
    .
    Hint

    The distinction concerns their role and guarantees for stored data.

    Answer

    databases

    Explanation

    Although they store searchable data, the content distinguishes Elastic Search and Solr from databases because they do not provide the same guarantee that written data will not be lost.

  22. 22
    Metrics such as throughput, CPU utilization, and latency are commonly stored in a
    _____
    database.
    Hint

    The data is associated with measurements made over time.

    Answer

    Time Series

    Explanation

    Time Series Databases are suited to application metrics that are recorded at different times.

  23. 23
    A metrics system typically writes records in
    _____
    -only mode rather than randomly updating old records.
    Hint

    New records are added after existing records.

    Answer

    append

    Explanation

    The content describes metrics writes as sequential and append-only: new observations are added rather than used for random updates.

  24. 24
    In a time-series workload, each new record is generally associated with a time later than the preceding
    _____
    .
    Hint

    Think about the order of sequentially appended observations.

    Answer

    record

    Explanation

    Time-series data is typically written sequentially, with a later timestamp for each new entry.

  25. 25
    Time-series reads commonly retrieve a bulk set of records over a specified
    _____
    range.
    Hint

    Examples include retrieving measurements from the last few minutes or days.

    Answer

    time

    Explanation

    Time-series systems are optimized for bulk reads over intervals such as the last few minutes, hours, or days.

  26. 26
    InfluxDB and OpenTSDB are examples of
    _____
    databases.
    Hint

    They are optimized for sequential measurements and time-range queries.

    Answer

    time series

    Explanation

    The content names InfluxDB and OpenTSDB as options for time-series workloads.

  27. 27
    A large store that gathers company data to support analytics and reports is a data
    _____
    .
    Hint

    It is used to query and report on aggregated company data.

    Answer

    warehouse

    Explanation

    A Data Warehouse holds large amounts of company data for analytics and reporting queries.

  28. 28
    Data warehouses are generally used for offline reporting rather than
    _____
    systems.
    Hint

    These systems handle the live operations that create or modify business records.

    Answer

    transactional

    Explanation

    The content distinguishes data warehouses, which support offline reporting, from transactional systems.

  29. 29
    The content gives
    _____
    as an example of a system that can store data from transactional systems for reporting.
    Hint

    It is the named platform in the example of processing large amounts of data.

    Answer

    Hadoop

    Explanation

    Hadoop is presented as an option for gathering data from transactional systems and supporting reporting on that data.

  30. 30
    When a system needs atomic transactions and consistency for structured data, the content recommends a
    _____
    database.
    Hint

    This database model commonly organizes structured information into tables.

    Answer

    relational

    Explanation

    The decision process recommends a relational database when structured data requires transactional guarantees such as atomicity and consistency.

  31. 31
    In a money transfer, the database transaction should ensure that debiting one account and crediting another either both happen or
    _____
    happen.
    Hint

    The transaction must avoid a partial transfer.

    Answer

    neither

    Explanation

    Atomicity means both operations in the transfer execute, or neither does; a partial debit or credit must not occur.

  32. 32
    If an account balance is fetched immediately after a successful transaction, the result should reflect the transaction; this is a consistency
    _____
    .
    Hint

    It ensures reads reflect completed changes.

    Answer

    guarantee

    Explanation

    The content describes consistency as ensuring that a subsequent balance query reflects the transaction that has already been completed.

  33. 33
    Preventing an inventory count from becoming incorrect as customers buy products is a use case for transactional
    _____
    .
    Hint

    These help ensure updates to shared data are applied safely.

    Answer

    guarantees

    Explanation

    Inventory management is given as an example where atomicity, consistency, and transactions may be required as product counts change.

  34. 34
    The database properties associated with relational systems in the content are called
    _____
    guarantees.
    Hint

    This acronym names the transaction properties the database should provide.

    Answer

    ACID

    Explanation

    The content recommends choosing a database that provides ACID guarantees when the application needs transactional behavior.

  35. 35
    MySQL, Oracle, SQL Server, and Postgres are examples of
    _____
    databases.
    Hint

    These systems support table-based data and transactions.

    Answer

    relational

    Explanation

    The content lists MySQL, Oracle, SQL Server, and Postgres as common relational database providers.

  36. 36
    Structured user information that does not require atomic transactions can be stored in either a relational database or a
    _____
    database.
    Hint

    This broad category includes NoSQL data stores.

    Answer

    non-relational

    Explanation

    When structured data does not need ACID guarantees, the content says either a relational or non-relational database may be suitable.

  37. 37
    Data such as user profile fields can often be mapped into a
    _____
    model even when it is structured.
    Hint

    This model is commonly contrasted with relational databases.

    Answer

    NoSQL

    Explanation

    The content notes that structured data can often be mapped into a NoSQL model, so either relational or non-relational storage can work when transactional guarantees are unnecessary.

  38. 38
    A relational database is especially appropriate when a payment transaction must avoid a partially completed
    _____
    .
    Hint

    It involves moving money between two accounts.

    Answer

    transfer

    Explanation

    A payment transfer must not debit one account without crediting the beneficiary, or credit one account without the corresponding debit; a transaction enforces this all-or-nothing behavior.

  39. 39
    Data with many possible attributes and varied queries, such as product attributes in an online catalog, can fit a
    _____
    DB.
    Hint

    This database type is suited to flexible records with different fields.

    Answer

    document

    Explanation

    A Document DB is recommended when data has many attributes or varied structures and the system needs to query those attributes.

  40. 40
    A shirt size and color, a refrigerator's volume and power-saving rating, and milk's quantity and expiry date illustrate varied product
    _____
    .
    Hint

    They describe properties of each catalog item.

    Answer

    attributes

    Explanation

    The e-commerce catalog examples show that different kinds of products can have different attributes, creating a flexible data-modeling need.

  41. 41
    Storing product details as JSON may be straightforward, but querying arbitrary attributes in a relational database can be
    _____
    .
    Hint

    The challenge concerns searching across flexible fields.

    Answer

    tricky

    Explanation

    The content explains that JSON can be stored in various databases, but querying random or variable attributes in relational databases can be difficult.

  42. 42
    MongoDB and Couchbase are examples of
    _____
    DB providers.
    Hint

    These databases are used for flexible, attribute-rich records.

    Answer

    document

    Explanation

    The content identifies MongoDB and Couchbase as examples of Document DB providers.

  43. 43
    Elastic Search and Solr are described as special cases of
    _____
    databases, despite being used primarily as search engines.
    Hint

    Their stored records are document-like, but their main role in the discussion is search.

    Answer

    Document

    Explanation

    The content states that Elastic Search and Solr are also special cases of Document Databases, while emphasizing that they should not be used as the primary source of truth.

  44. 44
    A workload with ever-increasing data, high volume, and a finite number of query types is a strong fit for a
    _____
    DB.
    Hint

    This database type is also called column-oriented.

    Answer

    columnar

    Explanation

    The content recommends a columnar or column-oriented database for large, continually growing datasets with a limited set of query patterns.

  45. 45
    Cassandra and HBase are examples of
    _____
    databases suited to large, growing datasets with limited query types.
    Hint

    They are also described as column-oriented.

    Answer

    columnar

    Explanation

    Cassandra and HBase are presented as stable, commonly used options for columnar database scenarios.

  46. 46
    An Uber driver's continually arriving location pings illustrate
    _____
    -increasing data.
    Hint

    The number of records keeps growing over time.

    Answer

    ever

    Explanation

    The content uses driver location pings as an example of data whose volume continually increases as more drivers send records.

  47. 47
    For a driver-location store, a key query is to find all location records for a specified driver
    _____
    .
    Hint

    This identifier distinguishes one driver from another.

    Answer

    ID

    Explanation

    The content describes retrieving all location pings associated with a given driver ID as a central query in this workload.

  48. 48
    The content says Cassandra is generally less heavy to deploy than
    _____
    .
    Hint

    The comparison is between two column-oriented database options.

    Answer

    HBase

    Explanation

    The stated reason for preferring Cassandra in some designs is that HBase tends to require more deployment components, while their performance is described as roughly similar.

  49. 49
    If a system has low scale, few queries, few attributes, and a small dataset, the content says almost any database of choice can be
    _____
    .
    Hint

    The system is simple enough that no specialized database may be needed.

    Answer

    used

    Explanation

    For a small, low-scale workload without the special needs discussed, the content says a database of choice can generally work.

  50. 50
    For an inventory system with one item left and many buyers, a transaction should allow only one buyer to
    _____
    the purchase.
    Hint

    The successful buyer completes the transaction.

    Answer

    commit

    Explanation

    The example requires ACID behavior so that only one buyer can commit the purchase of the last available item, preventing overselling.

  51. 51
    In the e-commerce example, a relational database can hold orders that have been placed but not yet
    _____
    .
    Hint

    These orders are still active rather than completed.

    Answer

    delivered

    Explanation

    The proposed design stores active orders in an RDBMS and moves them after the customer receives the item.

  52. 52
    After an item is delivered, the example moves the order from the relational database into
    _____
    as a permanent store.
    Hint

    This is the column-oriented database in the proposed combination.

    Answer

    Cassandra

    Explanation

    The example uses an RDBMS for orders not yet delivered, then moves delivered orders into Cassandra for permanent storage.

  53. 53
    Using an RDBMS for active orders and Cassandra for delivered orders combines transactional support with storage for
    _____
    data.
    Hint

    The total number of historical orders grows over time.

    Answer

    ever-increasing

    Explanation

    Active order processing benefits from relational transactions, while the growing volume of completed orders fits the Cassandra-style storage model described.

  54. 54
    For flexible reporting queries such as finding users who bought particular products, the example stores a subset of order information in
    _____
    .
    Hint

    This is the document database named for the reporting index.

    Answer

    MongoDB

    Explanation

    The example places a subset of order information in MongoDB so varied product-based reporting queries can be performed.

  55. 55
    The reporting subset in MongoDB can include a user ID, an order ID, a date, and the order's
    _____
    IDs.
    Hint

    These identify the products in the order.

    Answer

    item

    Explanation

    The proposed document stores the user and order identifiers, date, and item IDs with their quantities to support flexible reporting queries.

  56. 56
    After a reporting query returns order IDs from MongoDB, those IDs can be used to query the RDBMS and
    _____
    .
    Hint

    It is the other order store in the example.

    Answer

    Cassandra

    Explanation

    The example uses MongoDB to find matching users and orders, then uses the resulting order IDs to query both the relational database and Cassandra.

  57. 57
    In the combined reporting design, MongoDB supports varied queries, while the RDBMS and Cassandra store the underlying
    _____
    .
    Hint

    These are the business records being searched and retrieved.

    Answer

    orders

    Explanation

    The example uses MongoDB to hold a query-friendly subset, then retrieves order information from the RDBMS and Cassandra.

  58. 58
    A system may use several databases together because different stores can be optimized for different data and
    _____
    needs.
    Hint

    These describe how an application looks up and processes information.

    Answer

    query

    Explanation

    The content emphasizes combining databases in real-world systems to meet diverse data, query, functional, and non-functional requirements.

  59. 59
    In real-world use, database choices should be researched for the specific system rather than relying only on an interview
    _____
    sheet.
    Hint

    The content calls its summary an indicative reference.

    Answer

    cheat

    Explanation

    The database guide is described as an indicative cheat sheet; real-world implementations should investigate which option best fits their actual requirements.

1 of 59
Question 1 of 59

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent