// Community Ruby · Rails · Open Source

The Cost of Ruby

5 min read · Community
Summary 5 min read

Open source is free as in speech, not free as in beer. RubyGems serves billions of gems a year on infrastructure costing tens of thousands of dollars a month, much of it donated, which is why Bear & Giraffe backs Ruby Together, a community effort to fund the tools every Ruby business depends on.

If you work in software development in 2017, you’re most likely using OSS (Open Source Software), or you are dependent on the services of other companies who use OSS. There is no way around it. The question that begs itself then is whether you know what the cost of the OSS you’ve built a business on is?

But isn’t OSS free you ask?

Free as in speech not free as in beer.

But I haven’t paid for it, nor am I paying a subscription to it!

You’re not, but others are. What happens when they stop?

Think about that for a minute. If the thought of that doesn’t scare the bejesus out of you, then maybe you don’t understand the magnitude of this yet, so let me help you.

The Case

For the rest of this post, I will focus on Ruby. It will be much easier to explain the situation with concrete numbers and examples than to speak in general and vague terms. If Ruby is not of your concern, I urge you to continue reading anyways because you might learn some things that will apply to your situation as well.

Rubyists have recently started seeing the following message after running bundle install:

Bundler and RubyGems.org are free for anyone to use, but maintaining them costs more than $25,000 USD every month. Help us cover those costs so that we can keep the gem ecosystem free for everyone: https://ruby.to/support-bundler

For those who are not familiar with Bundler and RubyGems, gems are the equivalent of libraries for Ruby, and RubyGems is a central repository for all the libraries from where developers can download and install the ones they want. Bundler is a package manager that makes managing the dependencies “easier”. So think of RubyGems as a store that houses all of the Ruby packages, and Bundler as the clerk that fetches the items you need for your software or application. Each time someone creates a new gem or package, it gets delivered to this store, which means the more gems there are, the bigger the store (or warehouse) needs to be. We all know the cost of real estate is sky high, and the same goes for hosting the gems.

Here are some numbers about what that looks like:

  • From 2003–2014 RubyGems served 2 billion gems
  • In 2015 RubyGems served 4 billion gems
  • In 2016 RubyGems served 5 billion gems
  • In 2016 RubyGems served over 30 billion requests
  • In 2016 RubyGems served over 4,000 terabytes of gems (that’s 4,000 x 1,000,000,000,000 bytes)

Storage might be cheap, but bandwidth is not, and that’s a s**t ton of bytes that are being served. The infrastructure required to support something like this doesn’t exist in thin air. Someone, or some company, has to provide access to actual servers that are hosting and serving the gems that the Ruby community depends on. That’s beside the need for someone who is always maintaining this infrastructure, dealing with fires, hacks, etc that might occur. Depending on volunteer effort is not sustainable, and does not address the cost of the infrastructure. And to give you a sense of what that cost might be, at the moment Fastly is providing what amounts to about $35k/month worth of CDN services, and Ruby Central is paying for $5k/month worth of servers. That’s a big bill. If Fastly decides to stop providing the services they currently do, or it becomes too costly for them to handle (as you can see from the numbers above, the demand is growing exponentially), then every product or company that makes a living from Ruby would be in an extremely tough position. We all saw what happened the moment that AWS went down the other day. That keeps me, and others, up at night. It should keep you up at night as well.

The Solution

If you’re freaking out, that’s good. You should be freaking out. You might be thinking that you should setup your own RubyGems server just in case rubygems.org has an outage, and you should. Gemstash is a good solution for that, check it out. But that’s not going to be the ultimate solution for everyone, or anyone really for that matter. If each big company tries to maintain its own private gem server, then we’d have many companies trying to solve the same problems and that won’t scale.

Instead, a relatively new initiative exists that I think you should look into and back. This initiative is called RubyTogether. The premise is simple: all of us in the Ruby community should share the burden of making sure the infrastructure on which we all depend on is funded properly in order for it to remain stable as well as grow and innovate. Together we can make sure that the thing that makes all money can survive the whims of companies and CEOs, the hacking attempts, and many other things. I think it’s a no-brainer. B&G has been a member since the beginning, and we are happy with the level of transparency the group is operating under. You can check out RT’s achievements on the homepage or read the monthly updates that get sent out.

Whereas for those of you who do not work with Ruby but are equally as concerned about the state of OSS, I recommend you look at what the particular area of your focus is doing in order to solve the similar problems. If there isn’t something comparable, maybe you can start your own RubyTogether inspired initiative, you know what they say: “copying is the sincerest form of flattery”. The more communities we have working on this issue, the better OSS as a whole will be.

How would you address this issue in your own OSS community?

Bear & Giraffe Advisory

We partner with founders and tech leads to build sustainable Rails architecture, untangle monoliths, and scale pragmatic systems.

Schedule a Strategy Call
ESC

Type to search 38 posts