image

Gilt is excited to participate in the New York Times’ Open Source Science Fair 2.0, taking place Thu 7/25 (starting time 6:15 PM) at the Times' office building in Manhattan. In addition to highlighting our open source work, our exhibit (one of those old-school, cardboard trifold thingies) will promote the Play Framework and discuss our use of Play at Gilt. Stop by our booth to say hello and to pick up some fashionable Scala, Play and Akka stickers and buttons (thanks to Typesafe for their generosity!). We’ll also answer any questions you might have about the Play NYC and Scala Hacker Hours NYC meetups.

image

Making the social media rounds today is Typesafe’s in-depth Q&A with members of the Gilt Tech team. Learn about the backend technologies we use, our motivations for migrating to the Typesafe platform, the potential role of Scala, Akka and Play in the evolution of ecommerce, and much more. A highlight:

Typesafe: How is the future of ecommerce evolving, and what role does Play, Akka and Scala have in addressing these shifts?

Gilt: The ecommerce business is extremely competitive on price, speed, and features. From a development point of view, maintaining velocity is important for keeping features flowing with minimum friction. Being able to reliably build the tooling we need to simplify our internal workflows is also important for the back office. Flash sales typically have incredible non-functional requirements. Our sale spikes tend to involve a two-orders-of-magnitude increase in traffic over the course of a few seconds – so much so, that we often refer to “requests per decisecond” instead of “requests per second” to drive home how quickly traffic can ramp up. The Typesafe Platform has scaled really well for us across our internal verticals, making it simple for us to build, for example, internal-facing workflows using the same tooling we use to build the highest-performance web pages.

By being early adopters of Play, we were able to move quickly and easily to a WebSocket architecture (via actor integration) that has led to a nice increase in conversion. We’re still evaluating Akka, but as we gain more experience with it, we see it becoming an integral tool. Akka enables asynchronous front-ends and offers a faster, more responsive, progressive web experience than what we would have been able to achieve with similar effort on other platforms. The actor model helps to break down functional units in code and maintain focus on the workflow. It also reduces friction for concurrent programming by eliminating boilerplate code and the bugs that frequently come with it.

The Typesafe Platform enables us to move faster, build on what we have done, do less overall refactoring, and – we strongly believe – attract the best people.

Thanks to Typesafe for asking us such great questions!

Tonight (Wed 7/10) Gilt once again plays host to the Play NYC meetup. On this evening’s agenda: LinkedIn’s Jim Brikman presents “Async Coding in Play with both Java and Scala,” a discussion of the non-blocking IO (NIO) nature of the Play framework:

In this talk, I’ll discuss how Play offers an escape from thread pool hell, how it opens the door to real-time web applications (e.g WebSockets), and how to write asynchronous code in Java and Scala without getting stuck in callback hell.

Up & Running with Play 2

Last night, Gilt hosted the second Play NYC meetup, after nearly a year since the first. This meetup was dedicated to introducing people to the Play Framework.

I gave a presentation that briefly touched on the reasons why Gilt chose the Play Framework for some of its recent projects and then jumped right into code. Over the course of the talk, I walked through constructing a Play app with Scala connecting to Gilt’s API. Starting with some functional tests, we covered:

  • routing,
  • controllers,
  • Play Actions,
  • making a request to a web service,
  • Play’s configuration
  • Futures and asynchronous behavior,
  • unmarshaling JSON,
  • Play’s templating language,
  • compiling Assets,

And finally, and most importantly, deploying our application to production (with Heroku). Along the way we touched on some tenets of functional programming1 and Scala’s powerful for comprehensions. We covered a lot of ground and in the end only ended up with one route: listing active sales by store.

The slides for the talk are available on SpeakerDeck, the application built is currently running in production, and the application code is available on GitHub for anyone to fork and experiment on.

I had a blast. Our next meetup isn’t scheduled yet, but we definitely won’t allow such a long delay between meetups again. Join the group to be the first to hear about upcoming events. Thank you to everybody who came out. I am looking forward to the next one.

— Mark

Some of our users may have noticed a new and welcome addition to Gilt over the last few weeks—we’ve rolled out search across our Women’s, Men’s, Kids and Home stores! In Gilt Tech, we know how much our members love the thrill of the hunt when our sales go live every day; and, as a tech team, we’ve always felt good about building our site to drive a great flash-sale shopping experience. However, we also felt strongly about providing a way for letting our members find the gorgeous stuff they love faster. With this in mind, we’ve built out our keyword search using Scala, Play Framework and Apache Solr / Lucene, and have learnt a huge amount of stuff along the way.

First: a tour. If you’re one of the lucky few in our A/B test group, you’ll see the ‘magnifying glass’ search control on the top right of your screen, just below your cart / checkout:

Find the search control beneath the cart/checkout buttons

Click on the magnifying glass, and you’ll see our search box playfully swish out; you can select a store to search and then type away happily. We autosuggest on our favorite brands, colors and all of our live sale products. You can then filter by category, brand, size and color using the facet controls on the left to find exactly what you want.

Our new search results page with autocomplete

Implementing search for a flash-sales business, where inventory is limited and changes rapidly as our sales go live to a stampede of members every noon, poses a number of technical challenges: with small numbers of fast-moving inventory, we’re keen to make sure that the search results you see are genuinely the products that we have to sell at the moment you search. To make it work, we index our live products using Apache Solr, and sort and filter search results with real-time inventory status using a set of custom Solr extensions.

The search listing page is implemented in Scala using Play Framework. We’re loving Scala at Gilt, and while our growing corpus of Scala code plays very nicely with our existing Java infrastructure, it made sense to take a look at Play Framework as a new platform for Scala-based web-apps. Regular readers of the Gilt Tech blog will have seen how the Gilt Live team recently released an awesome social shopping experience using Play Framework and Web Sockets. For Search, we use Play’s templating language to render our initial listings from the client-side, and then use a combination of Backbone.js and Handlebars to handle the subsequent AJAX rendering within the browser on the client-side. The result is super fast! We found the Play stack fun and easy to use; so much so that we had time to implement some really neat features: for example, when you hover over the Next or Previous page links on a listing, we preemptively initiate a request so that the data is already there for you if you decide to click.

We feel really good about the solution, and we’re seeing our members respond really well to the feature! Happily, we have lots of great ideas and are going to continue to iterate on the experience.

Team Galactus group photo

We hope you like it as much as we do!

Adrian Trenaman, Mark Wunsch
Team Galactus, Gilt Tech