EXPEDIA GROUP TECHNOLOGY — SOFTWARE

Peak productivity parsing protos in-process

If you’re creating a gRPC server in Node.js, loading and parsing protobuf schemas at runtime results in server code that is idiomatically JavaScript. Part 1 of this series surveyed the available tools for creating such a server, concluding that there were only two production-ready paths to a working product. Part 2 of this series explored the first of those: building a server using build-time code generation with protoc. The story exposed some limitations and tradeoffs inherent to that approach, the most salient of which was the need to manually create marshalling code for each request and response.

In this final…


EXPEDIA GROUP TECHNOLOGY — SOFTWARE

Boldly building a statically-generated JavaScript server

You can create a gRPC server in Node.js with static code generation, but with tradeoffs that you should understand. In the previous story in this series, I explained the ecosystem of gRPC tooling for Node.js. Now I’ll show you how to build a statically-generated server using those tools.

A carnival ride resembling a complicated orrery at Disneyland in Paris
A carnival ride resembling a complicated orrery at Disneyland in Paris
Photo courtesy of Antonio Esteo on Pexels

A sample application

We’ll use the tools to build a simple sample application. This application provides a service that models a library filled with books. Its methods allow retrieving all of the books and checking out a book. All the code I’ll share can be found here.

The schema follows a structure recommended by Uber…


EXPEDIA GROUP TECHNOLOGY — SOFTWARE

How to build a JavaScript server you can live with

Grayscale photograph of a woman wearing sunglasses with three lenses, evoking the story title’s claim to weirdness.
Grayscale photograph of a woman wearing sunglasses with three lenses, evoking the story title’s claim to weirdness.
Photo courtesy of Morgan Harris on Unsplash

One would expect a slick, straightforward integration between Node.js and gRPC — they’re both Google’s progeny, after all. That’s sadly not the case. It’s complicated. At Vrbo™ (part of Expedia Group™), I’ve learned about this ecosystem and can help you understand the tooling landscape, learn how to use the tools, and see what kind of code you can expect from each. And steer clear of some pitfalls.

Russell Brown

Software Architect

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