Wix was founded in 2006, with the goal of simplifying website creation for everyone, regardless of their technical skills Today if your family member needs to create a website to share photos, or if your friend is creating a website for a yoga studio or consultancy business - chances are high that they’ll choose Wix. That’s because the company has successfully lowered the barrier to entry for anyone who wants to contribute a professional online presence. So much so, that it already has over 50 million registered users, continues to grow by over a million new users a month and in November 2013 started trading on the NASDAQ.
Wix’ mission is to equip everyone - whether they're individuals or an SMB – with the tools to create and manage their own professional presence online. From storing and managing contacts lists to a user-friendly newsletter creation tool, Wix is much more than a website creation platform but a place to manage multiple aspects of a business online. Today the company offers an extensive and vibrant app market that allows 3rd party developers to build apps that Wix’s 50 million users can seamlessly integrate onto their websites to add additional functionalities and capabilities.
Why Wix Switched from Java to Scala
In 2011, Wix was in a great position. The still relatively young company already had 5 million users. Most of its code was written on Java, it had a service-oriented architecture spanning several different services, a living and breathing product working at scale — and the company had already solved a lot of the common scale problems that might typically cause a hyper-growth software company to reevaluate its original technology stack. Java was a great fit for many of Wix’s requirements, and the JVM was a fantastic platform for scale.
But the company’s engineering team saw a number of major advantages that Scala and the Typesafe Reactive Platform could bring as they planned for its next phase of growth, from 5 million to 50 million users.
- Functional Code is Better for Testing - One of the main selling points of Scala for the Wix developer team was that functional code was better for the company’s tens of thousands of unit tests. “You can’t do functional programming in Java the way you can in Scala,” said Shai Yallin, a team leader in back-end engineering at Wix. “With Java we couldn’t properly write code the way we wanted to write code for testing. The ability to factor and express those unit tests in Scala is light years ahead of the testing facilities of Java.”
- The Future is Reactive - Engineers at Wix felt that Scala was a better language for future-proofing against massive scale challenges, and subscribed to the Reactive Manifesto’s school of thought that emphasize the importance that applications be written to be responsive, scalable, resilient and event-driven. “Java has an amazing solution and fantastic library for large scale, called Netty, but the way you build on top of it and how you have to construct and build your code is very limited in Java,” said Tomer Gabel, System Architect at Wix. “It was very hard to trudge through the mud and build the workarounds that we needed, that we ended up getting by using Scala. Better event server code and DSL design are not necessarily what are going to make or break your business - but they are going to make your engineers happier.”
- More Modern Development Patterns - For Wix, Scala has made the code base smaller and easier to main “Scala allows us to write better, more beautiful code, and it just makes us better engineers,” said Yallin strikes the balance between conciseness, expressiveness and practicality, and you can do amazingly co things with few lines of code. Pragmatically, it’s highly maintainable and easy to understand, so tr challenges, scaling challenges and data modeling challenges are much easier to approach.”
- Works With Existing JVM and Existing Java Code - “Basically we really like the JVM,” said Gabel. “We are very good as a company at DevOps for the JVM. Scala has a very similar operational model to Java for the JVM — the same tools, the same libraries - and allowed the operational know-how of Wix to transfer.”
- Powerful Recruiting Differentiator - “The fact that we’re using Scala is a huge sales point for recruiting,” said Gabel. “It’s just a very cool language that fits the main preferences for top software engineering talent. We really rely on the ability to bring in high profile, high-end developers, and being able to write high quality code faster is a very big deal for them. The combination of us having interesting scale challenges, a fast-evolving product, and using a modern language that allows a much higher velocity than you can get with Java - those are all major selling points for joining the Wix engineering team.”
“Java has an amazing solution and fantastic library for large scale, but the way you build on top of it and how you have to construct and build your code is very limited in Java. It was very hard to trudge through the mud and build the workarounds that we needed, that we ended up getting by using Scala. Better event server code and DSL design are not necessarily what are going to make or break your business - but they are going to make your engineers happier.”Tomer GabelSystem Architect, Wix
Scala - Not Just the Language, but the Community
Out of Wix’s ~60 back-end engineers, 45 code in Scala exclusively. The company runs a Scala boot camp for new employees that combines training materials and Coursera courses with more advanced Scala instruction. Today the company has a mandate that all new products be written in Scala.
But the commitment to Scala isn’t just within the four walls of Wix HQ - the company plays an active role contributing to the Scala community.
- Open Source Commits - Wix maintains several open source projects in Scala on its GitHub. Of particular interest are Accord (a “sane” validation library for Scala) and FuturePerfect (a helper for Futures covering nonfunctional concerns such as retries, time-outs and reporting)
- Education - In addition to instructing its own employees into the Scala language, Wix also runs an onboarding program for junior developers and CS graduates called Kickstart, where they run applicants through a 9-week course on software development “in the wild.” This starts with a 3-day Scala introduction, with backend coding tasks are written exclusively in Scala
- Evangelism - Wix also sponsors Underscore, the Israeli Scala User Group curated by Gabel and Yallin, and is one of the sponsors for Scalapeño, the annual Scala conference. The inaugural event last year drew 250 participants. While Wix organizes the event, the program’s emphasis is to be autonomous with the focus on content that serves the broader developer community to benefit more from Scala
“Scala allows us to write better, more beautiful code, and it just makes us better engineers. It strikes the balance between conciseness, expressiveness and practicality, and you can do amazingly complex things with few lines of code. Pragmatically, it’s highly maintainable and easy to understand, so traffic challenges, scaling challenges and data modeling challenges are much easier to approach.”Shai YallinTeam Lead, Back-End Engineering at Wix
Inspired by this story? Contact us to learn more about what Lightbend can do for your organization.
Share This Case Study
Lightbend is the proud provider of the world's leading Reactive application development platform. We are a passionate crew of technology pioneers committed to building amazing software. We build and maintain the Play web framework, the Akka message driven runtime, and the Scala programming language. Our mission is to help developers build high-performance applications that are responsive resilient, elastic and message driven.