Coupa Software Scales on Ruby and Rails

By Darryl K. Taft  |  Posted 2013-10-16 Print this article Print

"This is nice because it's all about throughput and scalability," Williams said. "In our system the fewer times you have to garbage collect, the less memory you take up per process, the more people you can put on the server, the better response time your users are going to get and the less hardware you're going to have to throw at it. So what's nice about the platform is it's quite horizontally scalable. We can throw more hardware at it if we need to, but it's nice not to have to. So that saves us money in the long term and saves our customers money as well."

Williams said the development team at Coupa is looking forward to lazy enumerators for the performance benefits there, as well as to named arguments.

In a post on DZone, Pat Shaughnessy, a Ruby developer working at a global management consulting firm, described lazy enumerators thusly:

"Ruby 2.0's new lazy enumerator feature seems like magic. In case you haven't tried it yet, it allows you to iterate over an infinite series of values and take just the values you want. It brings the functional programming concept of lazy evaluation to Ruby—at least for enumerations."

JP Krishnamoorthy, vice president of engineering at Coupa, said Coupa is "the most active spend optimization platform in the world." He added that as Coupa gives its customers and their users a consumer-like experience, "people are going to use the system more and more." Later, Krishnamoorthy asked Ruby creator Yukihiro "Matz" Matsumoto, who was on hand with a delegation of Ruby developers from Japan, what advice he had for enterprise software companies using Ruby.

Matsumoto replied, "The fundamental principle of Ruby goodness is focusing on the programmer, on people. As programmers we tend to focus on technology or the computer, as in how to make it fast and how to make it scalable. They are important, but if you are building software applications that target humans, don't forget to focus on humans."

Coupa's platform handles 500,000 transactions daily and supports $43 billion in spend through. "As a Rails app we have 241 controllers, almost 500 models and 130,000 lines of code," Williams said. "For a Ruby project this is fairly large; for a Java project not so much."

Since its launch in 2006, the company has continued to grow quickly. In fact, recently Coupa moved its development team to a nearby location because it had filled the existing facility to capacity.

Coupa's longer-term challenges include scaling more and more as the company grows.

"We already scaled past this office, we're scaling in employees, in customers, in users per customer, in data volume, in size of customers," Williams said. "So everything we can do in the language, in the platform, in our code to make scalability easier is a good investment from our perspective. So some of that will be getting into more thread safety. This is something that is mostly a librarian testing issue. We're also looking at multi-core support. We may end up exploring JRuby or Rubinius, but that's longer term."

Another thing Coupa is looking at is sandboxing untrusted code, Williams said.

"One of the lovely things about Ruby is how flexible and powerful it is wherever you happen to be, but it can also be really dangerous if you have code in there you don't trust," he said. "It can be hard to make sure you're masking everything that you need to mask in order to not let something play havoc in your system. We've played with a few different options there. One is to use service-oriented architecture for some things, but that limits your flexibility. There's the potential of embedding a different language altogether, like Lua or JavaScript, which makes drawing the lines easier. But that also means you have these interfaces to figure out, and that's not as elegant as it could be."



Submit a Comment

Loading Comments...
Manage your Newsletters: Login   Register My Newsletters

Rocket Fuel