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

  • 64Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Database Selection
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • →Next card

How does database choice generally affect functional and non-functional requirements?

Tap to flipClick to flipspace

Many databases can support the same functional requirements, but database choice can strongly affect how well the system meets non-functional requirements such as scalability.

Or swipe the card

64 cards

  1. How does database choice generally affect functional and non-functional requirements?

    Many databases can support the same functional requirements, but database choice can strongly affect how well the system meets non-functional requirements such as scalability.

  2. What three factors are highlighted when choosing a database?

    The structure of the data, the query patterns, and the scale the system must handle.

  3. What is structured data in the context of database selection?

    Data that can be readily modeled as tables with rows and columns.

  4. Give an example of structured user-profile data.

    A profile with standard fields such as name, email address, city, and phone number.

  5. When is a relational database a strong choice for structured data?

    When the system needs atomicity, consistency, or transactional guarantees.

  6. What does atomicity require for a transaction involving two operations?

    Either both operations execute, or neither executes; a partial outcome must not occur.

  7. In a transfer between two accounts, what must the database prevent?

    It must prevent money being debited from one account without being credited to the other, or credited without being debited.

  8. What consistency behavior is expected after a successful transaction?

    A subsequent read of the account balances should reflect the transaction.

  9. Why is a relational database suitable for payment or inventory systems that require transactions?

    It can provide ACID-style guarantees so related updates, such as debiting and crediting funds or reducing stock, are handled reliably.

  10. Name common relational database systems mentioned in the content.

    MySQL, Oracle, SQL Server, and Postgres.

  11. If data is structured but the application does not need ACID guarantees, what database choices may be reasonable?

    Either a relational database or a non-relational database may work.

  12. Why might structured data fit into a NoSQL model?

    Structured data can often be mapped into a NoSQL model even when transactional guarantees are not required.

  13. What is a database choice for a low-scale system with few queries and a small dataset?

    Almost any database may be suitable if the system does not have a specialized requirement.

  14. Why is database selection not simply a choice of one database for an entire system?

    Different parts of a system can have different data structures, query patterns, scale, and consistency needs, so they may need different databases.

  15. What is the central trade-off in choosing between relational and non-relational databases?

    Relational databases are a natural fit for structured data requiring transactions; non-relational options may fit varied data structures or specialized query and scale patterns.

  16. Why use a cache when querying a database?

    Caching frequently needed values can reduce how often the system has to query the database.

  17. Why cache the response from a remote service locally?

    To avoid repeatedly making a remote call when the service has high latency.

  18. What basic data structure is commonly used by a cache?

    A key-value structure: the key identifies a request or query, and the value stores the corresponding response.

  19. What can a cache key represent for a database query?

    It can represent the query’s filter or “where” condition.

  20. What can a cache key represent for an API request?

    It can represent the request parameters or query parameters.

  21. Name cache solutions mentioned in the content.

    Redis, Memcached, etcd, and Hazelcast.

  22. Which caching solution does the speaker commonly recommend, and is it the only valid option?

    Redis is commonly recommended as a battle-tested option, but similar solutions such as Memcached, etcd, or Hazelcast can also be used.

  23. What kind of storage is suitable for images and videos that are served as files rather than queried like records?

    Blob storage.

  24. Why are images and videos commonly stored in blob storage rather than a conventional database?

    They are generally served as files rather than queried as structured records.

  25. What is Amazon S3 used for in the examples?

    Cost-effective blob storage for content such as product images and videos.

  26. What does a content delivery network (CDN) do for blob content?

    It distributes copies of content to servers in multiple geographic locations.

  27. Why pair blob storage such as S3 with a CDN?

    Nearby CDN servers can deliver images or videos faster to users around the world than repeatedly fetching them from a primary storage location.

  28. What kinds of applications commonly need text search engines?

    Applications searching product titles and descriptions, movie titles or cast, or places and other text with fuzzy matching.

  29. Name two common text search engines mentioned in the content.

    Elasticsearch and Solr.

  30. What search technology underlies Elasticsearch and Solr?

    Apache Lucene provides the underlying text-search capabilities.

  31. What is fuzzy search?

    Search that can return likely intended matches even when a user’s input contains spelling errors or other small differences.

  32. How does the content illustrate fuzzy search with “AIRPROT” and “AIRPORT”?

    The search engine can recognize the intended word by changing the two swapped characters, rather than returning no results.

  33. What does an edit-distance-based fuzziness setting control?

    It sets how much the query can differ from a matching term; the example describes a fuzziness of two character edits.

  34. Are Elasticsearch and Solr reliable primary sources of truth for data?

    No. They are search engines and do not guarantee that stored data will never be lost.

  35. How should a search engine relate to a system’s primary data store?

    Keep authoritative data in another primary store and load data into the search engine to provide efficient search.

  36. What is a time-series database designed to store and query?

    Data points associated with time, such as application metrics, in workloads with sequential writes and time-range reads.

  37. What metrics might an application monitoring system store in a time-series database?

    Throughput, CPU utilization, and latency measurements.

  38. What write pattern is typical of the metrics workloads described?

    Append-only, sequential writes: new entries have later timestamps rather than updating arbitrary existing records.

  39. What read pattern is typical of time-series workloads?

    Bulk reads over a time range, such as retrieving the last few minutes, hours, or days.

  40. Why are time-series databases optimized for these workloads?

    Their design suits sequential append-only input and bulk time-range queries, rather than random updates and reads.

  41. Name time-series databases mentioned in the content.

    InfluxDB and OpenTSDB.

  42. What is a data warehouse used for?

    Storing large amounts of company data so it can be queried for analytics and reports.

  43. What are examples of questions a company data warehouse might help answer?

    How many orders the company has, which geographies generate revenue, and which items are most sought after.

  44. Are data warehouses generally intended for transactional systems or offline reporting?

    They are generally used for offline reporting rather than transactional workloads.

  45. How might data from transactional systems be used for company-wide analytics?

    It can be collected in a large analytics store and queried to produce reports.

  46. What technology is given as an example for large-scale analytics and reporting?

    Hadoop.

  47. When is a document database a useful choice?

    When records have many varied attributes and the application needs to query those attributes.

  48. Why can an e-commerce product catalog have a varied data structure?

    Different product types have different attributes: a shirt has size and color, a refrigerator has volume and energy rating, and milk has quantity and expiry date.

  49. Why might storing varied product attributes as JSON not be enough?

    The application often needs to query the attributes, and querying arbitrary JSON fields can be difficult in a relational database.

  50. Name document databases mentioned in the content.

    MongoDB and Couchbase.

  51. What are Elasticsearch and Solr described as in relation to document databases?

    Specialized cases of document databases focused on text search.

  52. What workload is described as a good fit for a column-oriented database?

    A very large and continually growing dataset with a finite set of query types, often involving high-volume writes.

  53. What makes driver-location pings an example of ever-increasing data?

    Drivers continually send new location records, and the number of records can grow as the driver population increases.

  54. What is an example of a common query on a driver-location dataset?

    Find all location records for a particular driver ID.

  55. Why can a column-oriented database suit a dataset with few query types but a large volume of data?

    It can be optimized around the limited query patterns while handling a large, continually growing dataset.

  56. Name column-oriented databases recommended for large, growing datasets with limited query patterns.

    Cassandra and HBase.

  57. What deployment and performance comparison is made between Cassandra and HBase?

    Cassandra is described as lighter to deploy, while HBase tends to require more components; their performance is described as roughly similar.

  58. Why might an e-commerce inventory system use a relational database?

    Transactions and consistency help prevent overselling when multiple users compete for limited stock.

  59. If one item remains and ten users try to buy it, what should the inventory system ensure?

    Only one user can successfully commit the purchase; the others must not also commit it.

  60. How can a system combine a relational database with Cassandra for order storage?

    Keep orders that have been placed but not yet delivered in the relational database, then move them to Cassandra as a permanent store after delivery.

  61. Why might completed orders be moved from a relational database into Cassandra?

    Order data continues to accumulate and may need long-term retention, while the relational database can focus on active, undelivered orders.

  62. Why might an analytics query such as “Who bought sugar in the last five days?” need a separate query-oriented store?

    A product name can map to many item IDs across sellers and variants, making cross-item and cross-order queries more flexible in a store designed for varied queries.

  63. What order information could be stored in MongoDB to support flexible reporting queries?

    A subset such as user ID, order ID, date, item IDs, and quantities.

  64. How can a reporting query use MongoDB together with relational storage and Cassandra?

    Query MongoDB to find relevant users and order IDs, then use those order IDs to retrieve order data from the relational database or Cassandra.

Card 1 of 64
Card 1 of 64

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent