At Pinterest, that company with a popular app for pinning images and other content to boards, much of the source code is written in the longstanding Python programming language. But in the past year, a few of the company’s software engineers have called on a young language called Elixir.
Pinterest’s notification system now uses Elixir to deliver 14,000 notifications per second. The notification system runs across 15 servers, whereas the old system, written in Java, ran on 30. The new code is about one-tenth of the size of the old code.
“These are heavy requests, to find out your notifications,” Steve Cohen, a software engineer on Pinterest’s product platform team, told VentureBeat in an interview. “It’s not like these are lightweight things that just read a little bit of data.”
The rate-limiting system for Pinterest’s core application programming interface (API) and Ads API is also now written in Elixir, providing faster response times than its Memcached-based predecessor.
Today, Pinterest is releasing two tools for Elixir under an open source license: the Elixometer logging library and the Riffed implementation of Apache Thrift for Elixir. Like other web companies, Pinterest regularly contributes open source code. But today’s move is especially interesting because it demonstrates Pinterest’s belief in the promise of Elixir and, more broadly, Erlang.
Meanwhile, the use of Elixir in the first place shows that Pinterest is keen on improving its technical operations. Even incremental efficiency gains can make a difference for a company that’s trying to keep costs in order as it grows internationally. Pinterest had more than 100 million monthly active users as of September, and the San Francisco-based company currently employs more than 300 engineers.
A new language based on an old language
This might sound like a brave initiative for Pinterest. After all, Elixir is not even 5 years old, having made its debut on GitHub on January 9, 2011. But Elixir has roots. It’s a new language that’s based on an old language.
The Brazilian software engineer José Valim, a core developer of the Ruby on Rails web application framework, started building Elixir in order to make the peculiar 30-year-old programming language Erlang more accessible. But he didn’t leave Erlang behind completely. If you want to run Elixir, you need to have Erlang installed on your machine.
Leave a Reply