DEV Community

Cover image for One Recent Lesson in Scaling the dev.to Rails App

One Recent Lesson in Scaling the dev.to Rails App

Ben Halpern on January 17, 2019

dev.to has a fairly scalable architecture in that we've built it so most traffic is cached statically on the edge via our CDN Fastly. In this sense...
Collapse
 
ben profile image
Ben Halpern

Sigh. Every time I make a post like this, we hit new issues.

Such is life, but still feeling like the lesson is working πŸ˜„

Collapse
 
pretzelhands profile image
pretzelhands

Maybe they respond to that. Try making posts until you run out of issues to handle. πŸ€”

Collapse
 
kayis profile image
K

Use the Cloud, Benakin! 😯

Collapse
 
ben profile image
Ben Halpern

It’s funny how our problems are mostly config related. As cloud users, we have such first world problems of just setting the right config and having autoscaling configures.

I can only imagine our problems if we weren’t using the cloud.

Collapse
 
lautarocastillo profile image
Lautaro C

Hi Ben, very interesting post. I’ve been looking for information about the Dev.to current stack (hardware resources and services) but I didn’t find. Could you make a post about it? I think this site is the best example (by far) about scaling Rails in the right way.

Collapse
 
ben profile image
Ben Halpern

πŸ˜„

Yeah, Heroku's prices are definitely not great but still hasn't been a big % of our costs of running the business. Examining moving to DO or otherwise definitely a possibility.

Collapse
 
vinayhegde1990 profile image
Vinay Hegde

From my experience, DO does offer value for one's money with stellar documentation for most things and good support (in case of issues)

Collapse
 
andrewbrown profile image
Andrew Brown πŸ‡¨πŸ‡¦

While other people were migrating to Elixir or Go I just dug deeper into Rails to work at scale with less friction. One such thing that breathed new life into Rails was serving json directly from Postgres database. I saw endpoints go from 500ms to 20ms with no caching. It was unbelievable.

Though this required writing raw queries and so I then created my own gem that made it easier to managed queries and also some helpers for json functions.

I probably would have a popular gem on my hands if I bothered to put some marketing effort and documentation behind it.

Monster Queries

I have on my todo list to get rid of using handlebars and writing my own templating language for SQL.

Collapse
 
rhymes profile image
rhymes

Well said Ben! Some content, especially about performance and optimization, is evergreen.

Speedshop is my jam 🀣

Collapse
 
theianjones profile image
Ian Jones

Do you have any resources on how you went about porting your app from Heroku to DO? egghead runs Rails on Heroku and that cost benefits sounds really appealing.