September 19, 2024

Formatted Translations

We take the itemizing of every reserving request and fetch the town and nation from the itemizing service and verify to see if that vacation spot was in our curated set of formatted locations loaded into our i18n service. We then take one of the best becoming art work 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 Move

Placing a localized vacation spot and a Belo icon onto art work is a time-consuming operation given the excessive decision art work we used. We knew the picture processing stream might take over 8 seconds on common to course of a picture so we wanted to give you a method to make our postcard API reply shortly. We additionally needed to switch these generated postcards into our major picture storage so we might leverage our present media serving infrastructure, which launched an extra 1–2 seconds of latency.

As a way to nonetheless be performant, we went with a partly asynchronous strategy the place, through 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 a substitute return a fallback postcard and publish an occasion to a Kafka queue the place an async client would name the processing service, await 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 one of the best matching art work for the journey. Primarily based on a sample in how the postcards are saved, we’d verify 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 stream if it was not discovered. At that time, our media service’s Kafka client would full the stream by remodeling the asset right into a postcard and storing it in our system.

Structure Diagram of the Backend Postcard Era stream

Pre-generation

We needed to generate as most of the postcards as doable 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 staff helped decide high locations, and we ran these inputs by our postcard technology pipeline to pre-generate as many postcards as doable and reduce the possibility of falling again to a default postcard. Inside per week of launching, greater than 90% of journeys had a customized postcard as a substitute 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 price. 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 characteristic. Our frontline insights staff continues to obtain constructive 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 suitable 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 staff constructed to help a brand new Airbnb characteristic. It highlights the ability of media capabilities and revolutionary options we will construct with them. In the event you like the kind of work we do at Airbnb, please contact us & try our careers page!

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