SlideShare uma empresa Scribd logo
1 de 36
Baixar para ler offline
Whitepages Practical 
Experience Converting from 
Ruby to Reactive 
John Nestor and Dragos Manolescu 
{jnestor,dmanolescu}@whitepages.com 
August 13, 2014
Disclaimer 
The following material is subjective and represents the views of 
the presenters. 
We hope our views and experience may be of use to others 
making the transitive from Ruby to Scala, but your mileage may 
vary. 
May 15, 2013
Whitepages Typesafe Case Study 
• WhitePages Rebuilds Core Parts of Application Stack with 
Scala and Akka to Improve Scaling. 
• http://j.mp/wpscala 
May 15, 2013
Outline 
• Background 
• Technology 
• People 
May 15, 2013
Background
About Whitepages 
• Top web and mobile site for finding phones, people and locations. 
• 50M unique users per month. 
• 35M search queries per day. 
• 70 engineers, mostly in Seattle. 
May 15, 2013
Why replace Ruby? 
Problems with Ruby legacy systems: 
• High latencies. 
• High resource consumption: memory and processors. 
• Poor tolerance of upstream degradation: 
– Limited concurrency. 
– Worker starvation when blocking on slow upstream. 
– Poor connection management and healing. 
May 15, 2013
Why replace Ruby with Scala? 
• Elegant blend of Functional and OO paradigms. 
• Static type system: 
• Type inference avoids the excess boilerplate of Java. 
• Compiler catches many errors. 
• Runs on the JVM: 
– Fast. 
– Near seamless interop with JVM libraries. 
– Reasonably mature tooling support. 
• Actor-based concurrency framework: Akka. 
May 15, 2013
Whitepages Reactive Services 
• Service-oriented-architecture where communication is Thrift 
or Json over HTTP. 
• Both latency and throughput are very important. 
• We require excellent logging and monitoring. 
• Agility of development, testing, build and deployment provide 
leverage and competitive advantage. 
May 15, 2013
Results 
Performance 
Service p50 ms p99 ms Throughput RPS/core 
DirSvc - 
Scala 25 300 80 
DirSvc - 
Ruby 
140 1200 7 
May 15, 2013
Status of Reactive Scala Services 
• We have been using Scala for a little more than 1.5 years. 
• We started with 1 development team, we now have 4. 
• We started with a single back end service. We now have 4 services in 
production and another 6 in development. 
• Our first project had 6 Scala developers, we now have over 20 Scala 
developers. 
• We changed not only language but also tools (more automation) and 
processes (more agile). 
May 15, 2013
Future Reactive Work 
• Transition additional Ruby back-end services to Scala. 
• Exploring new technologies: 
• Spark and Mesos. 
• A messaging system based on Kafka. 
• A graph store based on Titan/Cassandra. 
• A deployment and lifecycle-management system based on 
Docker that uses remote actors. 
May 15, 2013
Technology
• GitHub Enterprise 
• IntelliJ 
• Jenkins (for builds) 
• Artifactory 
• Yourkit 
• SCoverage 
• Scrooge (for thrift, from 
Twitter) 
Technology Selection 
• Scala 
• Akka 
• Spray 
• SBT – with custom plugins 
• Typesafe Config 
• Scala Test 
• Coda Hale Metrics 
• Persist Json 
May 15, 2013
Whitepages Service Framework 
• Configuration (based on Typesafe Config, with multi-level overrides). 
• Monitoring (central actor that uses Coda Hale metrics and publishes to Graphite, Nagios 
and Riemann). 
• Logging (custom system with central actor, Json log content and real time streaming to 
external analytics). 
• Admin REST API. 
• REST Thrift/JSON Server (based on Spray). 
• Clients (Spray, JDBC, Redis, SOLR, Riak,… -- advanced error detection/ recovery). 
May 15, 2013
Technology Successes 
• Scala concise syntax. – Higher developer productivity. 
• Use of async future based code. – Great performance. 
• Immutable collections and functional programming. – Fewer bugs. 
• Strong type checking. – Fewer bugs and more maintainable code (But meta-programming becomes 
more difficult). 
• Concurrency. – No race conditions or deadlock on complex concurrent system. 
• Spray. – Great performance and an async API. 
• SBT. – Able to easily customize to our needs (after steep learning curve). 
• IntelliJ IDEA. – Scala support is good and keeps getting better. 
• Typesafe Developer support contract. – Fast response, great answers to complex questions. (We 
should have gotten it earlier!) 
May 15, 2013
Technology Problems -1 
• Poor documentation: 
• SBT is the poster child. 
• We still often have to read source code of Scala and Akka libraries. 
• Stable APIs: 
• Typesafe has made great strides here. 
• Other components are still troublesome. 
• We lost many weeks as a result of breaking changes in Scala Test. 
• We currently can’t compile a 2.11 version of Kafka because the Zinc Scala 
compiler is not backward compatible. 
May 15, 2013
Technology Problems -2 
• Performance analysis of concurrent constructs: 
• We went with the Typesafe Console. 
• It never fully worked and then was abandoned. 
• There are some new tools, but we have not had time to evaluate. 
May 15, 2013
Technology Problems -3 
• Ecosystem: 
• Not as mature as the Java ecosystem and often missing Scala specific 
features. For example, Scala Mock does not support named 
parameters. 
• Some needed components were missing: until recently code coverage. 
• In some cases there were too many options: over 10 Json libraries. 
• Lots of Scala GitHub projects. Quality is variable; many become 
abandoned. 
May 15, 2013
Technology Problems -4 
• Debugging: 
• Debuggers work on the Java byte code, that for some Scala constructs 
is quite convoluted. 
• Debugging chains of futures is much harder than debugging nested 
calls. Some kind of tracing is desperately needed. 
• Actors have lots of power but can be exceptionally hard to debug. We 
need both better approaches to building debug-able actors and better 
debugging tools. 
May 15, 2013
Technology Problems -5 
• Language and Library Issues: 
• Type erasure is a major flaw in the Scala language. It causes lots of 
developer confusion and errors. The workarounds are awkward at 
best. 
• The lack of type checking on Actor constructors is an odd hole in the 
type checking and a real annoyance. 
• Some Scala code that looks simple and intuitive creates major 
difficulties when a developer needs to understand what is really going 
on. Implicits are one of many problems here. 
May 15, 2013
Technology Overall 
• The problems mentioned above create real day to day difficulties. 
• In many cases Typesafe has been actively working to incrementally 
correct some of these problems. 
• Since we started using Scala, the number of problems has significantly 
decreased and we expect that trend to continue. 
• Overall, Scala/Akka is a great technology for building reactive systems 
and its benefits far outweigh the problems. 
May 15, 2013
People
Levels of Scala Expertise 
• Basic OO features. Easy transition from most other languages including 
Java and Ruby. 
• Adding functional. Ruby has functional features that are similar. But 
knowing when best to use functional versus OO requires experience. 
• Adding concurrency. Via futures, promises, and actors. A whole new world 
for Ruby programmers that requires a new way of thinking. 
• API design. Not all developers need to design reusable APIs, but those that 
do need a higher level of experience and feature mastery to do it well. 
May 15, 2013
Building Scala Development Teams 
• The are still not a large number of experienced Scala developers. 
• Those out there are in considerable demand. 
• We have followed a mixed strategy of both recruiting Scala developers and 
also training existing Ruby developers to become Scala developers. 
• Having an experienced Scala developer greatly accelerated the training of 
Ruby developers. 
Note: Using Scala, Akka and other advanced technologies makes Whitepages 
very attractive to some of the very best developers. 
May 15, 2013
Recruiting: Finding Developers 
• Personal contacts. The best way to find great developers. 
• Meet-ups and Events 
• John Nestor is the organizer for the Seattle Scala meet-up. 
• Whitepages hosts the Scala meet-up (and several others) 
• Whitepages sponsors many other technology conferences and events. 
• Job posts: local Seattle and internet Scala focused. 
• College recruiting events. UW and other top CS schools. 
May 15, 2013
Recruiting: Attracting Developers 
• Strong support from the Whitepages CTO and CEO and other management for Scala 
and other advanced technologies. 
• We have a great office (recently completely redone) 
• We provide developers with the best workstations (top-end MacBook pros). 
• We have competitive benefits, excellent work-life balance and a collaborative 
supportive culture. 
May 15, 2013
Training: External Resources 
• Books. Odersky: Programming in Scala, and others 
• Coursera. Functional programming, reactive programming. 
• Typesafe training classes. Both Seattle public and in-house. 
• Typesafe developer support contract and consulting. Particularly valuable 
if you don’t have in-house Scala expertise. 
• Conferences. We sent people to Scala Days in NY and Berlin. 
May 15, 2013
Training: Internal Resources 
• Whitepages developers are in a single office and come in most days. 
• This permits a high degree of personal interactions. 
• Those interactions enable rapid learning and high code quality. 
• This would be much harder with multiple offices and/or widely distributed 
teams. 
May 15, 2013
Training: Internal Approaches 
• Expert mentoring. 
• Provide quick answers to questions. 
• Detailed reviews and feedback for Ruby developers initial Scala code. 
• Code reviews 
• Improve code quality. 
• Help those learning Scala. 
• Develop a shared culture and style. 
• We use a mixture of group and pair code reviews. 
• Electronic means like code review tools and pull requests were less effective. 
May 15, 2013
Training: Success and Failure 
• Not everyone made a successful transition from Ruby to Scala. 
• Next slide give some positive and negative indicators… 
May 15, 2013
Training: What to Look For 
• Desire to learn new technologies. 
• Desire to learn new ways to think. 
• Prior functional language experience. 
• Likes to work closely with others. 
May 15, 2013
Scala Features to Avoid 
• Scala is a very large language. 
• New developers can easily get lost on the rich feature set. Often there are 
several different ways of doing something, and they don’t always know 
how to choose. 
– We also provide the following list of features for new developers to 
avoid (or to fully understand before using). 
– We encourage asking more experienced developers to provide that 
understanding. 
– These features are also flags for discussion in code reviews. 
May 15, 2013
Scala Features to Avoid 
• Reflection and macros 
• asInstanceOf 
• Top level objects with mutable 
state 
• Lazy vals 
• Scala enumerations 
• ? (the ask pattern) 
• onComplete (unless body 
enclosed in try) 
• Nulls 
• Return, break, continue 
• Mutable collections 
• var, while, until 
• Generics 
• Implicits 
• Actors 
• Await 
May 15, 2013
We Are Hiring*! 
May 2013 
*Smart people (not just technologies) are key to our success
Thank you! 
Questions?

