Heroku follow : how to handle multiple databases in a Rails app?

前端 未结 2 1733
挽巷
挽巷 2021-02-04 20:07

We have a Rails app hosted on Heroku and i need to set up some analytics pages for our marketing guy. This seems to be the typical use case for a Heroku follow database

2条回答
  •  终归单人心
    2021-02-04 20:37

    To better answer this question : Heroku has now posted an "official" way of dealing with this situation using the Octopus gem :

    https://devcenter.heroku.com/articles/distributing-reads-to-followers-with-octopus

    With this gem it's possible to create either a fully replicated model, or execute only a block on the follower :

    Octopus.using(:slave_two) do
      User.create(:name => "Mike")
    end
    

提交回复
热议问题