Flyio does promote a pattern for avoiding the distributed write database complexity: request replay, a single main write database, and replicated read dbs.\1
When a request comes in to write on a read server that attempt a db write, the request is aborted and replayed on the main write server.
With some clever assumptions such as “get requests rarely write to the db” and “post request usually do”, much of the write traffic can skip the read vms.
They created a ruby rack middleware\2 to standardize this pattern for Ruby on Rails.
When a request comes in to write on a read server that attempt a db write, the request is aborted and replayed on the main write server.
With some clever assumptions such as “get requests rarely write to the db” and “post request usually do”, much of the write traffic can skip the read vms.
They created a ruby rack middleware\2 to standardize this pattern for Ruby on Rails.
\1 https://fly.io/blog/run-ordinary-rails-apps-globally/
2\ https://github.com/superfly/fly-ruby