An Interview with OpenTable: Make Your Reservations with Node

OpenTable seats more than 23 million diners per month via online reservations across more than 43,000 restaurants worldwide. Since it was founded in 1998 it has seated more than 1.4 billion diners. Are you one of them?

On June 19th, 2013 the team made its first commit to Node.js and it hasn’t stopped. In order to make the user experience seamless, collect millions of data across restaurant websites and more, the team of engineers heavily relies on Node for front-end, API and full stack development.

Node.js has really changed the development workflow allowing frontend developers to also do backend development work. They now own the entire deployment process, they can integrate, continuously deploy, and own every step of the way. Node.js has also made containerization simple for the team.

We recently interviewed Thomas Hunter, Principal Software Engineer of OpenTable, about how the company is using Node, how Thomas and the company contribute back to the community, future plans and more. You can watch the interview here or read below.

Bon Appetit!

Image for post
Image for post

Tracy Hinds: Hi everyone, and welcome to Node Foundation’s Enterprise Conversation. I’m Tracy Hinds, Education and Community Manager at the Node Foundation, and here today, I’ve got Thomas Hunter. How’s it going, Thomas?

Thomas Hunter: Pretty good. How are you?

Tracy Hinds: I’m good. So, really excited to have you here today. Thank you for stopping by. I think people are going to be really excited to hear about all the work that y’all have been doing, so I think we’ll just hop right into that. Tell us a little more about your role at OpenTable.

Thomas Hunter: Yeah. I’m a Principal Software Engineer. When I first started out with the company, I was working on the search team. We have this search project that’s written entirely Node. It’s an API. It has a website, and it consumes data from a bunch of upstream services and attaches the data and responds.

We also did some new work recently where we introduced ElasticSearch, so now we’re able to sort of freely search for any sort of phrase you would want to type into the website. Previously, the search project was a bit simpler. It was almost like a directory of restaurants, so you could search for like food-based on cuisine, but not more granular details.

However, about a month ago, I moved to a new team. This was a new platform team for front end projects. So all the front end projects in OpenTable are written in Node. So we’re now working on coming up with standardization, creating standard libraries, just kind of getting everything tightened.

Tracy Hinds: I’ve seen quite a few companies that have been moving over to that, especially in terms of the platform for the front end. It just seems to be a really good fit. And I know I use OpenTable quite a bit. Hopefully, people have noticed the changes. But that’s exciting. So, how long have you been in Node?

Thomas Hunter: Me personally, I’ve been using it since early 2012, which I think was back in the version 0.6 days.

Yeah, a veteran. So I started, I actually switched from the land of PHP, MySQL, and over to Node and NoSQL engines and stuff like that. The first project I built was just this multiplayer online game called Cobalt Calibur. Previous versions of this game were written in PHP, and the browsers would need to keep requesting information to see updates. And it was just this slow process, and I would thrash the disk in my laptop and eventually crash the machine. But switching over to Node made it much easier to build, sort of these real-time applications where you’re maybe pushing data around.

So for example, this project, users will pull up this website and you’ll walk around in real time, they can see other people moving around in real time. They’re establishing WebSocket connections, and all the data that’s shared is kept in memory, and just a much better experience for building these more lively applications.

Tracy Hinds: So, that’s how long you’ve been working in it. And that’s interesting, because I also like to see sort of how people are involved as part of Node if they are, so I am lucky enough to have worked with you a little bit. But what’s your community involvement like with Node?

Thomas Hunter: Well, certainly we’re working on the Node exam project together. I like to give a lot of talks to communities, so I’ve given talks at SFNode, SF Reddit, SF Microservices. I’m personally trying to leave that stuff a little bit, so I’m going to speak at Node down in Argentina.

Tracy Hinds: These talks are really helpful to end up knowing sort of the individuals who are working at these places and sort of their role in context and in the world of Node. Along those lines, for how long and how has OpenTable been taking advantage of Node?

Thomas Hunter: I’ve actually been at the company for two years, and so I had to ask around a little bit to get this information. But my teammate Johno, he was able to send me a link to a commit, and we think this might be the first commit for Node within the company. So this commit was made on June 19th, 2013, and it was made to the Restaurant API. So that’s an API that we still use today, it’s still up and running. Before that, I think everything we did was written in C# and Java. We still do have C# and Java applications for the deepest recesses of the company, but anything that touches the client, anything worth shouting is probably written in Node.

Tracy Hinds: So as someone who works in the education side of Node, are employees brought in hired on to work in Node? Or do they end up taking existing employees within the company who may be writing other languages and teach them Node?

Thomas Hunter: We do a little bit of both. I was hired to work directly on Node from the beginning, but we do have some engineers that do switch over to Node. If I can think of one right now, he’s been on the C# side of things for a while, but then he started writing Node as of the last few months. And it’s very rare that people move from Node to the other languages, so the Node presence on OpenTable is certainly growing.

Tracy Hinds: Speaking of, onto our next question. What impact has Node had on OpenTable in your team?

