The Engineering Behind Coded Coupons, eBay’s New Seller Tool

Engineering


​​eBay’s coded coupons tool is one of the newest products available for sellers to drive buyers to come back and purchase more items from their store. The tool allows more flexibility and control in offering discounts to prospective buyers, both on and off our marketplace. 

With this new feature, sellers can create their own, custom discount codes that can be shared publicly on ebay.com or privately through their own marketing channels. Sellers can also print their coded coupons to include in shipped packages, helping to drive repeat purchases from their customers. Since the release of coded coupons in April, over one million buyers have made purchases on eBay using coded coupons. 

This tool was developed by creating a new user experience stack using eBay’s latest technology stack — Raptor and MarkoJS. Here’s what we learned through the development of the tool’s system architecture and integrations, and how we overcame technical challenges along the way.

About Marketing 

Through the Seller Hub Marketing tab, sellers can manage different types of shopping deals, including price markdowns, order discounts, volume pricing and shipping discounts. These deals are shown on buyer placements such as search results and the View Item, Cart and Checkout pages, and helps drive more purchases and large cart sizes. These capabilities allow sellers to give discounts for large purchases to buyers to support our thriving marketplace. 

Introducing Coded Coupons: More Customization and Options for Discount Offers 

Coded coupons give sellers the flexibility and control they seek over how they offer discounts to customers. Each coupon promotion has five distinct components: 

  1. A unique coupon code;
  2. A discount level; 
  3. The option to provide private or public exposure; 
  4. A way to define eligible inventory; and
  5. A mechanism to schedule the promotion duration. 

Sellers can choose the discount type they’d like to offer: a cash discount, a percentage discount or a bundled percentage discount on multiple items. They can also easily set variables, including how much in total they’d like to spend on their promotions campaign, who can see the coupon codes, how long the promotion will run and eligible items.  

The new flow allows sellers to seamlessly navigate the steps and create a coupon promotion with speed and accuracy. 

coded coupons 2

Engineering Architecture

The marketing tab serves both sellers and buyers on eBay’s marketplace, and faces a unique challenge of scale: Sellers deal with a “promotion” entity, while buyers view and interact with an “item” entity. To scale horizontally for both cases, the platform has a dual-write system using both Oracle and MongoDB as the source of data. 

Oracle’s Relational Database Management System (RDBMS) helps sellers create and manage promotions with varying degrees of inventory and scheduling selection. Meanwhile, the MongoDB cluster helps scale the billions of views, rendering the discount information in strategic placements across buyers’ search and transactional journey.

To provide the flexible infrastructure necessary for eBay’s dynamic new couponing, the coded coupons feature was built on a brand new user experience stack using the latest design standards and the most recent eBay skin release. The eBay skin leverages eBay’s design system to create a unique look for the eBay brand and standardize common elements, such as headings, paragraphs, fieldsets, images and links. The eBay components are created and utilized as reusable marko-js components to provide a consistent user experience.

Here’s a representative model of the underlying architecture:

coded coupons 3

Seller Architecture

The marketing tab provides multiple discount types which sellers can combine to create a dynamic marketing plan. 

The options range from simple listing-level selection, to a complex, rule-based system for inventory in certain categories, which meets additional price and condition criteria. The platform also provides sellers with the capability to schedule promotions to begin and end at a predetermined time, and to add additional items to a campaign if they subsequently meet criteria.

The system architecture is primarily driven by the backend-for-frontend pattern, referred to as “Experience Services” at eBay. The Java/Scala-based Experience Service works in tandem with the NodeJS application to render the UI components as soon as they are ready utilizing server-sent events. This allows the user experience to be rendered progressively, reducing the failure rate and producing a richer user interaction model. The Experience Service is responsible for stitching together the domain microservices and their responses using parallel processing, improving the response time and helping buyers more quickly find items they’ll love. 

coded coupons 5

Once the coupon is created and scheduled, the marketing hub utilizes the business event stream (BES) system to provision touchpoints for the buyer experience in an asynchronous manner, including indexing the promotion in search results, updating the audit and performing other data updates (with retries for failures). This provides reliable data consistency, while powering the complex combinations of different promotion types through an extensive inventory injection refresh mechanism.

Buyers’ Architecture

The buyers’ experience needs for promotions are diverse. Rather than choosing a single software solution, the marketing tab uses a “dual-write” model where both Oracle and MongoDB work in tandem for each interaction mechanism. For example, promotion content for search results is pre-indexed, using asynchronous processing for both scheduled updates and refreshes based on changes in inventory or other events. This tradeoff helps reduce the response time for search results, and allows complex computations to be performed in parallel without any significant impact to the promotions experience.

coded coupons 6

With the “dual-write” model, the MongoDB cluster enables buyers’ experience, providing targeted item context to scale with ease. Some of the touch points — such as the promotion details page and all promotions pages — are powered by the MongoDB cluster. The largest use case is the View Item page, where the best promotion for a buyer is evaluated approximately four billion times per day. 

However, to prevent any unwarranted transactional integrity issues, both the Cart and Checkout flows are powered by the Oracle database, which acts as the source of truth. This provides a mechanism for gaining the best of both worlds, where critical consistent flows are served using transactional guarantees provided by Oracle, while MongoDB helps scale billions of reads with eventual consistency

Current Performance and Metrics

As you can see from the metrics below, the new platform is able to seamlessly handle a high volume of promotions being created and managed on a daily basis. The “dual-write” architecture provides the flexibility required by the marketing tab to scale both for a large influx of seller promotions and to provide promotions data to buyers without any delays in computation or bottlenecks. The platform is even prepared for seasonality or other market fluctuations, which are automatically managed by horizontally scaling the required number of servers.

Seller Experience Dual-Write Without Any Performance Degradation

coded coupons 7

MongoDB Scaling for a Large Number of Read Queries

coded coupons 8

What’s Next

With the excitement around the new coded coupons release, we listened to our customers and quickly released more features such as adding a custom image for coupons, facilitating easy social sharing and supporting coupons in the Marketing API for third-party vendors. In tandem with our Seller Initiated Offers tool, now sellers can also queue up a coupon to share if their offer expires as a way to help sweeten the deal and close the sale. And, to reward loyalty, they can generate a coupon directly from orders to enclose with the package or send over email.

coded coupons 9coded coupons 10

This innovation is only the beginning. The promotions platform is currently being outfitted with additional highly sought-after promotion mechanisms, such as providing shipping discounts and improving the inventory selection using richer features with deeper search integration. The team is also working on enhancing the promotions experience on native, improving buyer placements and much more. 



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *