Orion is the codename for the new home experience on Wattpad, found across all the various platforms we support. Most distinctive about it is the scrolling list of items that showcase different types of content. We call that a feed of modules, where each row is a module of a different type.
Here, we see 3 types of modules.
Top: Viral list - the most popular stories of the moment.
Middle: Recommended Reading List - stories belonging to a recommended reading list.
Bottom: Recommended Hubs - reading lists belonging to a recommended hub.
As of this post date, there are 20 different modules that can show up on Orion.
Platform team's contribution to this wonderful new feature is a brand new microservice, built completely in Go. Its purpose is to select modules for users that are meaningful and appropriate. The result should be an "endless" feed of recommended content for users to peruse and discover. A few key things to note about this feed:
1. It is pseudorandom; the first generation is randomized, but subsequent calls guarantee that module content won't be repeated.
2. Some module types may show multiple times with different content, while other types only show up once. In the above example, while the top module only shows up once, the other two can reappear later in the feed with different content.
3. Impressions and clickthroughs of the modules are tracked to allow us to build a system to determine what users like and don't like. This allows us to personalize the feed based on module types the user prefers.
We used the concept of weights to generate an arrangement of modules according to users' preferences. How so? Simple: weighted probabilities when performing random selection of modules.
Each type of module has an associated weight which is unique per user. This weight is calculated by
# clickthroughs / # impressions
The weights are then used in a weighted probability algorithm to select the modules that would be returned as part of the response. The concept can be visualized using the diagram below:
YOU ARE READING
Journey to the Center of MicroservicesNon-Fiction
We're trying something new. Well, trying two new things. We're starting to blog about Wattpad's journey into the world of microservices. And we're blogging on our own platform. We're proud of the really hard problems we have to solve every day and w...