Since the introduction of Rails 7.2 the gem Makara is no longer working. Until this point it definitely was the best Read-Write Proxy for Connections.
There currently does not seem to be a good alternative. Rails introduced a build-in read/write split with version 6, however the setup assumes a CRUD style application rather than a rich API. It’s hooked into routes rather than looking at the actual query content itself.
So while the build-in way does work well for ActiveRecord, any custom SQL is not being handled properly at this point in time.
The guys over at OLIOEX started working on their own implementation, which is only available for MySQL: GitHub - OLIOEX/janus-ar: A read/write ActiveRecord database adapter
They created a great post outlining the issue: Introducing Janus a read/write proxy for ActiveRecord 7.1+ | Olioverse
Makara is currently looking for someone to take over development, as InstaCart seems to have switched over to an in-house solution and will no longer maintain Makara.
This is a dealbreaker for us to upgrade to Rails 7.2, Rails 8 and beyond.
Ideally the built in Rails way would start to support custom SQL by checking for write prefixes like INSERT, UPDATE, DELETE, LOCK, CREATE, GRANT, DROP, ALTER, TRUNCATE, BEGIN, SAVEPOINT & FLUSH.
It would be great if someone from the core team can chime in here whether this is planned to be supported in the future directly. It certainly is a crucial feature for scaling Rails applications.