Leverage Phoenix Presences and track user activity

Hey all.

Been working with Phoenix since this summer and am just loving it :slight_smile:

I’m looking for ways to leverage Phoenix Presence to log user activity and eventually be able to answer questions like: which users spend most time on what channels. what are the times when users are most frequently logged in.

Currently I’m thinking I can simply save to a database (postgresql) join / leave timestamps, and from there derive activity. I’ve never done anything like this before, anyone with experience here chime in or point me in a right direction?

Phoenix Presence seems incredibly powerful tool to solve this problem and I’d love to hear any suggestions on what people here with experience have done :smiley: Thank you for any help!

1 Like

So, hmm, Postgres might work or might not work. This really depends on your set up and the way you’ll collect the data, how much data there’s going to be etc.

There’s a specialized database, however, for time series data. You might want to have a look at https://www.influxdata.com/ InfluxDb. I can’t tell if it’s right choice for you but does not hurt to investigate.

1 Like

Thank you. do you have any other recommendations for databases?

I realize now this is a very general question, not Phoenix / Elixir specific at all. What do you mean by collect data? Fire off async database inserts on presence_diff events is what I was thinking. I definitely need to give this more thought.