Grokking the System Design Interview
Ask Author
Back to course home

0% completed

Vote For New Content
Nagaraju P
What is best strategy to use no of databases to host partitions

Nagaraju P

Sep 12, 2024

Say there are ~30 data partitions. Usually each partition will be hosted in separate database instance. So, for 30 partitions, 30 database instances needed. We place LB to balance partitions and replications can be done as well. This will be huge cost for 30 database instances.

Question:

To save costs, if we want to use say 5 database instances, is it allowed to host more than one partition in single database instance? If Yes, How do we load balance the partition and also do replication as multiple partitions are part of single base instance?

0

0

Comments
Comments
K
kartech11 9 months ago

Not necessary that each partition has to be in a separate database instance. They are separate tables not database instances.

On this page

  1. Why do we need URL shortening?

Try it yourself

Designing URL Shortener (video)

  1. Requirements and Goals of the System
  1. Capacity Estimation and Constraints
  1. System Interface Definition
  1. Create Short URL API
  1. Redirect API
  1. Analytics API
  1. URL Management API
  1. Delete Short URL API
  1. Database Design
  1. Basic System Design and Algorithm

a. Encoding actual URL

b. Generating keys offline

  1. Data Partitioning and Replication
  1. Cache
  1. Load Balancer (LB)
  1. Purging or DB cleanup
  1. Telemetry
  1. Security and Permissions