Mais conteúdo relacionado

Mais procurados

AMIS Beyond the Horizon - High density deployments using weblogic multitenancy
AMIS Beyond the Horizon - High density deployments using weblogic multitenancyAMIS Beyond the Horizon - High density deployments using weblogic multitenancy
AMIS Beyond the Horizon - High density deployments using weblogic multitenancyJaap Poot
 
Migración desde BBDD propietarias a MariaDB
Migración desde BBDD propietarias a MariaDBMigración desde BBDD propietarias a MariaDB
Migración desde BBDD propietarias a MariaDBMariaDB plc
 
Being With Rails App For 3 Years
Being With Rails App For 3 YearsBeing With Rails App For 3 Years
Being With Rails App For 3 Yearsdeeeki
 
Productionizing H2O Models with Apache Spark with Jakub Hava and Michal Maloh...
Productionizing H2O Models with Apache Spark with Jakub Hava and Michal Maloh...Productionizing H2O Models with Apache Spark with Jakub Hava and Michal Maloh...
Productionizing H2O Models with Apache Spark with Jakub Hava and Michal Maloh...Databricks
 
Scala for java developers 6 may 2017 - yeni
Scala for java developers   6 may 2017 - yeniScala for java developers   6 may 2017 - yeni
Scala for java developers 6 may 2017 - yeniBaris Dere
 
Silicon Valley JUG meetup July 18, 2018
Silicon Valley JUG meetup July 18, 2018Silicon Valley JUG meetup July 18, 2018
Silicon Valley JUG meetup July 18, 2018Oracle Developers
 
Getting Ready to Use Redis with Apache Spark with Tague Griffith
Getting Ready to Use Redis with Apache Spark with Tague GriffithGetting Ready to Use Redis with Apache Spark with Tague Griffith
Getting Ready to Use Redis with Apache Spark with Tague GriffithDatabricks
 
Getting started with Apache Spark
Getting started with Apache SparkGetting started with Apache Spark
Getting started with Apache SparkHabib Ahmed Bhutto
 
The databases in SSDT: A work with project and best practices
The databases in SSDT: A work with project and best practicesThe databases in SSDT: A work with project and best practices
The databases in SSDT: A work with project and best practicesKamil Nowinski
 
Effective Microservices In a Data-centric World
Effective Microservices In a Data-centric WorldEffective Microservices In a Data-centric World
Effective Microservices In a Data-centric WorldRandy Shoup
 
Using RAML 1.0 Like a Pro
Using RAML 1.0 Like a ProUsing RAML 1.0 Like a Pro
Using RAML 1.0 Like a ProMuleSoft
 
Managing Data in Microservices
Managing Data in MicroservicesManaging Data in Microservices
Managing Data in MicroservicesRandy Shoup
 
Cross-platform interaction
Cross-platform interactionCross-platform interaction
Cross-platform interactionOleksii Duhno
 
David Max SATURN 2018 - Migrating from Oracle to Espresso
David Max SATURN 2018 - Migrating from Oracle to EspressoDavid Max SATURN 2018 - Migrating from Oracle to Espresso
David Max SATURN 2018 - Migrating from Oracle to EspressoDavid Max
 
Bridging Oracle Database and Hadoop by Alex Gorbachev, Pythian from Oracle Op...
Bridging Oracle Database and Hadoop by Alex Gorbachev, Pythian from Oracle Op...Bridging Oracle Database and Hadoop by Alex Gorbachev, Pythian from Oracle Op...
Bridging Oracle Database and Hadoop by Alex Gorbachev, Pythian from Oracle Op...Alex Gorbachev
 