Thomas Hunter: Good question. I think one of the best benefits of using Node is that it’s much easier to create prototypes, or even to start any application from scratch. More concrete of an example of this would be, if you want to consume data from another service, and that service is returning your JSON data. If you’re using a more tightly typed language like Java or C#, all this data that you’re retrieving, you’re going to need to coerce into some sort of internal model representation.

If you’re doing work like that, it just requires a bit more overhead and developer time to write the code to cohort to serializing these objects in the memory. So if you’re using Node, for example, you’d simply grab that data, JSON parse it, and you’ve now got an in-memory representation of this object. It’s just very easy to do that, and you can quickly get these applications running.

A little bit of a side effect to that, though, is that if you have properties that don’t exist, you’re going to have potentially runtime errors. So there is a little trade-off in that regard. Somebody else explained to me that once we started using Node, our pool of backend developers increased almost overnight. For the longest time, we were mostly C# and Java backend services, so maybe we only had like 20 engineers or whatever. But if we have like 50 engineers who know JavaScript, then these engineers are all able to contribute to the backend.

Tracy Hinds: Wow.

Thomas Hunter: Yeah. So just very quickly, we’re able to get more backend work done. Which is great, because then frontend engineers are no longer held up. You know, perhaps they’re waiting on a backend team to expose a new endpoint or host this application they want to build, but now the frontend developers are able to work on that stuff where, you know, able to more quickly innovate and get services running. Each teams can then own their own stack. Like they can own the deployment process, they can integrate, continuous integration, continuous deployment, they can own every step of the way. It’s really empowering for the individual developer to use that approach.

Tracy Hinds: Yeah, I’ve actually seen that firsthand at some of the companies I’ve worked at, how when you get the opportunity to get to have access, you don’t necessarily, you know, you get to own the stack yourself. Or if you have access to that, how quickly you can get things done. It can be a little overwhelming, but it’s pretty awesome to be able to not have to go to another team to ask permission.

Thomas Hunter: Absolutely. There’s also the risk of getting, pager duty calls are now more applicable to the frontend engineer.

Tracy Hinds: Yeah, yeah, that was one thing. It’s like oh, well we never had a page in two years. And then when you start owning that stuff.

Thomas Hunter: Oh yeah, definitely. But the cool thing that this introduced in the company is containerization, so all our applications now run inside Docker. That’s not to say that we couldn’t have put our C# and Java apps in Docker to begin with, but using Node it just made it so easy, and now it’s permeated throughout the company. All our new applications are deployed to Mesos and the scalability is much, much easier than before.

So previously, we’d have to provision more virtual machines or, you know, a lot of this stuff. A lot of the code in OpenTable actually runs in our own data center. So I think Valentine’s Day is our biggest holiday, so previously it’d be perhaps a bit of work to scale up the night before. But now we’re able to just click a button and be prepared.

Tracy Hinds: Ah, that’s awesome. Have you documented that or open-sourced anything around the containerization?

Thomas Hunter: Yeah.

Tracy Hinds: I mean, I know containerization is definitely something that is a more modern mystery.

Thomas Hunter: Yeah, we do have a developer blog, in which we have some of this information on it. We did open-source a tool called Sous. This one’s actually written in golang, it’s a little bit of a departure for us. But this tool is used for configuring Mesos and Singularity, which is our Mesos scheduler. And so we do that to make our deployments quicker and easier, and there’s a lot of documentation around that.

We’ve open-sourced some other stuff as well. OpenComponents is the most popular thing we’ve open-sourced. That is used for trading frontend components and sharing them amongst other teams, and then you’re able to load these components from your project using Semver. And then, that way, without actually performing a new release of your application, the team that owns the components are then able to release changes, and then other teams can use them. Which is really useful in a corporate environment, where if you want to change that reservation button, you want it to affect multiple teams. Using these OpenComponents makes it a lot easier.

Tracy Hinds: Awesome, wow. Yeah, I bet. So with that, I think our final question for you is, what are some of the things that you’re really excited to do in the coming months with Node?

Thomas Hunter: Well recently, we created the team I’m on, we created a whole bunch of P.R.s to get all our teams up to Node LTS, Node 6. And so it was kind of fun getting that out, checking out peoples’ projects, running the tests, getting the installs to run, figuring out what’s broke. Getting everything up to date. So now I’m planning on doing that again once Node 8 becomes LTS, hopefully in a month or two from now.

The new Async Await functionality that we get, that takes these promises that we have and sort of makes them a first class citizen of the new syntax. I’m really looking forward to that and introducing that in the company. The code that you write is much more elegant, and the asynchronous control flow instead of downloading these complex libraries, it’s now a first class citizen with this new syntax. I believe it’s going to make the code a bit less buggy, easier to follow, it’ll be easier for engineers to contribute to other teams.

Tracy Hinds: Yeah, definitely. Yeah, Node 8 was such a fun release for us, and I’m excited for it to get to LTS, so I’m excited to see that as well. Well great, well thank you for so much, Thomas.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store