Ad Auction/Activity Stream Sorting: Can it be done?

Hi Folks,

I’m building an application where the primary UI is a Facebook-style activity stream. I have two separate, but related questions that I’m hoping the community can help me sort out.

Activity Stream Sorting — I would like posts to be sorted based on the current user’s affinity for the content in each post. I’ve already sketched out the basic logic involved. That is to say, I know how I would build it. The question I have is whether there is a way to build this in Bubble that would be performant.

The basic idea is as follows:

  • Each time a user logs in, we will pull from the DB all posts from those they follow created since their last log-in.
  • These posts will be sorted by their “relevance score,” which would, in turn, be computed from three variables: A measure of the strength of the user’s affinity for the poster, a measure of the strength of the user’s affinity for the content type and the number of engagements with that specific post.
  • The first two measures outlined above would be composite scores based on the users’ historic interaction with the poster or content type in question.

Obviously, performing these calculations on the fly each time a user logs in would be pretty resource intensive. Is there a way to do this without sacrificing performance — perhaps with the help of @keith’s List Shifter plugin?

Ad Auction — Similarly, my revenue strategy for this application relies on advertising, and I’m interested in building a simple, Facebook-style ad auction to allow for dynamic pricing that can fluctuate with supply and demand.

Just as before, I understand the logic that would go into building something like this, more or less. What I’m struggling with is whether there is a practical way to build this in Bubble without bogging down the app to the point that UX goes out the window, as we would have to perform a lot of on-the-fly calculations every time an ad module appears in a user’s activity stream.

Would be very grateful for any advice from folks who’ve attempted something similar. Thank you in advance!

— TS

I think the best way to do it would be have new posts <1 hour old sort first, and beyond that have hourly score computations running on the back end

1 Like