Session Replays
Today I'll brainstorm the session replays and try to whip up a POC.
I'll start by reading the rrweb docs.
The recording and replaying part seems easy enough, but I need to think about the storage. I don't want to pay for cloud storage right now, so it's gonna have to be self hosted. A good option seems to be MinIO so that's what I'm going with.
The retention will be 30 days. I won't back any of it up, so if the machine dies somehow it's lost. It's a risk I can take though. If I ever get any money from this I can invest into something more stable.
The metadata (session id, client id, user id, time) is small and will be stored in postgres.
The script will simply import the rrweb from cdn for now, but I'll have to revisit that in the future.
I'll need a few endpoints:
-
POST /sessions
- receives events batched on frontend
- saves metadata with timestamp to db
- saves events to storage
-
GET /session/{id}
- gets all events by the session id
- retrieves them from storage
- orders them by timestamp
- returns them
And probably some specific ones for querying and what not. Let's get this POC working first though.
Did a bunch of work and got something close to a POC working, but still not quite there yet. I can save and load the recordings, but stuff is missing and I haven't put them together properly. Done for today though.