planetscale/database-js

Does this driver routes the traffic to replica sets, so I can use just ONE connection string, or do I have to implement this myself??

205g0 opened this issue · 1 comments

205g0 commented

Example: Primary is in US East, two read replicas: one at the west coast and one in EU

Is it possible to access all of them with one url string and this driver manages...

  • accessing the closest read replica,
  • writing allways to the primary,
  • reading from the primary when have been written 2sec before?

Each replica gets its own connection string and your app will choose which one is best to use for each of those scenarios. This post describes how we use replicas in our Rails app. https://planetscale.com/blog/rails-multi-region-database