Delivering changes for applications and databases
Delivering changes for applications and databasesDelivering changes for applications and databases
Delivering changes for applications and databasesEduardo Piairo
 
CDP.pl - tech case study by Divante
CDP.pl - tech case study by DivanteCDP.pl - tech case study by Divante
CDP.pl - tech case study by DivanteDivante
 

Mais procurados (20)

AMIS Beyond the Horizon - High density deployments using weblogic multitenancy
AMIS Beyond the Horizon - High density deployments using weblogic multitenancyAMIS Beyond the Horizon - High density deployments using weblogic multitenancy
AMIS Beyond the Horizon - High density deployments using weblogic multitenancy
 
JavaCro'15 - Java Certification – in theory and practice - Branko Mihaljević,...
JavaCro'15 - Java Certification – in theory and practice - Branko Mihaljević,...JavaCro'15 - Java Certification – in theory and practice - Branko Mihaljević,...
JavaCro'15 - Java Certification – in theory and practice - Branko Mihaljević,...
 
Migración desde BBDD propietarias a MariaDB
Migración desde BBDD propietarias a MariaDBMigración desde BBDD propietarias a MariaDB
Migración desde BBDD propietarias a MariaDB
 
Being With Rails App For 3 Years
Being With Rails App For 3 YearsBeing With Rails App For 3 Years
Being With Rails App For 3 Years
 
Productionizing H2O Models with Apache Spark with Jakub Hava and Michal Maloh...
Productionizing H2O Models with Apache Spark with Jakub Hava and Michal Maloh...Productionizing H2O Models with Apache Spark with Jakub Hava and Michal Maloh...
Productionizing H2O Models with Apache Spark with Jakub Hava and Michal Maloh...
 
Scala for java developers 6 may 2017 - yeni
Scala for java developers   6 may 2017 - yeniScala for java developers   6 may 2017 - yeni
Scala for java developers 6 may 2017 - yeni
 
Silicon Valley JUG meetup July 18, 2018
Silicon Valley JUG meetup July 18, 2018Silicon Valley JUG meetup July 18, 2018
Silicon Valley JUG meetup July 18, 2018
 
Getting Ready to Use Redis with Apache Spark with Tague Griffith
Getting Ready to Use Redis with Apache Spark with Tague GriffithGetting Ready to Use Redis with Apache Spark with Tague Griffith
Getting Ready to Use Redis with Apache Spark with Tague Griffith
 
Getting started with Apache Spark
Getting started with Apache SparkGetting started with Apache Spark
Getting started with Apache Spark
 
The databases in SSDT: A work with project and best practices
The databases in SSDT: A work with project and best practicesThe databases in SSDT: A work with project and best practices
The databases in SSDT: A work with project and best practices
 
Effective Microservices In a Data-centric World
Effective Microservices In a Data-centric WorldEffective Microservices In a Data-centric World
Effective Microservices In a Data-centric World
 
Epita pres
Epita presEpita pres
Epita pres
 
Using RAML 1.0 Like a Pro
Using RAML 1.0 Like a ProUsing RAML 1.0 Like a Pro
Using RAML 1.0 Like a Pro
 
Managing Data in Microservices
Managing Data in MicroservicesManaging Data in Microservices
Managing Data in Microservices
 
Cross-platform interaction
Cross-platform interactionCross-platform interaction
Cross-platform interaction
 
David Max SATURN 2018 - Migrating from Oracle to Espresso
David Max SATURN 2018 - Migrating from Oracle to EspressoDavid Max SATURN 2018 - Migrating from Oracle to Espresso
David Max SATURN 2018 - Migrating from Oracle to Espresso
 
Bridging Oracle Database and Hadoop by Alex Gorbachev, Pythian from Oracle Op...
Bridging Oracle Database and Hadoop by Alex Gorbachev, Pythian from Oracle Op...Bridging Oracle Database and Hadoop by Alex Gorbachev, Pythian from Oracle Op...
Bridging Oracle Database and Hadoop by Alex Gorbachev, Pythian from Oracle Op...
 
Delivering changes for applications and databases
Delivering changes for applications and databasesDelivering changes for applications and databases
Delivering changes for applications and databases
 
Be faster then rabbits
Be faster then rabbitsBe faster then rabbits
Be faster then rabbits
 
CDP.pl - tech case study by Divante
CDP.pl - tech case study by DivanteCDP.pl - tech case study by Divante
CDP.pl - tech case study by Divante
 

Destaque

µServices Architecture @ EPAM WOW 2015
µServices Architecture @ EPAM WOW 2015µServices Architecture @ EPAM WOW 2015
µServices Architecture @ EPAM WOW 2015Izzet Mustafaiev
 
Distributed Reactive Architecture: Extending SOA with Events
Distributed Reactive Architecture: Extending SOA with EventsDistributed Reactive Architecture: Extending SOA with Events
Distributed Reactive Architecture: Extending SOA with EventsSteve Pember
 
