TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Run Ordinary Rails Apps Globally (2021)

269 pointsby goranmoominover 3 years ago

20 comments

undecisiveover 3 years ago
Alas, I feel like the word &quot;Ordinary&quot; is doing a lot of heavy lifting in this title!<p>The upshot is, so long as your postgres + rails app isn&#x27;t doing some kind of DB write with every request, and doesn&#x27;t do much - or ideally anything - with Redis, and you want 200ms time-to-first-byte globally (or at least, in multiple locations across the world) then you can easily get better performance with Fly.io than most other solutions.<p>It&#x27;s a really clever solution, and one day I&#x27;d love to work on a project that fulfils all of those constraints. Haven&#x27;t found one yet though.
评论 #30084235 未加载
评论 #30084732 未加载
评论 #30089322 未加载
评论 #30084742 未加载
评论 #30084120 未加载
samwillisover 3 years ago
I think the thing is, for most people they won&#x27;t need to do the global distribution that Fly.io is pioneering, what they want is a better cheaper Heroku. Fly.io is already exactly that too.<p>For the 1% of people who do need that global distribution, what Fly.io have built is incredible.<p>I currently host on Heroku and plan to switch to Fly.io once they have an equivalent to Heroku Postgres&#x27;s WAL point in time restore.
评论 #30084221 未加载
评论 #30087000 未加载
评论 #30085501 未加载
评论 #30160692 未加载
评论 #30084708 未加载
评论 #30085222 未加载
_ben_over 3 years ago
We&#x27;re building PolyScale.ai[1] that solves the global latency challenges for apps using caching. Clearly that is a different proposition&#x2F;architecture to database read-replicas, but if the use case is a fit, it&#x27;s a powerful solution to a hard problem. PolyScale plugs into your existing database and maintains your transactionality and consistency (we automatically invalidate globally). DML queries pass through to the origin db and reads (SELECT’s, SHOW’s) get cached locally at the edge.<p>We move the database data and query compute closer to the end user for consistent 1ms query execution times at scale. It intelligently manages the cache for every individual SQL query so no configuration is needed, unless of course you want to set manual TTL’s.<p>1. <a href="https:&#x2F;&#x2F;www.polyscale.ai&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.polyscale.ai&#x2F;</a>
评论 #30092063 未加载
JOnAgainover 3 years ago
I appreciate that they have made globally deploying a rails app, Postgresdb, cdn, network routing fast and easy. There is always lot of finicky configuration issues and it takes a lot of time to get this all set up right. Like lots of IaaS, they are making something hard easier. They are not, though, removing the need to build your app to this paradigm. The conventions and restrictions you need to follow to realize the benefits remain and are similar to what you’d have to do yourself. So they’ve cleaned up lots of application and deployment gunk, but the app engineering work remains. This is progress. Very nice.
damagednoobover 3 years ago
Maybe I missed this in the link but I didn&#x27;t see how one of the common problems in a distributed application is addressed:<p>* A POST request is redirected to the primary data source, the resource is created and the id is returned<p>* A GET request is immediately issued for that id but the resource that has not been replicated to the regional data source<p>* :boom:
评论 #30086250 未加载
评论 #30085688 未加载
louissm_itover 3 years ago
Fly is compelling enough to use without all the global deployment options they offer[1] but it&#x27;s assuring to know if you ever do need to deploy globally, they can support that better than most.<p>[1] - <a href="https:&#x2F;&#x2F;github.com&#x2F;superfly&#x2F;fly-ruby" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;superfly&#x2F;fly-ruby</a>
rco8786over 3 years ago
Fly.io continues to impress me with their pragmatic and clever approaches to otherwise challenging problems.
t_christensenover 3 years ago
I deployed a little side-project (<a href="https:&#x2F;&#x2F;thecitymapquiz.com" rel="nofollow">https:&#x2F;&#x2F;thecitymapquiz.com</a>) to fly.io yesterday. The deployment went really smooth, but friends testing it out complained their connection (websockets in Phoenix LiveView) dropped. It might be because its running on the cheapest VMs, I don&#x27;t know yet. That said, it was really satisfying seeing the application running in Seattle, Hong Kong, and Amsterdam within minutes after launch.
评论 #30085826 未加载
评论 #30085991 未加载
mattbeeover 3 years ago
If this global replicated architecture is now a nice, polished, improving hosting product - how come so many well-funded global brands don&#x27;t appear to benefit from an architecture like it?<p>Like Airbnb taking many seconds to load many parts of their app from the UK, or business apps like Xero which respond tens of times slower than a local app from 30 years ago.<p>Surely these are the sorts of companies which should be on top of global hosting, now that a hosting firm can box and sell it?
评论 #30085307 未加载
Dave3of5over 3 years ago
I wonder what the costs are to run something like this for a real world app. Fly.io charge outbound bandwidth fees. You&#x27;ve got instance &#x2F; volume costs for all the regions for the DB and app servers. IP addresses are charged.<p>Can someone try it for a medium sized app and send through their monthly bill, that&#x27;d be great thanks :).
j4yavover 3 years ago
That is a very clever implementation, and indeed feels like magic for someone who makes relatively small Rails apps.
robgoughover 3 years ago
I&#x27;m really interested in fly.io after their Postgres post the other day, but I&#x27;ve not seen anywhere what their recommended solution is for ActiveStorage – is it still writing to S3 (or equivalent), or would it be somehow using their volumes? Are there any published examples (blog posts etc)?
评论 #30084454 未加载
评论 #30084752 未加载
评论 #30085828 未加载
评论 #30091893 未加载
hrdwdmrblover 3 years ago
Nice to see that they support HTTP&#x2F;2 (which BTW is 6 years old now), unlike Heroku
photon12over 3 years ago
Amazing what started with Heroku* has turned into.<p>*Started for me at least. Heroku was how I got started as a Rails developer, and it made it so easy to get a deployment available to interact with from anywhere.
sharps_xpover 3 years ago
Can anyone speak to using a rails app to reach global users using fastly&#x27;s surrogate tags or cloudflare&#x27;s cache tags (Enterprise only)?<p>After reading the OP, the tradeoffs seems more complex than a single origin in us-east and having CDNs cache HTML pages.<p>The most appealing advantage I see with running rails at all these regions is you can authenticate users really quickly and redirect them to a html page in a CDN.
评论 #30093111 未加载
Jamie9912over 3 years ago
I&#x27;m struggling to deploy a basic docker application, that works fine on my machine, it handles https traffic by its self, so the Fly.io docs say to exclude services.ports in fly.toml and TCP will be passed-on as-is, but unfortunately it seems to still be messing with my TCP traffic, maybe because it&#x27;s on a non-standard port
评论 #30086982 未加载
anothersullivanover 3 years ago
I deployed my company website &#x2F; blog with fly.io It&#x27;s a simple phoenix app w&#x2F;o a DB, and it was trivially easy to set up. After having used K8S for Rails and Phoenix hosting before, their product is definitely something to keep in mind.
jgalt212over 3 years ago
Why do you need all these regions? Is there any real money to be made outside of G7 that will be greatly decreased due to increased latency?
评论 #30086714 未加载
评论 #30087100 未加载
pupdoggover 3 years ago
So you&#x27;re saying that I can run my &quot;ordinary&quot; Rails-2.3.18&#x2F;Ruby-1.9.3 app as well?
评论 #30086540 未加载
ertucetinover 3 years ago
When to support JVM languages?
评论 #30084240 未加载