Gilt Lead Software Engineer Yoni Goldberg traveled all the way to Boulder, Colo. this weekend to present at LambdaConf, a full-day conference featuring functional programming-related talks and workshops. Yoni’s talk focuses on the evolution of Gilt’s architecture from a monolithic Rails app to a distributed Scala micro-services system. Check out an earlier version of his presentation (from NYC Tech Talks earlier this year) below!

Check out Ryan Caloras, one of the Gilt Personalization Team’s dedicated software engineers (and a former Boston resident), manning our swag station at last week’s Boston Area Scala Enthusiasts meetup! Ryan’s team mate, Lead Software Engineer (and fellow ex-Bostonian) Yoni Goldberg, was the night’s featured speaker, and educated the crowd of 80-100 attendees about Gilt’s shift from a monolithic Rails app to a distributed micro-services architecture written in Scala. By the end of the night, almost all of our swag was gone.

Thanks to BASE and everyone who came out for a memorable night!

image

svc-inventory-request helps us handle our modelling photography

Hi, everyone! This is the start of a (hopefully) regular series in which we take a closer look at Gilt micro-services: the hundreds of services that together make up our distributed, Scala-built micro-services architecture. For each installment, I’ll pull a random repo from Gerrit and interview a Gilt technologist about the relevant micro-service. Together we’ll learn more about what micro-services are and what they do, and uncover some of the funny and interesting histories behind some of the code we’ve written over the years.

First up for review is svc-inventory-request: an inventory-related microservice created by Gilt Software Engineer, Back Office team member and fancy-cheese aficionado Robert Brazier. Let’s get right to it!

What is svc-inventory-request, and what does it do?
svc-inventory-request handles lists of fashion modeling shots and other miscellaneous pull requests for inventory. In part, it acts as a proxy to a second, distribution-oriented micro-service related to internal inventory transfers. “It seems to do so little, but there’s so much code for it,” Rob told us (with a sigh).

When was it born?
The primary work began in May 2012 and lasted through that summer. It was the first Scala project that Rob worked on!

Any funny or interesting facts, cool power programmer moves or stupid code tricks?
svc-inventory-request was one of the first times Rob crossed paths with Scala’s 22-parameter limit on case classes. While writing it, he discovered a Scala language bug! He submitted it to Typesafe and recently learned that it was fixed in 2.10.3.

Back in 2012, the Gilt Back Office team was still in Rails mode, and everyone knew about (and loved?) ActiveRecord. Rob asked around to see if a similar tool existed for Scala, but everyone warned him away from the ORM options available to him at the time. Rob wrote his own mini-ORM into svc-inventory-request! Similarly, there was still a lot of contention around how to handle JSON serialization/deserialization. Rob wrote that as well.  ”So much terrible,” Rob recalls. If he were to do it all over again, he’d use Slick: “It looks really nice for the database stuff.”

What’s svc-inventory-request up to these days?
Rob says it’s mostly in maintenance mode. The Back Office team is working on several new micro-services that will subsume a lot of svc-inventory-request’s workflow. Our PR team and other non-tech departments still use the micro-service fairly regularly, though.

Any last words?
Rob: “Don’t write your own ORM.”

Stats:

  • First committer: Rob Brazier
  • Top committers: Rob Brazier, Kevin Hyland, Anthony Manfredi
  • Number of commits (as of March 2014): 196

That’s it for now! See you next time, when we take a look at lib-googledrive.

On Tuesday night Gilt hosted the New York Mobile App Developer meetup’s March event: a technical talk delivered by our very own Principal Software Engineer, Adam Kaplan! More than 100 engineers from Twitter, Getty Images, Bloomberg, the New York Timesand other companies joined us for Adam’s talk, which highlighted the ways we’ve been using Akka to scale our massive push notification system. How massive? Three-million-messages-in-less-than-60-seconds massive!

In his presentation, Adam described his team’s work building a distributed architecture built with Scala, Akka, ZooKeeper, and other technologies. He explained how Akka’s clustering capabilities not only make mass messaging possible, but also promote overall system integrity, scalability, and better performance (and, on the business side of things, higher revenues!). He also placed push notifications in the context of Gilt’s general engineering culture, which emphasizes a micro-services architecture, fault tolerance, and (the good kind of) redundancy. 

Some highlights from the meetup:

image

Gilt Recruiting Coordinator Tineshsia Matthew helps one of our guests at the check-in station.

image

Gilt Software Engineers Asha Seetheram and Dave Singh have some drinks …

image

while Gilt Engineer Andres Pereira and some of our guests dig in to the Num Pang sandwiches!

image

After a quick intro to Gilt by VP Mobile & Global Engineering Yonatan Feldman, Adam and his laptop took to the podium. Adam started things off by asking the audience a few questions. (That’s Typesafe Tech Lead Console, ex-Akka team member and recent NYC transplant Henrik Engström on the left!)

image

The audience listens …

image

Many guests stayed long after Adam’s talk and Q&A to ask questions, grab another drink and mingle with Gilt technologists and other attendees.