Reactive Reatime Big Data with Open Source Lambda Architecture - TechCampVN 2014
Reactive Reatime Big Data with Open Source Lambda Architecture - TechCampVN 2014Reactive Reatime Big Data with Open Source Lambda Architecture - TechCampVN 2014
Reactive Reatime Big Data with Open Source Lambda Architecture - TechCampVN 2014Trieu Nguyen
 
Reactive Microservice Architecture with Groovy and Grails
Reactive Microservice Architecture with Groovy and GrailsReactive Microservice Architecture with Groovy and Grails
Reactive Microservice Architecture with Groovy and GrailsSteve Pember
 
Refactoring to Java 8 (QCon New York)
Refactoring to Java 8 (QCon New York)Refactoring to Java 8 (QCon New York)
Refactoring to Java 8 (QCon New York)Trisha Gee
 
Why Reactive Architecture Will Take Over The World (and why we should be wary...
Why Reactive Architecture Will Take Over The World (and why we should be wary...Why Reactive Architecture Will Take Over The World (and why we should be wary...
Why Reactive Architecture Will Take Over The World (and why we should be wary...Steve Pember
 
Introduction to Amazon Web Services - How to Scale your Next Idea on AWS : A ...
Introduction to Amazon Web Services - How to Scale your Next Idea on AWS : A ...Introduction to Amazon Web Services - How to Scale your Next Idea on AWS : A ...
Introduction to Amazon Web Services - How to Scale your Next Idea on AWS : A ...Amazon Web Services
 

Destaque (7)

µServices Architecture @ EPAM WOW 2015
µServices Architecture @ EPAM WOW 2015µServices Architecture @ EPAM WOW 2015
µServices Architecture @ EPAM WOW 2015
 
Distributed Reactive Architecture: Extending SOA with Events
Distributed Reactive Architecture: Extending SOA with EventsDistributed Reactive Architecture: Extending SOA with Events
Distributed Reactive Architecture: Extending SOA with Events
 
Reactive Reatime Big Data with Open Source Lambda Architecture - TechCampVN 2014
Reactive Reatime Big Data with Open Source Lambda Architecture - TechCampVN 2014Reactive Reatime Big Data with Open Source Lambda Architecture - TechCampVN 2014
Reactive Reatime Big Data with Open Source Lambda Architecture - TechCampVN 2014
 
Reactive Microservice Architecture with Groovy and Grails
Reactive Microservice Architecture with Groovy and GrailsReactive Microservice Architecture with Groovy and Grails
Reactive Microservice Architecture with Groovy and Grails
 
Refactoring to Java 8 (QCon New York)
Refactoring to Java 8 (QCon New York)Refactoring to Java 8 (QCon New York)
Refactoring to Java 8 (QCon New York)
 
Why Reactive Architecture Will Take Over The World (and why we should be wary...
Why Reactive Architecture Will Take Over The World (and why we should be wary...Why Reactive Architecture Will Take Over The World (and why we should be wary...
Why Reactive Architecture Will Take Over The World (and why we should be wary...
 
Introduction to Amazon Web Services - How to Scale your Next Idea on AWS : A ...
Introduction to Amazon Web Services - How to Scale your Next Idea on AWS : A ...Introduction to Amazon Web Services - How to Scale your Next Idea on AWS : A ...
Introduction to Amazon Web Services - How to Scale your Next Idea on AWS : A ...
 

Semelhante a Whitepages Practical Experience Converting from Ruby to Reactive

Experience Converting from Ruby to Scala
Experience Converting from Ruby to ScalaExperience Converting from Ruby to Scala
Experience Converting from Ruby to ScalaJohn Nestor
 
From java to scala at crowd mix
From java to scala at crowd mixFrom java to scala at crowd mix
From java to scala at crowd mixStefano Galarraga
 
Scala adoption by enterprises
Scala adoption by enterprisesScala adoption by enterprises
Scala adoption by enterprisesMike Slinn
 
Transitioning from Java to Scala for Spark - March 13, 2019
Transitioning from Java to Scala for Spark - March 13, 2019Transitioning from Java to Scala for Spark - March 13, 2019
Transitioning from Java to Scala for Spark - March 13, 2019Gravy Analytics
 
Play Architecture, Implementation, Shiny Objects, and a Proposal
Play Architecture, Implementation, Shiny Objects, and a ProposalPlay Architecture, Implementation, Shiny Objects, and a Proposal
Play Architecture, Implementation, Shiny Objects, and a ProposalMike Slinn
 
Functional Scala 2022 - scalajs Alexis.pdf
Functional Scala 2022 - scalajs Alexis.pdfFunctional Scala 2022 - scalajs Alexis.pdf
Functional Scala 2022 - scalajs Alexis.pdfssusercd195b
 
From Rails legacy to DDD - Pivorak, Lviv
From Rails legacy to DDD - Pivorak, LvivFrom Rails legacy to DDD - Pivorak, Lviv
From Rails legacy to DDD - Pivorak, LvivAndrzej Krzywda
 
How we use the play framework
How we use the play frameworkHow we use the play framework
How we use the play frameworkItai Gilo
 
GraphQL-ify your APIs - Devoxx UK 2021
 GraphQL-ify your APIs - Devoxx UK 2021 GraphQL-ify your APIs - Devoxx UK 2021
GraphQL-ify your APIs - Devoxx UK 2021Soham Dasgupta
 
IncQuery Server for Teamwork Cloud - Talk at IW2019
IncQuery Server for Teamwork Cloud - Talk at IW2019IncQuery Server for Teamwork Cloud - Talk at IW2019
IncQuery Server for Teamwork Cloud - Talk at IW2019Istvan Rath
 
Swagger - Making REST APIs friendlier
Swagger - Making REST APIs friendlierSwagger - Making REST APIs friendlier
Swagger - Making REST APIs friendlierMiroslav Resetar
 
Scala services in action
Scala services in actionScala services in action
Scala services in actionUnderscore
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLBarry Jones
 
Scala Days Highlights | BoldRadius
Scala Days Highlights | BoldRadiusScala Days Highlights | BoldRadius
Scala Days Highlights | BoldRadiusBoldRadius Solutions
 

Semelhante a Whitepages Practical Experience Converting from Ruby to Reactive (20)

Experience Converting from Ruby to Scala
Experience Converting from Ruby to ScalaExperience Converting from Ruby to Scala
Experience Converting from Ruby to Scala
 
From java to scala at crowd mix
From java to scala at crowd mixFrom java to scala at crowd mix
From java to scala at crowd mix
 
Scala adoption by enterprises
Scala adoption by enterprisesScala adoption by enterprises
Scala adoption by enterprises
 
Transitioning from Java to Scala for Spark - March 13, 2019
Transitioning from Java to Scala for Spark - March 13, 2019Transitioning from Java to Scala for Spark - March 13, 2019
Transitioning from Java to Scala for Spark - March 13, 2019
 
Frontend as a first class citizen
Frontend as a first class citizenFrontend as a first class citizen
Frontend as a first class citizen
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
Play Architecture, Implementation, Shiny Objects, and a Proposal
Play Architecture, Implementation, Shiny Objects, and a ProposalPlay Architecture, Implementation, Shiny Objects, and a Proposal
Play Architecture, Implementation, Shiny Objects, and a Proposal
 
Functional Scala 2022 - scalajs Alexis.pdf
Functional Scala 2022 - scalajs Alexis.pdfFunctional Scala 2022 - scalajs Alexis.pdf
Functional Scala 2022 - scalajs Alexis.pdf
 
From Rails legacy to DDD - Pivorak, Lviv
From Rails legacy to DDD - Pivorak, LvivFrom Rails legacy to DDD - Pivorak, Lviv
From Rails legacy to DDD - Pivorak, Lviv
 
How we use the play framework
How we use the play frameworkHow we use the play framework
How we use the play framework
 
Stackato v2
Stackato v2Stackato v2
Stackato v2
 
GraphQL-ify your APIs - Devoxx UK 2021
 GraphQL-ify your APIs - Devoxx UK 2021 GraphQL-ify your APIs - Devoxx UK 2021
GraphQL-ify your APIs - Devoxx UK 2021
 
IncQuery Server for Teamwork Cloud - Talk at IW2019
IncQuery Server for Teamwork Cloud - Talk at IW2019IncQuery Server for Teamwork Cloud - Talk at IW2019
IncQuery Server for Teamwork Cloud - Talk at IW2019
 
Stackato v4
Stackato v4Stackato v4
Stackato v4
 
DataOps with Project Amaterasu
DataOps with Project AmaterasuDataOps with Project Amaterasu
DataOps with Project Amaterasu
 
Swagger - Making REST APIs friendlier
Swagger - Making REST APIs friendlierSwagger - Making REST APIs friendlier
Swagger - Making REST APIs friendlier
 
Scala services in action
Scala services in actionScala services in action
Scala services in action
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQL
 
GraphQL Europe Recap
GraphQL Europe RecapGraphQL Europe Recap
GraphQL Europe Recap
 
Scala Days Highlights | BoldRadius
Scala Days Highlights | BoldRadiusScala Days Highlights | BoldRadius
Scala Days Highlights | BoldRadius
 

Último

%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 

Último (20)

%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 

Whitepages Practical Experience Converting from Ruby to Reactive

  • 1. Whitepages Practical Experience Converting from Ruby to Reactive John Nestor and Dragos Manolescu {jnestor,dmanolescu}@whitepages.com August 13, 2014
  • 2. Disclaimer The following material is subjective and represents the views of the presenters. We hope our views and experience may be of use to others making the transitive from Ruby to Scala, but your mileage may vary. May 15, 2013
  • 3. Whitepages Typesafe Case Study • WhitePages Rebuilds Core Parts of Application Stack with Scala and Akka to Improve Scaling. • http://j.mp/wpscala May 15, 2013
  • 4. Outline • Background • Technology • People May 15, 2013
  • 6. About Whitepages • Top web and mobile site for finding phones, people and locations. • 50M unique users per month. • 35M search queries per day. • 70 engineers, mostly in Seattle. May 15, 2013
  • 7. Why replace Ruby? Problems with Ruby legacy systems: • High latencies. • High resource consumption: memory and processors. • Poor tolerance of upstream degradation: – Limited concurrency. – Worker starvation when blocking on slow upstream. – Poor connection management and healing. May 15, 2013
  • 8. Why replace Ruby with Scala? • Elegant blend of Functional and OO paradigms. • Static type system: • Type inference avoids the excess boilerplate of Java. • Compiler catches many errors. • Runs on the JVM: – Fast. – Near seamless interop with JVM libraries. – Reasonably mature tooling support. • Actor-based concurrency framework: Akka. May 15, 2013
  • 9. Whitepages Reactive Services • Service-oriented-architecture where communication is Thrift or Json over HTTP. • Both latency and throughput are very important. • We require excellent logging and monitoring. • Agility of development, testing, build and deployment provide leverage and competitive advantage. May 15, 2013
  • 10. Results Performance Service p50 ms p99 ms Throughput RPS/core DirSvc - Scala 25 300 80 DirSvc - Ruby 140 1200 7 May 15, 2013
  • 11. Status of Reactive Scala Services • We have been using Scala for a little more than 1.5 years. • We started with 1 development team, we now have 4. • We started with a single back end service. We now have 4 services in production and another 6 in development. • Our first project had 6 Scala developers, we now have over 20 Scala developers. • We changed not only language but also tools (more automation) and processes (more agile). May 15, 2013
  • 12. Future Reactive Work • Transition additional Ruby back-end services to Scala. • Exploring new technologies: • Spark and Mesos. • A messaging system based on Kafka. • A graph store based on Titan/Cassandra. • A deployment and lifecycle-management system based on Docker that uses remote actors. May 15, 2013
  • 14. • GitHub Enterprise • IntelliJ • Jenkins (for builds) • Artifactory • Yourkit • SCoverage • Scrooge (for thrift, from Twitter) Technology Selection • Scala • Akka • Spray • SBT – with custom plugins • Typesafe Config • Scala Test • Coda Hale Metrics • Persist Json May 15, 2013
  • 15. Whitepages Service Framework • Configuration (based on Typesafe Config, with multi-level overrides). • Monitoring (central actor that uses Coda Hale metrics and publishes to Graphite, Nagios and Riemann). • Logging (custom system with central actor, Json log content and real time streaming to external analytics). • Admin REST API. • REST Thrift/JSON Server (based on Spray). • Clients (Spray, JDBC, Redis, SOLR, Riak,… -- advanced error detection/ recovery). May 15, 2013
  • 16. Technology Successes • Scala concise syntax. – Higher developer productivity. • Use of async future based code. – Great performance. • Immutable collections and functional programming. – Fewer bugs. • Strong type checking. – Fewer bugs and more maintainable code (But meta-programming becomes more difficult). • Concurrency. – No race conditions or deadlock on complex concurrent system. • Spray. – Great performance and an async API. • SBT. – Able to easily customize to our needs (after steep learning curve). • IntelliJ IDEA. – Scala support is good and keeps getting better. • Typesafe Developer support contract. – Fast response, great answers to complex questions. (We should have gotten it earlier!) May 15, 2013
  • 17. Technology Problems -1 • Poor documentation: • SBT is the poster child. • We still often have to read source code of Scala and Akka libraries. • Stable APIs: • Typesafe has made great strides here. • Other components are still troublesome. • We lost many weeks as a result of breaking changes in Scala Test. • We currently can’t compile a 2.11 version of Kafka because the Zinc Scala compiler is not backward compatible. May 15, 2013
  • 18. Technology Problems -2 • Performance analysis of concurrent constructs: • We went with the Typesafe Console. • It never fully worked and then was abandoned. • There are some new tools, but we have not had time to evaluate. May 15, 2013
  • 19. Technology Problems -3 • Ecosystem: • Not as mature as the Java ecosystem and often missing Scala specific features. For example, Scala Mock does not support named parameters. • Some needed components were missing: until recently code coverage. • In some cases there were too many options: over 10 Json libraries. • Lots of Scala GitHub projects. Quality is variable; many become abandoned. May 15, 2013
  • 20. Technology Problems -4 • Debugging: • Debuggers work on the Java byte code, that for some Scala constructs is quite convoluted. • Debugging chains of futures is much harder than debugging nested calls. Some kind of tracing is desperately needed. • Actors have lots of power but can be exceptionally hard to debug. We need both better approaches to building debug-able actors and better debugging tools. May 15, 2013
  • 21. Technology Problems -5 • Language and Library Issues: • Type erasure is a major flaw in the Scala language. It causes lots of developer confusion and errors. The workarounds are awkward at best. • The lack of type checking on Actor constructors is an odd hole in the type checking and a real annoyance. • Some Scala code that looks simple and intuitive creates major difficulties when a developer needs to understand what is really going on. Implicits are one of many problems here. May 15, 2013
  • 22. Technology Overall • The problems mentioned above create real day to day difficulties. • In many cases Typesafe has been actively working to incrementally correct some of these problems. • Since we started using Scala, the number of problems has significantly decreased and we expect that trend to continue. • Overall, Scala/Akka is a great technology for building reactive systems and its benefits far outweigh the problems. May 15, 2013
  • 24. Levels of Scala Expertise • Basic OO features. Easy transition from most other languages including Java and Ruby. • Adding functional. Ruby has functional features that are similar. But knowing when best to use functional versus OO requires experience. • Adding concurrency. Via futures, promises, and actors. A whole new world for Ruby programmers that requires a new way of thinking. • API design. Not all developers need to design reusable APIs, but those that do need a higher level of experience and feature mastery to do it well. May 15, 2013
  • 25. Building Scala Development Teams • The are still not a large number of experienced Scala developers. • Those out there are in considerable demand. • We have followed a mixed strategy of both recruiting Scala developers and also training existing Ruby developers to become Scala developers. • Having an experienced Scala developer greatly accelerated the training of Ruby developers. Note: Using Scala, Akka and other advanced technologies makes Whitepages very attractive to some of the very best developers. May 15, 2013
  • 26. Recruiting: Finding Developers • Personal contacts. The best way to find great developers. • Meet-ups and Events • John Nestor is the organizer for the Seattle Scala meet-up. • Whitepages hosts the Scala meet-up (and several others) • Whitepages sponsors many other technology conferences and events. • Job posts: local Seattle and internet Scala focused. • College recruiting events. UW and other top CS schools. May 15, 2013
  • 27. Recruiting: Attracting Developers • Strong support from the Whitepages CTO and CEO and other management for Scala and other advanced technologies. • We have a great office (recently completely redone) • We provide developers with the best workstations (top-end MacBook pros). • We have competitive benefits, excellent work-life balance and a collaborative supportive culture. May 15, 2013
  • 28. Training: External Resources • Books. Odersky: Programming in Scala, and others • Coursera. Functional programming, reactive programming. • Typesafe training classes. Both Seattle public and in-house. • Typesafe developer support contract and consulting. Particularly valuable if you don’t have in-house Scala expertise. • Conferences. We sent people to Scala Days in NY and Berlin. May 15, 2013
  • 29. Training: Internal Resources • Whitepages developers are in a single office and come in most days. • This permits a high degree of personal interactions. • Those interactions enable rapid learning and high code quality. • This would be much harder with multiple offices and/or widely distributed teams. May 15, 2013
  • 30. Training: Internal Approaches • Expert mentoring. • Provide quick answers to questions. • Detailed reviews and feedback for Ruby developers initial Scala code. • Code reviews • Improve code quality. • Help those learning Scala. • Develop a shared culture and style. • We use a mixture of group and pair code reviews. • Electronic means like code review tools and pull requests were less effective. May 15, 2013
  • 31. Training: Success and Failure • Not everyone made a successful transition from Ruby to Scala. • Next slide give some positive and negative indicators… May 15, 2013
  • 32. Training: What to Look For • Desire to learn new technologies. • Desire to learn new ways to think. • Prior functional language experience. • Likes to work closely with others. May 15, 2013
  • 33. Scala Features to Avoid • Scala is a very large language. • New developers can easily get lost on the rich feature set. Often there are several different ways of doing something, and they don’t always know how to choose. – We also provide the following list of features for new developers to avoid (or to fully understand before using). – We encourage asking more experienced developers to provide that understanding. – These features are also flags for discussion in code reviews. May 15, 2013
  • 34. Scala Features to Avoid • Reflection and macros • asInstanceOf • Top level objects with mutable state • Lazy vals • Scala enumerations • ? (the ask pattern) • onComplete (unless body enclosed in try) • Nulls • Return, break, continue • Mutable collections • var, while, until • Generics • Implicits • Actors • Await May 15, 2013
  • 35. We Are Hiring*! May 2013 *Smart people (not just technologies) are key to our success