{"id":41506,"date":"2010-05-01T06:44:24","date_gmt":"2010-05-01T13:44:24","guid":{"rendered":"https:\/\/redfindevelop.wpengine.com\/blog\/devblog\/?p=291"},"modified":"2020-10-05T13:12:36","modified_gmt":"2020-10-05T20:12:36","slug":"how_and_why_twitter_uses_scala","status":"publish","type":"post","link":"https:\/\/www.redfin.com\/news\/how_and_why_twitter_uses_scala\/","title":{"rendered":"Engineer-to-Engineer Talk: How and Why Twitter Uses Scala"},"content":{"rendered":"<p><em>To kick off our San Francisco series of <\/em><a href=\"http:\/\/www.facebook.com\/pages\/Engineer-to-Engineer-San-Francisco-Tech-Talks\/119013258113825\"><em>engineer-to-engineer lectures on new technologies and interesting problems in consumer software<\/em><\/a><em>, we invited in the <\/em><a href=\"http:\/\/twitter.com\/al3x\"><em>Great Alex Payne<\/em><\/a><em> to talk about how Twitter uses <\/em><a href=\"http:\/\/www.scala-lang.org\/\"><em>Scala<\/em><\/a><em>, a programming language that combines traits of object-oriented languages and functional languages with an eye toward supporting concurrency better in large-scale software.<\/em><\/p>\n<p><em>Alex started at Twitter in 2007, working remotely in Washington DC, when there were \u201conly one and a half engineers.\u201d Now, Twitter has 170 engineers. \u201cIt has been an interesting process,\u201d Alex said. Right after his talk, Alex packed up his cats and headed for Portland, where he\u2019ll still work for Twitter, but ensconced in a smaller, more closely-knit community. Here are his thoughts on Scala (Alex talks fast, and doesn&#8217;t waste many word, so my hands were in a rictus of agony from trying to type what he wrote) :<\/em><\/p>\n<p><em>Best, Glenn at Redfin<\/em><\/p>\n<p>I started working the programming interface when we were at this very early stage. Now, it handles a couple billion operations every day. It is being baked into more and more of the Web.<\/p>\n<p>I\u2019ve spent the past year working on Twitter\u2019s infrastructure. For that, we use a weird language called Scala. I worked <a href=\"http:\/\/programming-scala.labs.oreilly.com\/\">on a book for O\u2019Reilly about Scala<\/a> that you could sit down with over a three-day weekend to get up to speed on the language.<\/p>\n<p><strong>Why Use Scala?<\/strong><br \/>\nWhy use Scala when you have Ruby and Ruby on Rails? Well, we still use Rails. It works great for front-end stuff. The productivity is worth the tradeoff for working in a slower-performing dynamic language. When you think about what a web framework is doing under the hood, it\u2019s tons and tons of string concatenation. Ruby on Rails can handle that.<\/p>\n<p>What we had a need for as Twitter grew was for long-running heavy processes, message-queuing, caching layers for doing 20,000 operations a second. Ruby garbage-collection is tough, Ruby doesn\u2019t do really well with long-running processes.<a href=\"http:\/\/alex.payne.usesthis.com\/images\/portraits\/alex.payne.jpg\"><img fetchpriority=\"high\" decoding=\"async\" class=\"alignright\" src=\"http:\/\/alex.payne.usesthis.com\/images\/portraits\/alex.payne.jpg\" alt=\"\" width=\"350\" height=\"234\" \/><\/a><\/p>\n<p><strong>Languages Twitter Considered<\/strong><br \/>\nWe knew we needed another language. How did we pick a language that was really fun for us? We considered Java, C\/C++ of course. And we looked at Haskell and OCaml for functional programming, though neither has gotten much commercial use. Erlang developers are doing stuff with a lot of network I\/O but not with a lot of disk I\/O; the knowledge-base around the language wasn\u2019t great though, and the community seemed inaccessible.<\/p>\n<p>Java is easy to use, but it\u2019s not very fun, especially if you\u2019ve been using Ruby for a while. Java\u2019s productive, but it\u2019s just not sexy anymore. C++ was barely considered as an option. Some guys said, if I have to work in C++ again, I\u2019m going to stab my eyes out with a shrimp fork. Java-script on the server-side via Rhino had performance problems, and it wasn\u2019t quite there yet when we were evaluating it.<\/p>\n<p>So what were our criteria for choosing Scala? Well first we asked, was it fast, and fun, and good for long-running process? Does it have advanced features? Can you be productive quickly? Developers of the language itself had to be accessible to us as we\u2019d been burned by Ruby in that respect. Ruby\u2019s developers had been clear about focusing it on fun, even sometimes at the expense of performance. They understood our concerns about enterprise-class support and sometimes had other priorities.<\/p>\n<p>We wanted to be able to talk to the guys building the language, not to steer the language, but at least to have a conversation with them.<\/p>\n<p><strong>Was Scala Fast?<\/strong><br \/>\nAnd did Scala turn out to be fast? Well, what\u2019s your definition of fast? About as fast as Java. It doesn\u2019t have to be as fast as C or Assembly. Python is not significantly faster than Ruby. We wanted to do more with fewer machines, taking better advantage of concurrency; we wanted it to be compiled so it\u2019s not burning CPU doing the wrong stuff.<\/p>\n<p><strong>What Alex Likes About Scala<\/strong><br \/>\nScala is a lot of fun to work in; yes, you can write staid, Java-like code when you start. Later, you can write Scala code that almost looks like Haskell. It can be very idiomatic, very functional &#8212; there\u2019s a lot of flexibility there.<\/p>\n<p>And it\u2019s fast. The principal language developer at Scala worked on the JVM at Sun. When Java started, it was clearly a great language, but the VM was slow. The JVM has been brought to the modern age and we don\u2019t think twice about using it.<\/p>\n<p>Scala can borrow libraries from Java libraries; you\u2019re compiling down to Java byte code, and it\u2019s all calling back and forth in a way that is really efficient. We haven\u2019t run into any library dependencies that cause problems. We can hire people with Java and they can do pretty well.<\/p>\n<p>The community is small but growing, and it\u2019s really accessible. We got to sit down with Martin and ask him and his team about funding for Scala, how problems with Scala will get solved. We\u2019ve never really had to call on that level of access, but it\u2019s really nice to know it\u2019s there.<\/p>\n<p><strong>The Grand Unified Theory of Scala<\/strong><br \/>\nThe grand unified theory of Scala is that it combines objective-oriented programming (OOP) and functional programming (FP). Scala\u2019s goal is to essentially say OOP and FP don\u2019t have to be these separate worlds. It\u2019s kind of zen, and you don\u2019t get it when you first start. It\u2019s really, really powerful; it\u2019s nice to have a language with a thesis, rather than trying to appeal to every programmer out there. Scala is trying to solve a specific intellectual problem.<a href=\"https:\/\/redfin.com\/blog\/devblog\/wp-content\/uploads\/sites\/3\/2010\/05\/ScalaLogo.png\"><img decoding=\"async\" class=\"alignright size-medium wp-image-295\" src=\"https:\/\/redfin.com\/blog\/devblog\/wp-content\/uploads\/sites\/3\/2010\/05\/ScalaLogo-300x88.png\" alt=\"ScalaLogo\" width=\"300\" height=\"88\" \/><\/a><\/p>\n<p>You have methods that take anything between a string and several point away on the inheritance chain from a string. The syntax is more flexible than Java; it\u2019s very human-readable, as you can leave out period between method calls so it looks like a series of words. Your program can make nice declarative statements about the logic of what you\u2019re trying to do.<\/p>\n<p><strong>Traits, Pattern-Matching, Mutability<\/strong><br \/>\nWith Scala, you can also use traits. This is handy because of course you have cross-cutting concerns in your application. For example, every object needs to be able to log stuff, but you don\u2019t want everything extending from a logger class &#8212; that\u2019s crazy. With Scala, you can use a trait to shove that right in, and you can add as many traits as you like to a given class or object.<\/p>\n<p>You can choose between mutability and immutability. This can be dangerous. 9 out of 10 times you use immutable variables when you want predictability, especially when you have stuff running concurrently. But Scala trusts the programmer for mutability when he or she needs it.<\/p>\n<p>Scala has the concept of lazy values \u2013 you can say lazy val x = a really complicated function. That isn\u2019t going to be calculated until the last second, when you need that value. This is nice.<\/p>\n<p>Pattern-matching is nice too. It lets you dive into a data structure so you can, for example, explode out a collection that matches an array with \u201c2\u201d as its third element. You can break out strings and regular expressions, and you can pattern-match groups with regular expressions.<\/p>\n<p>An oddball feature that is really useful is the ability to use XML literals, so that you can make something equal to an XML literal, as if the XML literal is a string. You don\u2019t have to import Sax or some crazy XML library.<\/p>\n<p><strong>The Concurrency Story<\/strong><br \/>\nWhen people read about Scala, it\u2019s almost always in the context of concurrency. Concurrency can be solved by a good programmer in many languages, but it\u2019s a tough problem to solve. Scala has an Actor library that is commonly used to solve concurrency problems, and it makes that problem a lot easier to solve.<\/p>\n<p>An Actor is an object that has a mailbox; it queues messages and deals with them in a loop, and it can leave a message on the floor when it doesn\u2019t know what to do with it.<\/p>\n<p>You can model concurrency as messages \u2013 a unit of work &#8212; sent to actors, which is really nice. It\u2019s like using a queuing system. You can also use Java.util.concurrency stuff too, Netty and Apache Mina, dropping it right in. You can rewrite the Actor implementation, and some folks have gone so far as rolling their own software transactional memory libraries.<\/p>\n<p>Java interoperability is a big, big win. There are ten years of great libraries, things like Jodatime. We use a lot of Hadoop and it has been easy to wire Scala to the Hadoop libraries. We use Thrift, without having to patch it; we use libraries from the Apache Commons and from Google.<\/p>\n<p><strong>How Twitter Uses Scala<\/strong><br \/>\nSo that\u2019s <em>why<\/em> we use Scala, but <strong>how<\/strong> do we use it?<\/p>\n<p>In the enterprise world, a service-oriented architecture is not new, but in Web 2.0 it is crazy new science. With PHP or Ruby on Rails, when you need more functionality, you just include more plugins and libraries, shoving them all in to the server. The result is a giant ball of mud.<\/p>\n<p>So anything that has to do heavy lifting in our stack is going to be an independent service. We can load-test it independently, it\u2019s a nice way to decompose our architecture.<\/p>\n<p>What services at Twitter are Scala-powered? We have a queuing system called Kestrel. It uses a souped-up version of the mem-cache protocol. We originally wrote it in Ruby &#8212; it got us through a few weeks, but because Ruby is a dynamic language, the service began to show its performance weak spots.<\/p>\n<p><strong><em>Flock<\/em> to Store the Social Graph<\/strong><br \/>\nWe use Flock to store our social graph, as a denormalized list of user ids. It\u2019s not a graph database, so you can\u2019t perform random walks along the graph. But it\u2019s great for quickly storing denormalized sets of user ids, and doing intersections. We\u2019re doing 20,000 operations a second right now, backed by a MySQL schema designed to keep as much as possible in memory. It has been very efficient &#8212; not many servers are needed.<\/p>\n<p><em><strong>Hawkwind <\/strong><\/em><strong>for People Search<\/strong><br \/>\nOur people-search is powered by a Scala-built service we called Hawkwind. It\u2019s a bunch of user objects dumped out by Hadoop, where the request is fanned out to multiple machine and then pulled back together.<\/p>\n<p><em><strong>Hosebird<\/strong><\/em><strong> for Streaming<\/strong><br \/>\nWe stream out tweets to public search engines, using a low-latency, HTTP-based, persistent connection system called Hosebird. We looked at queuing systems that financial-services companies use, but couldn\u2019t find anything that could handle the volume of the load. We built something on top of Jetty using Scala. We have more Scala-powered services in the works that I can\u2019t talk about.<\/p>\n<p><em><strong>Thrift<\/strong><\/em><strong> for Transferring Data<\/strong><br \/>\nWe use also Thrift, built at Facebook then open-sourced at Apache. With Thrift, you can define data structures and methods, and it deals with everything you don\u2019t want to deal with to efficiently represent data and get it from point A to point B. As your system evolves, your method signatures change, and Thrift has a nice system for creating positional arguments and being backwards compatible.<\/p>\n<p>These services make our life a lot easier. We often staff projects with two people who are pair programming, sitting together for six or eight weeks. These guys can build something like people-search in a couple of months.<\/p>\n<p>The only problem with so many different teams is that there is some divergence in terms of operational approaches \u2013 we have to work with ops guys to monitor the right stuff, be it disk or memory or what have you &#8212; but we can resolve that jitter over time. We\u2019re ok with the tradeoffs.<\/p>\n<p><strong>The Development Environment<\/strong><br \/>\nOK, now let\u2019s talk about the tools\u2026 the IDEs for Scala are not up to snuff, that is true. IntelliJ IDEA is good but it\u2019s shockingly buggy. The solution we\u2019ve settled on is just using a plain text editor. We use EMACS, as there\u2019s a really nice mode for the build tool. That takes compile\/test BS out of your workflow. Of course, you can give the IDEs a try. Even though I\u2019m an IDE cynic, maybe they\u2019ve improved; that said, a plain text editor can be really productive.<\/p>\n<p><strong>Simple Build Tool<\/strong><br \/>\nsbt is our Simple Build Tool, but it\u2019s not simple or limited in any way. It\u2019s Scala\u2019s answer to Ant and Maven, and really it\u2019s a superset of Ant and Maven. It\u2019ll set up a new project, create a nice project structure for you and manage dependencies &#8212; you can slap \u2018em right in by copying XML.<\/p>\n<p>You can write your own build-tasks. We added support for Thrift in an afternoon; it\u2019s got a library for shelling out, as Java is not so great at shell operations because it targets so many platforms. sbt is well well documented. And the absolutely coolest feature is that it\u2019s got an interactive console interface where you can type in code and see how it works.<\/p>\n<p>So that means sbt can insert you in an interactive way into your running program. This is great for debugging, great for sketching code out. You have a nice workflow where you don\u2019t have to worry about compilation.<\/p>\n<p><strong>specs<\/strong><br \/>\nWe\u2019re very test-driven, we\u2019re not wedded to behavior-driven development (BDD), but the best library in Scala is BDD-oriented. You can throw in different mocking libraries, and it works just as well in Scala as Java.<\/p>\n<p><strong>Libraries<\/strong><br \/>\nWe\u2019ve built a bunch of libraries. We gather a lot of stats, I mean, A LOT. We spent the first year of Twitter pushing forward on features, but never thinking about what we were building scientifically. That bit us in the ass in a big way.<\/p>\n<p>You\u2019ve probably seen a gradual increase in stability. At conferences, people ask us if it was the switch from Ruby to Scala, or if it was more machines. But really what did it was gathering numbers on everything, setting metrics and trying to improve.<\/p>\n<p><strong>Ostrich<\/strong> helps here. It is an in-process statistics gatherer, with counters, gauges, timers. You can share stats via JMX, JSON-over-HTTP etc. Hopefully it\u2019s pretty simple to use and easy to integrate.<\/p>\n<p><strong>Configgy<\/strong> manages configuration files and logging in a really nice, flexible way. You can include config files in one another and you can do inheritance; it throws in a really nice logging wrapper, with lazy evaluation on the values you\u2019re trying to log so you don\u2019t burn machine-time generating log statements. It has a subscription API for pushing out a new config file. It\u2019s a little crazy to have our own config file format, but Scala makes it work.<\/p>\n<p><strong>xrayspecs<\/strong>: this is an extension to specs, because we need a way to test concurrent operations. Some of the extensions in xrayspecs have been merged back into specs. We can freeze and unfreeze time.<\/p>\n<p><strong>scala-json<\/strong>: this is a better Scala JSON codec. We\u2019ve used this really heavily in production for a while. If you need something like this, hopefully it\u2019ll do the job.<\/p>\n<p><strong>Other Twitter Scala libraries<\/strong>: Naggatti (protocol builder for Apache Mina), Smile (Actor-powered memcached client), Querulous (a nice SQL database client) and Jackhammer (a load testing framework in its early stages). Check out GitHub for more.<\/p>\n<p><strong>How Do we Teach People?<\/strong><br \/>\nI think we\u2019re employing at Twitter about half the people in the world who know the Scala language. The other half are academics or at Foursquare. Even though Scala\u2019s getting more and more popular, fundamentally we can\u2019t hire people with experience in the language.<\/p>\n<p><strong>Pair Programming, Code Reviews<\/strong><br \/>\nTo start people out, we pair program. It isn\u2019t mandatory at Twitter, but it\u2019s a great way to learn Scala. We\u2019ve come up with a bunch of style guides. The good and bad thing is that Scala\u2019s going to be C++ in ten years, because there\u2019s just a lot of surface area and it can get complicated. For that reason, we are pretty rigorous about a style code.<\/p>\n<p>We do code reviews; it doesn\u2019t go into the master branch if it hasn\u2019t been reviewed by your peers. Right now, I\u2019m working with a guy we hired from Google. He\u2019s an amazing engineer, far better than I am, but at first he didn\u2019t know Scala.<\/p>\n<p>When I looked at his code, there was absolutely nothing wrong under the hood. But we\u2019d go through and say, &#8220;Here\u2019s where this line could be a little more idiomatic from a Scala perspective.&#8221; I do classes over lunch \u2013 but you need a big group to commit to come every week. Then there\u2019s my book, and there\u2019s other books: <a href=\"http:\/\/www.amazon.com\/exec\/obidos\/ASIN\/1430219890\/netmall05-20\">Dave Pollak&#8217;s book<\/a>, <a href=\"http:\/\/www.amazon.com\/Programming-Scala-Comprehensive-Step-step\/dp\/0981531601\/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1272720350&amp;sr=1-1\">the Odersky book<\/a> (Programming in Scala, aka \u201cthe stairway book\u201d). If you learn by example and need a desk reference, grab \u201cthe stairway book.\u201d Or search Google for a talk by my co-worker on \u201c<a href=\"http:\/\/blog.objectmentor.com\/articles\/2008\/08\/03\/the-seductions-of-scala-part-i\">The Seductions of Scala<\/a>\u201d for lots of examples<\/p>\n<p><strong>What Version of Scala Does Twitter Use?<\/strong><br \/>\nWe use 2.7. It\u2019s got a couple of warts, particularly in the collections classes. Scala 2.8 fixes a lot of those warts, and there\u2019s a bunch of performance work in there too, plus the ability to have named arguments in your functions.<a href=\"https:\/\/redfin.com\/blog\/devblog\/wp-content\/uploads\/sites\/3\/2010\/05\/Jeff-Hammerbacher.png\"><img decoding=\"async\" class=\"alignright size-full wp-image-297\" src=\"https:\/\/redfin.com\/blog\/devblog\/wp-content\/uploads\/sites\/3\/2010\/05\/Jeff-Hammerbacher.png\" alt=\"Jeff Hammerbacher\" width=\"176\" height=\"196\" \/><\/a><\/p>\n<p>I\u2019m co-organizing a Scala summit at <a href=\"http:\/\/www.oscon.com\/oscon2010\">the OSCON conference in Portland<\/a> this summer; come to that if you want to learn more! There\u2019s a great blog called <a href=\"http:\/\/daily-scala.blogspot.com\/\">DailyScala<\/a>, where an engineer writes about what he\u2019s learning. I learn stuff from that guy all the time\u2026<\/p>\n<p><em>And that was it! Many thanks to Alex for his magnificent talk, and to all the lovely folks who visited our offices! We had a lot of fun, we learned a ton, and now we\u2019re looking forward on May 20 to hearing from Cloudera&#8217;s Jay Hammerbacher &#8212; the man who conceived of and built the data team at Facebook &#8212; on Hadoop. <a href=\"http:\/\/www.facebook.com\/pages\/Engineer-to-Engineer-San-Francisco-Tech-Talks\/119013258113825#!\/event.php?eid=109949009040390&amp;ref=mf\">Everyone&#8217;s invited<\/a>!<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>To kick off our San Francisco series of engineer-to-engineer lectures on new technologies and interesting problems in consumer software, we invited in the Great Alex Payne to talk about how Twitter uses Scala, a programming language that combines traits of object-oriented languages and functional languages with an eye toward supporting concurrency better in large-scale software. [&hellip;]<\/p>\n","protected":false},"author":13210,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"default","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[57],"tags":[7],"dashboard":[],"coauthors":[],"class_list":["post-41506","post","type-post","status-publish","format-standard","hentry","category-company-news","tag-startup-culture"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v24.7 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Engineer-to-Engineer Talk: How and Why Twitter Uses Scala - Redfin Real Estate News<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.redfin.com\/news\/how_and_why_twitter_uses_scala\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Engineer-to-Engineer Talk: How and Why Twitter Uses Scala\" \/>\n<meta property=\"og:description\" content=\"To kick off our San Francisco series of engineer-to-engineer lectures on new technologies and interesting problems in consumer software, we invited in the Great Alex Payne to talk about how Twitter uses Scala, a programming language that combines traits of object-oriented languages and functional languages with an eye toward supporting concurrency better in large-scale software. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.redfin.com\/news\/how_and_why_twitter_uses_scala\/\" \/>\n<meta property=\"og:site_name\" content=\"Redfin Real Estate News\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/redfin\" \/>\n<meta property=\"article:published_time\" content=\"2010-05-01T13:44:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-10-05T20:12:36+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/alex.payne.usesthis.com\/images\/portraits\/alex.payne.jpg\" \/>\n<meta name=\"author\" content=\"Glenn Kelman\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@redfin\" \/>\n<meta name=\"twitter:site\" content=\"@redfin\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Glenn Kelman\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"15 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/how_and_why_twitter_uses_scala\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/how_and_why_twitter_uses_scala\\\/\"},\"author\":{\"name\":\"Glenn Kelman\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#\\\/schema\\\/person\\\/e9aeac4a4bba86fdea8b35bc1eee3bf5\"},\"headline\":\"Engineer-to-Engineer Talk: How and Why Twitter Uses Scala\",\"datePublished\":\"2010-05-01T13:44:24+00:00\",\"dateModified\":\"2020-10-05T20:12:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/how_and_why_twitter_uses_scala\\\/\"},\"wordCount\":3076,\"publisher\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/how_and_why_twitter_uses_scala\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/alex.payne.usesthis.com\\\/images\\\/portraits\\\/alex.payne.jpg\",\"keywords\":[\"Startup Culture\"],\"articleSection\":[\"Company News\"],\"inLanguage\":\"en-US\",\"copyrightYear\":\"2010\",\"copyrightHolder\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/how_and_why_twitter_uses_scala\\\/\",\"url\":\"https:\\\/\\\/www.redfin.com/news\\\/how_and_why_twitter_uses_scala\\\/\",\"name\":\"Engineer-to-Engineer Talk: How and Why Twitter Uses Scala - Redfin Real Estate News\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/how_and_why_twitter_uses_scala\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/how_and_why_twitter_uses_scala\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/alex.payne.usesthis.com\\\/images\\\/portraits\\\/alex.payne.jpg\",\"datePublished\":\"2010-05-01T13:44:24+00:00\",\"dateModified\":\"2020-10-05T20:12:36+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/how_and_why_twitter_uses_scala\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.redfin.com/news\\\/how_and_why_twitter_uses_scala\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/how_and_why_twitter_uses_scala\\\/#primaryimage\",\"url\":\"http:\\\/\\\/alex.payne.usesthis.com\\\/images\\\/portraits\\\/alex.payne.jpg\",\"contentUrl\":\"http:\\\/\\\/alex.payne.usesthis.com\\\/images\\\/portraits\\\/alex.payne.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/how_and_why_twitter_uses_scala\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.redfin.com/news\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Engineer-to-Engineer Talk: How and Why Twitter Uses Scala\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#website\",\"url\":\"https:\\\/\\\/www.redfin.com/news\\\/\",\"name\":\"Redfin Real Estate News\",\"description\":\"The latest real estate news and research from technology-powered residential real estate company, Redfin.\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.redfin.com/news\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#organization\",\"name\":\"Redfin\",\"url\":\"https:\\\/\\\/www.redfin.com/news\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.redfin.com\\\/news\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/Redfin-News-Logo.png\",\"contentUrl\":\"https:\\\/\\\/www.redfin.com\\\/news\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/Redfin-News-Logo.png\",\"width\":1100,\"height\":235,\"caption\":\"Redfin\"},\"image\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/redfin\",\"https:\\\/\\\/x.com\\\/redfin\",\"https:\\\/\\\/www.instagram.com\\\/redfinrealestate\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/redfin\",\"https:\\\/\\\/www.pinterest.com\\\/redfin\\\/\",\"https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/Redfin\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#\\\/schema\\\/person\\\/e9aeac4a4bba86fdea8b35bc1eee3bf5\",\"name\":\"Glenn Kelman\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/Glenn-Kelman-150x150.jpgfa7f906af68d26d155312d871c2a0433\",\"url\":\"https:\\\/\\\/www.redfin.com/news\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/Glenn-Kelman-150x150.jpg\",\"contentUrl\":\"https:\\\/\\\/www.redfin.com/news\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/Glenn-Kelman-150x150.jpg\",\"caption\":\"Glenn Kelman\"},\"description\":\"Glenn is the former CEO of Redfin. Prior to joining Redfin, he was a co-founder of Plumtree Software, a Sequoia-backed, publicly traded company that created the enterprise portal software market. In his seven years at Plumtree, Glenn at different times led engineering, marketing, product management, and business development; he also was responsible for financing and general operations in Plumtree's early days. Prior to starting Plumtree, Glenn worked as one of the first employees at Stanford Technology Group, a Sequoia-backed start-up acquired by IBM. Glenn was raised in Seattle and graduated from the University of California, Berkeley.\",\"url\":\"https:\\\/\\\/www.redfin.com/news\\\/author\\\/glenn-kelmanredfin-com\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Engineer-to-Engineer Talk: How and Why Twitter Uses Scala - Redfin Real Estate News","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.redfin.com\/news\/how_and_why_twitter_uses_scala\/","og_locale":"en_US","og_type":"article","og_title":"Engineer-to-Engineer Talk: How and Why Twitter Uses Scala","og_description":"To kick off our San Francisco series of engineer-to-engineer lectures on new technologies and interesting problems in consumer software, we invited in the Great Alex Payne to talk about how Twitter uses Scala, a programming language that combines traits of object-oriented languages and functional languages with an eye toward supporting concurrency better in large-scale software. [&hellip;]","og_url":"https:\/\/www.redfin.com\/news\/how_and_why_twitter_uses_scala\/","og_site_name":"Redfin Real Estate News","article_publisher":"https:\/\/www.facebook.com\/redfin","article_published_time":"2010-05-01T13:44:24+00:00","article_modified_time":"2020-10-05T20:12:36+00:00","og_image":[{"url":"http:\/\/alex.payne.usesthis.com\/images\/portraits\/alex.payne.jpg","type":"","width":"","height":""}],"author":"Glenn Kelman","twitter_card":"summary_large_image","twitter_creator":"@redfin","twitter_site":"@redfin","twitter_misc":{"Written by":"Glenn Kelman","Est. reading time":"15 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.redfin.com\/news\/how_and_why_twitter_uses_scala\/#article","isPartOf":{"@id":"https:\/\/www.redfin.com\/news\/how_and_why_twitter_uses_scala\/"},"author":{"name":"Glenn Kelman","@id":"https:\/\/www.redfin.com\/news\/#\/schema\/person\/e9aeac4a4bba86fdea8b35bc1eee3bf5"},"headline":"Engineer-to-Engineer Talk: How and Why Twitter Uses Scala","datePublished":"2010-05-01T13:44:24+00:00","dateModified":"2020-10-05T20:12:36+00:00","mainEntityOfPage":{"@id":"https:\/\/www.redfin.com\/news\/how_and_why_twitter_uses_scala\/"},"wordCount":3076,"publisher":{"@id":"https:\/\/www.redfin.com\/news\/#organization"},"image":{"@id":"https:\/\/www.redfin.com\/news\/how_and_why_twitter_uses_scala\/#primaryimage"},"thumbnailUrl":"http:\/\/alex.payne.usesthis.com\/images\/portraits\/alex.payne.jpg","keywords":["Startup Culture"],"articleSection":["Company News"],"inLanguage":"en-US","copyrightYear":"2010","copyrightHolder":{"@id":"https:\/\/www.redfin.com\/news\/#organization"}},{"@type":"WebPage","@id":"https:\/\/www.redfin.com\/news\/how_and_why_twitter_uses_scala\/","url":"https:\/\/www.redfin.com\/news\/how_and_why_twitter_uses_scala\/","name":"Engineer-to-Engineer Talk: How and Why Twitter Uses Scala - Redfin Real Estate News","isPartOf":{"@id":"https:\/\/www.redfin.com\/news\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.redfin.com\/news\/how_and_why_twitter_uses_scala\/#primaryimage"},"image":{"@id":"https:\/\/www.redfin.com\/news\/how_and_why_twitter_uses_scala\/#primaryimage"},"thumbnailUrl":"http:\/\/alex.payne.usesthis.com\/images\/portraits\/alex.payne.jpg","datePublished":"2010-05-01T13:44:24+00:00","dateModified":"2020-10-05T20:12:36+00:00","breadcrumb":{"@id":"https:\/\/www.redfin.com\/news\/how_and_why_twitter_uses_scala\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.redfin.com\/news\/how_and_why_twitter_uses_scala\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.redfin.com\/news\/how_and_why_twitter_uses_scala\/#primaryimage","url":"http:\/\/alex.payne.usesthis.com\/images\/portraits\/alex.payne.jpg","contentUrl":"http:\/\/alex.payne.usesthis.com\/images\/portraits\/alex.payne.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.redfin.com\/news\/how_and_why_twitter_uses_scala\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.redfin.com\/news\/"},{"@type":"ListItem","position":2,"name":"Engineer-to-Engineer Talk: How and Why Twitter Uses Scala"}]},{"@type":"WebSite","@id":"https:\/\/www.redfin.com\/news\/#website","url":"https:\/\/www.redfin.com\/news\/","name":"Redfin Real Estate News","description":"The latest real estate news and research from technology-powered residential real estate company, Redfin.","publisher":{"@id":"https:\/\/www.redfin.com\/news\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.redfin.com\/news\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.redfin.com\/news\/#organization","name":"Redfin","url":"https:\/\/www.redfin.com\/news\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.redfin.com\/news\/#\/schema\/logo\/image\/","url":"https:\/\/www.redfin.com\/news\/wp-content\/uploads\/2020\/10\/Redfin-News-Logo.png","contentUrl":"https:\/\/www.redfin.com\/news\/wp-content\/uploads\/2020\/10\/Redfin-News-Logo.png","width":1100,"height":235,"caption":"Redfin"},"image":{"@id":"https:\/\/www.redfin.com\/news\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/redfin","https:\/\/x.com\/redfin","https:\/\/www.instagram.com\/redfinrealestate\/","https:\/\/www.linkedin.com\/company\/redfin","https:\/\/www.pinterest.com\/redfin\/","https:\/\/en.wikipedia.org\/wiki\/Redfin"]},{"@type":"Person","@id":"https:\/\/www.redfin.com\/news\/#\/schema\/person\/e9aeac4a4bba86fdea8b35bc1eee3bf5","name":"Glenn Kelman","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.redfin.com\/news\/wp-content\/uploads\/2023\/06\/Glenn-Kelman-150x150.jpgfa7f906af68d26d155312d871c2a0433","url":"https:\/\/www.redfin.com\/news\/wp-content\/uploads\/2023\/06\/Glenn-Kelman-150x150.jpg","contentUrl":"https:\/\/www.redfin.com\/news\/wp-content\/uploads\/2023\/06\/Glenn-Kelman-150x150.jpg","caption":"Glenn Kelman"},"description":"Glenn is the former CEO of Redfin. Prior to joining Redfin, he was a co-founder of Plumtree Software, a Sequoia-backed, publicly traded company that created the enterprise portal software market. In his seven years at Plumtree, Glenn at different times led engineering, marketing, product management, and business development; he also was responsible for financing and general operations in Plumtree's early days. Prior to starting Plumtree, Glenn worked as one of the first employees at Stanford Technology Group, a Sequoia-backed start-up acquired by IBM. Glenn was raised in Seattle and graduated from the University of California, Berkeley.","url":"https:\/\/www.redfin.com\/news\/author\/glenn-kelmanredfin-com\/"}]}},"_links":{"self":[{"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/posts\/41506","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/users\/13210"}],"replies":[{"embeddable":true,"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/comments?post=41506"}],"version-history":[{"count":0,"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/posts\/41506\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/media?parent=41506"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/categories?post=41506"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/tags?post=41506"},{"taxonomy":"dashboard","embeddable":true,"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/dashboard?post=41506"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/coauthors?post=41506"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}