superfly / fly

Deploy app servers close to your users. Package your app as a Docker image, and launch it in 17 cities with one simple CLI.
https://fly.io
985 stars 48 forks source link

Rails at the Edge #279

Open karllhughes opened 4 years ago

karllhughes commented 4 years ago

I'm planning a tutorial to demonstrate deploying a Ruby on Rails application at the edge using Fly.

I'm thinking I'll build a one-page Rails app that collects email addresses from users and sends them off to a backend (maybe Airtable or Mailchimp or something). After a user has submitted their email, it would show them a thank you page, even if they refresh the page (by storing the state in Redis).

The app would be packaged up as a Docker image and deployed to Fly.

If this sounds like a good idea, I'll go ahead and outline the post here. Thanks!

mrkurt commented 4 years ago

So we actually run Rails at the edge, I have lots of thoughts. The big problem with Rails is it's so heavily tied to a DB, any example that doesn't work with a normal Rails app might not give devs much to imagine about.

I think the "simplest" full Rails example is two Fly apps. One running in IAD and talking to postgres on Heroku or RDS or something. The other running "edge" locations with no DB adapter. And then some mechanism for proxying requests that require DB access to the primary.

This might be too complicated though. The better option might be to do Rails + CockroachDB or Yugabyte or MongoDB geo databases (we can get demo versions of these running).

karllhughes commented 4 years ago

Gotcha. It sounds like this might be a better one for your team to do then, honestly. Thanks for clarifying!