DEV Community

What are you learning from the DEV open source codebase?

Michael Lee πŸ• on August 09, 2018

First of all, huge congrats to the DEV team for hitting this milestone and making the codebase available to the community. With the release of dev...
Collapse
 
rohit profile image
Rohit Awate

Wow you guys run on Heroku! Doesn't it get expensive compared to something like DigitalOcean?

Collapse
 
michaelgv profile image
Mike

Naturally Heroku is quite expensive, if you don’t optimize what you’re doing properly. I remember from a previous post of Ben’s, he had mentioned they try to get as much cached as possible, I imagine the same goes for posts, etc and the only meat for returning users is cached items with a small load of latest that’ll be cached quickly.

If you can optimize caching, and have very little requests to the backend, the cost of using Heroku does decrease significantly.

Collapse
 
ben profile image
Ben Halpern

Yeah, the raw Heroku expenses don't account for much.

Of course we have a bunch of different services and it adds up, but the bottom line host costs aren't a big difference for our type of app.

So yeah, sometimes we overspend if we're not tuned well, but all in all the delta is gonna be pretty negligible.

As we scale, we need to keep all of this in mind, but we have bigger concerns than Heroku vs DigitalOcean at this point.

For what it's worth, I think DigitalOcean is awesome. At the time a few years ago when I started this as a side project, Heroku was what I knew best. Everything's been great with them, but I can't say we weighed every choice in the world and optimized.

Thread Thread
 
michaelgv profile image
Mike

If I may make an estimate on what your costs are for just infrastructure (Heroku, Fastly, Postgres, Emailing, Aloglia), I'd guess:

Heroku: 2x Standard Dyno - $50

Fastly: Assuming you do 1024 GB (1 TB) of bandwidth on average, with 100,000,000 file requests it's $198 per month

Postgres: I'd assume Standard 0, with 2 GB ram, 64 GB storage, 120 active connections, as most content hits Fastly you wouldn't need that many active connections, mainly storage for the data. Under this assumption that's $50 per month.

Mailchimp: I'd take a higher guess at 50,000 subscribers for a baseline price point, that's $240 per month

Searching via Algolia: Assuming 100k records, with 100k indexing ops, you're looking at $70 per month

All in all, I'd guess a high line cost of $608 per month to run infrastructure wise, I'm going to safely assume I'm off, as I'm not sure of the configuration of all services mentioned, and I like to estimate on the higher side.

Within a reasonable guess I'd say around the $400 mark all-in, with peak estimates around $600-$700 for sudden influxes of traffic when not optimized, etc.

Collapse
 
manzanit0 profile image
Javier Garcia

I'm not sure that they'll show numbers... but I'm really interested on this one tho :thinking:

Collapse
 
mjb2kmn profile image
MN Mark

That a Rails app can be fast ;-)

Collapse
 
michael profile image
Michael Lee πŸ•

I agree :)

Collapse
 
akshay1dhingra profile image
Akshay Dhingra

I am pretty new to coding (still learning the basics) and I took a look at the code and recognized some stuff that I have done before... There is just so much in there I don't know where to begin to look or what it is am I looking at! I think I just need to spend some more time and googling stuff

Collapse
 
michael profile image
Michael Lee πŸ•

Nice! Keep going Akshay! It might seem daunting at first but keep going. You could try breaking it up into small portions as well. For example, curious as to what sort of other packages that dev.to relies on, poke through the project's Gemfile. Or think about features you think are neat and you want to know more about and see if you can figure out where in the app it is implemented.

Collapse
 
akshay81844 profile image
Akshay Nandwana

How you are planning for DEV-Android? I am willing to contribute.

Collapse
 
itsasine profile image
ItsASine (Kayla)

As a QA, I'm hoping I can help with test coverage someday, but I need to learn how Ruby and RSpec works first from the existing tests :)