"You've Rated X Beers" & User Stats Updates

Blog Discussion in 'BeerAdvocate Talk' started by Todd, Nov 2, 2014.

Thread Status:
Not open for further replies.
  1. Todd

    Todd Founder (13,518) Aug 23, 1996 Finland
    STAFF Mod Team Society Pooh-Bah

    Above the top beers, beer styles, and brewery beer lists pages we indicate the number of beers you've rated. Prior to this update we checked if you rated each beer while looping through the list. This was resulting in upwards of hundreds of additional database queries per page, per logged in user.

    We're now storing a list of the beers you've rated, which gets initialized when the page loads, resulting in no additional database queries and faster pages. Currently this data is being generated/synced hourly based on the last time you accessed the site, however, I'll be working with @Mike to include an update upon rating or removing a rating for instance list access.

    Misc Updates
    • Core stats are being synced hourly (beers/places rated, wants/gots, trade stats)
    • Sub stats are now being synced daily (states, countries, place types, beer/places/pics added, etc)
    • Fixed an issue with new users not being able to see their core stats until the next hourly update
    Note: User stat syncing is based on the last time you were active on the site; so you'd be synced if you were active within the last hour or day accordingly.

    I'm not 100% happy with the hourly and daily syncs, so I might make some adjustments, but it greatly improves performance.
     
Thread Status:
Not open for further replies.