octopus
octopus copied to clipboard
Rails 6 migration / compatibility
I'm familiar with Octopus for a previous project, but opted to try the new Rails 6 connection switching per the note in the README.md.
However, I can't seem to get it to reproduce a using(:tenant1) / using(:tenant2) approach, it seems setup for a role-based read/write strategy, rather than sharding. (Can go into detail on challenges if needed, but seemed like I was going against the grain with various approaches).
Is the plan still to create a migration guide and depreciate Octopus, or are features like sharding/using_group/extended migration features etc still an Octopus only feature (to be continued).
Thanks
I was also looking into this, seems Rails 6 doesn't yet support sharding / more than one replica per database: https://guides.rubyonrails.org/active_record_multiple_databases.html
Just for who are interested in ...
I am developing the Octoball gem to make it easier to upgrade Octopus-based applications to Rails 6.1.
This gem provides Ocotpus-like sharding methods like Model.using(:shard_name)
and shard tracking features, implemented on Rails 6.1 native multi-shard connection handling mechanism. Some of Octopus' features like round-robin scheduler of replicas are omitted for now.
Currently Rails 6.1 is still rc1, so I'm going to release this after the official release. So far, it passes the specs derrived from Octopus with Rails6.1-rc1. Any tests, comments are welcome.
Hey @babelian @sekiyama58 ,
Sorry for the delay to answer - this year has been quite busy for me. I've decided to not maintain compatibility between Rails 6 & Octopus because I haven't been using it in production for a few years. However - since I've had a dozen requests to support Rails 6 - I will do my best to try to make the gem compatible with Rails 6.
With that said - I would love some help with the work. I've setup this branch: rails6-support
to start the work. Feel free to follow or send PRs to that branch.
Thiago