What if Rails guides (such as Multiple Databases with AR) included use cases?

I was reading the guides “just in case” versus “just in time,” so perhaps I’m not the intended audience. But I do believe that real-life context can add value to documentation.

What are some use cases you have come across for multiple DBs in rails?

My potential use case might be to transition from an old app with an old weird DB, to a new app with the same old DB, and then to the new app with a newer (less weird DB). Has anyone else does this?

If this post got enough real-life answers with a nice “so that” appeal, I’d love to edit them and submit a PR to add this to the guide.

And are there other guides that could use a “so that…?” in the intro?

For multiple DBs I can think of the following scenarios:

  • Archive instance for “read-only” entries
    • Legal reasons/compliance require to keep records for e.g. 10 years without filling up the operational DB
    • Optimization for read access
  • Sharding for horizontal scaling
  • Keeping certain records in particular database hosted in specific country for legal reasons
  • Interaction with DB “owned” by other application for certain data
  • Migration to new
    • DB type
    • DB instance (e.g. from on-prem to cloud or vice versa)
  • A/B testing

In my world the use of only a single DB is actually highly unusual.