Constructing Postcards for “Airbnb” Scale | by Leo Wong | The Airbnb Tech Weblog | Aug, 2024

Formatted Translations

We take the itemizing of every reserving request and fetch town and nation from the itemizing service and test to see if that vacation spot was in our curated set of formatted locations loaded into our i18n service. We then take the very best becoming paintings and embed the localized vacation spot textual content on it to generate the ultimate postcard. If we don’t get a translation again, we fall again to serving the postcard with out textual content.

Efficiency — Async Postcard Creation Movement

Placing a localized vacation spot and a Belo icon onto paintings is a time-consuming operation given the excessive decision paintings we used. We knew the picture processing circulation may take over 8 seconds on common to course of a picture so we would have liked to provide you with a approach to make our postcard API reply shortly. We additionally needed to switch these generated postcards into our major picture storage so we may leverage our present media serving infrastructure, which launched a further 1–2 seconds of latency.

With a view to nonetheless be performant, we went with a partly asynchronous strategy the place, throughout the stay in product request, we solely serve postcards that we’ve already generated and saved internally. If there was a request for a brand new postcard, we’d as an alternative return a fallback postcard and publish an occasion to a Kafka queue the place an async shopper would name the processing service, look ahead to the asset to be generated after which switch it into our system for use for future requests.

As proven within the diagram beneath, we fetched the itemizing data and taxonomy data in parallel earlier than computing the very best matching paintings for the journey. Based mostly on a sample in how the postcards are saved, we’d test in our media service to see if the postcard was generated already earlier than both returning the cardboard if it was discovered or kicking off the asynchronous circulation if it was not discovered. At that time, our media service’s Kafka shopper would full the circulation by reworking the asset right into a postcard and storing it in our system.

Structure Diagram of the Backend Postcard Technology circulation

Pre-generation

We needed to generate as most of the postcards as potential earlier than the launch. If the postcard hasn’t been generated when a visitor books a gaggle journey, everybody on the reserving will see the default, generic postcard. Our information science group helped decide high locations, and we ran these inputs by means of our postcard era pipeline to pre-generate as many postcards as potential and decrease the prospect of falling again to a default postcard. Inside every week of launching, greater than 90% of journeys had a customized postcard as an alternative of a default and we inched nearer to producing a postcard for all journeys within the months after.

Dashboard numbers on Postcard template choice kind and postcard utilization hit fee. For illustrative functions solely, not actual information.

Creating postcards was a large effort that required collaboration throughout a number of engineering, product, design, and information science groups to enhance Airbnb’s group journey function. Our frontline insights group continues to obtain optimistic social media and exterior suggestions on this replace that provides delight to becoming a member of a gaggle journey.

The answer highlights the significance of getting the correct inside tooling, picture and textual content processing capabilities, and vacation spot matching logic for fixing one thing at Airbnb’s scale.

Postcards is likely one of the first main picture processing use instances that the Media group constructed to help a brand new Airbnb function. It highlights the ability of media capabilities and progressive options we will construct with them. In case you like the kind of work we do at Airbnb, please contact us & take a look at our careers page!

Due to the next engineers who helped to construct this function: Alan Wright, Aditya Punjani, Invoice Lovotti, Jessica Chen, Miguel Jimenez