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 the town and nation from the itemizing service and examine to see if that vacation spot was in our curated set of formatted locations loaded into our i18n service. We then take the perfect 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 Circulation
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 stream may take over 8 seconds on common to course of a picture so we would have liked to give you a option to make our postcard API reply rapidly. We additionally needed to switch these generated postcards into our main picture storage so we may leverage our present media serving infrastructure, which launched an extra 1–2 seconds of latency.
With a view to nonetheless be performant, we went with a partly asynchronous method the place, through the reside 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 might 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, look forward to the asset to be generated after which switch it into our system for use for future requests.
As proven within the diagram under, we fetched the itemizing info and taxonomy info in parallel earlier than computing the perfect matching paintings for the journey. Based mostly on a sample in how the postcards are saved, we might examine 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.
Pre-generation
We needed to generate as lots 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 group helped decide high locations, and we ran these inputs by way of 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.
Creating postcards was an enormous 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 precise inside tooling, picture and textual content processing capabilities, and vacation spot matching logic for fixing one thing at Airbnb’s scale.
Postcards is among the first main picture processing use circumstances that the Media group constructed to help a brand new Airbnb function. It highlights the facility of media capabilities and modern 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!
Because of the next engineers who helped to construct this function: Alan Wright, Aditya Punjani, Invoice Lovotti, Jessica Chen, Miguel Jimenez