My name is Rasmus Rygaard, and I’m a graduate student at Stanford University about to wrap up my masters in computer science. I have spent the last 12 weeks interning as a software engineer at Airbnb for the second summer in a row. This year, I joined the Payments team to help build out our global payments platform. It has been a fantastic experience, and I have been amazed by the kind of responsibility I have gotten as an intern. During my internship, I sped up our financial pipeline by more than an order of magnitude, isolated and upgraded the code that lets guests pay with credit cards, and set up payouts through local bank transfers that will save our hosts millions of dollars in fees.
Speeding up the Financial Pipeline
My main project for the summer was improving our financial pipeline. Airbnb is fortunate to have plenty of graphs that go up and to the right, but when those graphs track application performance, we would rather have them stay flat. To help our Finance team understand our business, the Payments team built a service to generate and serve key business metrics. That service, however, was not scaling with our business. The Finance team depends on having fresh data available at all times, but our infrastructure was struggling to deliver results fast enough. My task was clear yet open-ended: Speed up the pipeline.
I considered several approaches to speeding up the pipeline, but I ended up adapting our existing MySQL queries to be runnable in Presto. Presto, is a distributed in-memory query engine built at Facebook, is heavily used for ad-hoc analytics queries at Airbnb. Presto’s in-memory computation provides significantly better performance than Hive, and for a task that required significant financial number-crunching, it seemed like the obvious choice. In addition to translating the queries, I built a pipeline that will help us seamlessly run complex queries in Presto even for data that lives in MySQL. The system is written in Ruby, which lets us leverage Presto’s computational power from our existing Rails application. As a result, the functionality that we have moved to our new infrastructure now runs 10 to 15 times faster.
Upgrading and Isolating Credit Card Code
This was a high-impact project that had to be treated like surgery: We were replacing code on our perhaps most important page, and our guests should not experience any bumps along the way, nor should we cause any downtime. In addition to upgrading the code, I extracted this functionality into a separate module that we now share between our Rails and Node.js apps for web and mobile web. This required decomposing the existing code, but as a side-effect, we now have much more modularized code around capturing and processing transactions that we can test more aggressively.
Paying Hosts in Local Currencies
Wherever possible, we want to pay our hosts in their local currency. A convenient way of doing that is through bank transfers that are faster and less expensive than international wire transfers. My final project for the summer was to work with a third party provider to start supporting local bank transfers in a number of markets where the existing methods for payouts are slow or expensive. I was the point person for our engineering side of the integration, working on the technical integration with our provider and on product decisions with our own Global Payments team.
We rely on several partners to support our platform, so the experience of partnering with another provider was not new to the team. I, however, had never worked this closely on a third party integration before. Still, my team trusted me to see through a project that would end up delivering payouts to hosts in countries around the world. Although work that requires syncing with an external company can be difficult to plan, the experience of balancing interests, requirements, and timelines between us and our partner gave me real world experience that no other class project or internship could provide. Our hosts in these markets can now look forward to saving millions of dollars in processing fees that would otherwise be charged by the providers of the existing payout methods.
My 12 weeks at Airbnb have been an amazing learning experience. As an intern, I have worked on projects that had significant impact on our hosts, guests, and core business. I have seen the global scale of our payments platform and how a small team of talented engineers make sure that money flows safely from guests to hosts on Airbnb. I’ve been blown away by the visible, high-impact projects that the company trusts interns with, and it’s clear that interns are treated just like full-time employees.
Check out all of our open source projects over at airbnb.io and follow us on Twitter: @AirbnbEng + @AirbnbData
Originally published at nerds.airbnb.com on September 25, 2014.