Python Not Recommended

11:45 AM - 12:10 PM on August 16, 2015, Room 705

Adam Forsyth

Audience level:
intermediate
Watch:
http://youtu.be/q74pI8hb_1U

Description

At Braintree, we've moved away from using Python. We've always used Ruby as our primary language, but Python used to be the go-to choice for things where Ruby wasn't a good fit. I will discuss the problems we've had with Python, why we decided to move to other solutions, and what we've chosen instead. Finally, I'll talk about where we're continuing to use Python and what the future holds.

Abstract

Braintree is a Ruby shop. By default, we use Ruby and Rails for projects. We also use Ruby-based projects for much of our tooling, including puppet, capistrano, and rake. However, we strongly believe in using the right tool for the job. What that means has evolved over time, and I'll discuss what solutions we chose in the past as well as our current choices.

So what's it like doing Python at a Ruby shop? You get lots of jokes about language features Ruby has but Python lacks and lots of disbelief that Python will survive the 2/3 split. People also tend to apply the best practices and conventions of Ruby to Python code as if they were the same. Python's major inroad at Braintree has been, surprisingly enough, as a platform for high-concurrency situations. This is a direct result of the power of Tornado as a platform for asynchronous I/O. It also helps that many Python is very approachable and many developers have at least some experience with it.

Braintree has three pieces of our infrastructure using Python and Tornado -- an incoming request proxy; an outgoing request proxy; and a webook delivery service. They've served us well for 3+ years but all suffer from a number of problems. The outdated concurrency features of CPython / Python 2 as well as our lack of experience with and commitment to Tornado have always been an issue. As the meat of the talk, I'll speak in depth about the other issues we've encountered with each of the three applications and our short- and long- term solutions to the problems.

The state as of the end of 2014 appeared dire for Python at Braintree. All the old Python code in our stack is on the way out, and Python has been specifically recommended against for new projects. Our Python client library is used by some of our largest merchants, and is ready for the future by supporting Python 2.6+ and Python 3.3+ in a single codebase. We also have a vibrant Python community at Venmo, our sister company. Both Braintree and Venmo support Python by attending, hosting, sponsoring, and speaking at meetups, conferences, and other events in Chicago, New York, and elsewhere. At Braintree, our Data Science team uses Python almost exclusively and they're becoming a bigger part of our business every day. We also use custom tooling written in Python to manage our infrastructure.