Thanks to NYMAD and all of our guests for a great night! Our next tech event will be a panel on Docker on April 29; more details to come!

All photos by Craig Wililston/QoolFoto

image

How did you get to Gilt?
In late 2011, I was working as a contractor at another eCommerce company, and Gilt was at the end-stage of opening its Dublin office. A Gilt recruiter contacted me, and a few months later—in May 2012—I started here.

What were you hired on to do?
At first I was hired on to be a performance engineer, then I almost immediately switched to infrastructure engineering.

Did you have a background in infrastructure engineering?
Not specifically. For much of my career I’ve worked at startups as a full-stack engineer. I’ve also founded a couple of startups, and worked in senior roles. In a startup, you end up learning a lot about how to write software and sell it, but you often don’t learn how to scale it in an organization. This is the first time in my career other than my last job where I’ve seen companies out of their startup phase.

When you got to Gilt, what did you do first?
Soon after I started we came up with a project, Galactica, and I began working on implementing parts of the idea. Gilt being Gilt, I kind of found work that I wanted to do, that wasn’t what I was originally hired to do.

The scale of Gilt is nice: it’s small enough that you can get your head around its infrastructure, but large enough to be impressive.

Tell us more about what Galactica is and does.
Galactica is a family of services that allocates containers via Docker, allows for provisioning of other services, and implements a meta-data model. It echoes the immutability of Scala, the language we use at Gilt. Immutability is important to us—it enables engineers to do things concurrently and safely, and enables you to avoid situations in which two things try to change your data at the same time.

When complete, Galactica will give us the confidence to deploy quickly and often, and if we do break something, we can recover quickly by switching back to the previous version. The previous will still be running, it just won’t be taking any traffic. For now we’re working on or staging, integration and pre-production environments, but will eventually tackle our full production environment in the same way.

What do you think of Docker?
Docker is lighter weight than any other comparable technology out there, it’s open source, and it’s much easier to experiment with. It’s not a system for providing computing resources as a service, per se—it really just does one thing, which is to start processes inside containers. Docker lets us to build our own services around it.

How long have you been working in Scala?
I started using it not long before I started working at Gilt. During the hiring process, I was asked to write an implementation of an interview question that I’d described during my initial interview—I wrote it in Scala. It wasn’t great Scala, but it was definitely a good thing to have done (it got me the job!).

How has Scala made you a happier engineer?
Well, before I made the switch I was working in Java and programming functionally in Guava. This was extremely frustrating: I was typing ten times as many characters as I felt was really necessary. Scala was a huge relief: it’s got a steep learning curve, but once you achieve a point of proficiency it’s great. For a learning tool I recommend Typesafe’s courses on Coursera—some of us took the courses, and it actually changed elements of our style because we saw (Scala creator Martin) Odersky doing certain things, and it gave us permission to do them as well (the content is also extremely good).

Can you name one of the ways Typesafe’s courses altered your style?
One little thing was using if and else more often. There’s a tendency in Scala to overuse some of its monadic features. Quite often, if you take a slight step backwards and take advantage of its functional programming features, you can produce code that is safe and functional, but also looks better.

You’ve actually taught some Scala—talk about that.
Last fall I helped teach a Scala session to some engineers in the Dublin community. I’ve also helped others on the team. I’ve always liked mentoring because it’s rewarding—it helps you to learn. When you’re teaching someone you find gaps in your own knowledge. Students ask the best questions! We’ve talked about creating an advanced-level Scala course—I’m going to help with the curriculum.

Did you study programming in school?
Yes, I have a CS degree. I started programming when I was eight!

Are you experimenting with any other languages at the moment?
One of the earliest things I did at Gilt was to write a Lisp interpreter. Lisp is something I come back to, because it’s extremely easy to write a Lisp interpreter; also, a fundamental understanding of it enables you to explore other languages quite well. Aside from that, I have checked out Go but haven’t gone deep into it. Clojure is definitely on the list of things I’d like to experiment with.

How active are you in the open source community?
I’m a contributor to Gatling, a tool for load testing. It generates requests to send to a web service or application at a very high volume. It also measures how long those requests take, and how your application performs under different levels of load. Last year I gave a talk at the Scala.io conference in Paris with one of Gatling’s founders—we discussed load testing and using Gatling at Gilt.

How are we using Gatling, exactly?
At Gilt, we’ve found that writing tests in code is much more effective in encouraging people to write tests, period. We don’t have a team of performance engineers writing tests, but a team that writes tooling. We want developers to write tests, and have it become second nature. It’s harder when testing means using a GUI—you have to learn something new to write the test. The way Gatling works was very appealing to us, and the reports looked fantastic. We took it on, built some tooling so we can run tests against EC2, and now test the site three times a day. We receive alarms if there’s a failure, so we’re now working on a tool called the Smoking Gun Detector—it will run after every load test, analyze behavior as the log tests saw it, analyze the behavior of the requests the log test made, and identify or suggest backend services that are indirectly accessed as a result of the load test. The intention is that it will automatically identify anomalies. If a load test fails or performs slowly, the Smoking Gun Detector will hopefully point out where the source of the problem is. Eventually we’d hope to have it running all the time, comparing the performance of our services and identifying irregularities.

