Custom and advanced analytics


I’m evaluating piwik and there are a couple of features that I need on my website that I don’t know if are supported.
Anyone can help me?

I need to track the amount of time that each user (with user identification - userId) spent on a resource (watching a video, watching a page, and so on).
Besides that information per resource, I also need to the to aggregate that info per context. For example: “How much time did the user spent on all the resources about a certain topic - Sports or Politics for example”.
Can I retrieve that info? If so, is that info available fast enough to be retrieved in real time?

Another one:
Based on a ID (that matches a certain context), can I easily check if a certain user has watched it?
This kind of info will be queried a lot from my website. Is that a problem? I mean, I want to use these data to show to my end users.

Thank you!