java - Collating/Managing data to populate "live activity feeds" in web app -
i have of abstract question regarding managing live feeds/polling on web sites.
i creating web app (built on java/spring/hibernate) , on user's home page want live feed of latest activity members of there team, , trying work out best way handle query on server side.
the brute force way load current users list of team mates, , iterate through each of team mates, loading latest conversations/file uploads/etc, , merging activity in single list sorted timestamp , returning (lets sake of example return top 10 latest activity feed).
however, seems un-performant, operation need done regularly (depending on polling interval).
i have considered making potential activities (conversations/status updates/uploads) extending activity class , having direct sql/jpql query in dao selects latest activity set of users returned, concerned might bypass caching , continued access db reduce performance.
has handled type of problem before? 1 know approach is?
thanks!
this old 1 now, here did this:
- all tasks should appear on live wall extend
activity
(this case) - created new
notification
object,notification
had link underlyingactivity
, link user (who being notified). - created pre-persist hook
activity
creatednotification
objectactivity
being persisted - did every user interested (all users following user persistingactivity
)
for moment, notifications
persisted/retrieved db - possibly not scalable high volumes, approach think supports moving queue based system (such linkedin's kafka queue library designed purpose). per-user, provides option have read/unread notification flag significant notifications.
Comments
Post a Comment