How would you describe Gilt’s attitude toward open source?
Gilt is a great company for open source. Many companies restrict their engineers’ ability to contribute to projects or launch their own—even on their own time. Here, as long as you’re responsible for what you do, and you don’t do anything stupid, it’s acceptable.

It’s the same with other things about our culture—for example, contributing to the tech blog. It’s kind of rare that you have companies of our size that encourage everyone in tech to blog on the company’s site—usually, there are four or five people who blog, and they present a micromanaged view of how the company works.

Final question: What are your goals?
I have three types of goals. One is project-based: I’d like to complete Galactica. Another relates to evangelism, both internal and external: teaching Scala, writing blog posts, etc. The final goal is DevOps-oriented—to continue to drive reliability. Because of the time difference, the Dublin team is up and awake long before the people in NYC arrive at work. Usually if something problematic happens overnight, the Dublin team is working on it. I would like to help us achieve a pure devops culture, where everyone is in ops and has full privileges. I’m trying to encourage that mindset across the organization—i.e., if you have an interest in how systems work, make sure you get privileges and join in on keeping them working. The way we build now, it’s hard to severely damage something—but if you do, just ask for forgiveness.

image

Gilt Lead Software Engineer (and MIT grad) Yoni Goldberg will head to his old hometown of Boston to present a talk at the April 3 Boston Area Scala Enthusiasts meetup. Yoni will discuss our distributed Scala micro-services architecture, and describe some of the technological innovations that have helped Gilt to reach its current size. He’ll also highlight some of the core challenges that the company’s engineering team continues to face, and address what every tech team needs to consider  before heading down the path of building a first-class micro-services architecture. Pizza and beer provided. RSVP here!

image

On Friday 2/28, nearly 60 engineers and other technologists from Squarespace, Artsy, Knewton, Goldman Sachs, Thomson Reuters and other companies joined us for a free, full-day intro-level Scala course. The above photo features Gilt Principal Software Engineer Gregor Heine giving the class the lowdown on high-level syntax, while Lead Software Engineer/teaching tag-teamer John Kenny (at left) waits his turn at the podium.

In addition to all our esteemed guests, a few members of the Gilt tech team were also in the audience. Gilt VP of Mobile/Global Engineering Yonatan Feldman (middle) took in a few modules…

image

… and here are Gilt QA engineers Nithya Venkateswaran and Tierra Mack:

image

We’re excited to tell you what our next free course will be—keep checking this space for an announcement!

image

Action Shot: A group of Gilt software engineers gathered ‘roun the television this afternoon to watch Typesafe's “Introducing Slick 2.0.0" webinar. We’re considering using Slick in one of our new projects and found the webinar really helpful—especially the use cases that Slick tech lead/instructor Stefan Zeiger provided.

"Stefan provides an example of a fairly complicated for-comprehension using Slick, and his slides make what is happening under the sugar easy to understand," says Myyk Seok, an engineer on our back office team. "The talk left me confident that I would be able to leave Squeryl/Anorm and write my next service with Slick instead."

Did you watch too?

image

Last summer some of the engineers on Gilt’s Dublin team created and delivered their own full-day, beginners-level Scala course—not just once but twice. The course reviews from our Scala students—all experienced Java programmers—were quite stellar:

  • Brilliant course and instructors, very glad to have had the opportunity.”
  • Really fantastic venue and team, one of the most enjoyable experiences. Highly recommended.”
  • The genuine enthusiasm our lecturers had for Scala, programming, teaching and Gilt made things far more interesting, enjoyable and (at times) funny than they might have been without such good people in charge. Their bright attitudes were infectious.”

We’re excited to announce that our Dublin team is ready to bring their brilliant/fantastic/enjoyable Scala class to our NYC office! On Friday, 2/28, two of our esteemed Scalasmiths—Principal Software Engineer Gregor Heine, and Lead Software Engineer John Kenny—will spend a full day teaching all about Scala fundamentals such as:

  • Classes, traits and objects
  • Tuples and case classes
  • Monads
  • More!

The training day will last from 10 AM to 5 PM with a working lunch. Developers of all programming languages—but especially Java—are invited to participate. Just fill out the form below to submit your contact info, and we’ll let you know if you’ve been selected. (Note: You must be age 18 or older to attend.)

Submitting this form does not guarantee you a seat. (Class size is limited to 60 students.) However, it does mean that you’ll receive details about the other courses we’re developing—including advanced Scala and Play—as soon as they become available.

Gilt Co-Founder and CTO Michael Bryzek recently chatted with the folks from Chariot Solutions for their “Business of Technology” podcast series. Go here to here Michael talk about our early days as a company, our decision to adopt Scala, our transformation from a monolithic Ruby app to distributed Scala micro-services, and many other topics.

Based in Philadelphia, Chariot is an IT consulting firm that also offers Scala training and holds events like the Emerging Technology for the Enterprise Conference (April 23-24), where Michael will be speaking.