
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
This gem contains helper code and Rack middleware for deploying Ruby web apps on Fly.io. It's designed to speed up apps by using region-local Postgresql replicas for database reads. See the blog post for more details:
https://fly.io/blog/run-ordinary-rails-apps-globally
Fly's cross-region private networking makes it easy to run database replicas alongside your app instances in multiple regions. These replicas can be used for faster reads and application performance.
Writes, however, will be slow if performed across regions. Fly allows web apps to specify that a request be replayed, at the routing layer, in another region.
This gem includes Rack middleware to automatically route such requests to the primary region. It's designed should work with any Rack-compatible Ruby framework.
Currently, it does this by:
DATABASE_URL
to point apps to their local regional replicaYou should have setup a postgres cluster on Fly. Then:
fly postgres attach
Finally, set the PRIMARY_REGION
environment variable in your app fly.toml
to match the primary database region.
Add to your Gemfile and bundle install
:
gem "fly-ruby"
If you're on Rails, the middleware will insert itself automatically, and attempt to reconnect the database.
Most values used by this middleware are configurable. On Rails, this might go in an initializer like config/initializers/fly.rb
Fly.configure do |c|
c.replay_threshold_in_seconds = 10
end
See the source code for defaults and available configuration options.
This middleware send all requests to the primary if you do something like update a user's database session on every GET request.
If your replica becomes writeable for some reason, your cluster may get out of sync.
Here are some ideas for improving this gem.
FAQs
Unknown package
We found that fly-ruby demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.