I built an iOS app similar to Vine, where a user can scroll a feed of videos that auto play. All of these video have a View_Count field in the backend to keep track of how many times the video has been viewed.
Right now the way I have it set up, is as soon as the user starts watching the video, I increase the View_Count locally on their phone so they can see it tick up, and then I make a call to the backend server with the following steps:
- Request video object to grab most recent View_Count (the one on the user's phone will be different as many people are watching these videos at the same time)
- Increase View_Count by 1.
- Post updated View_Count to server.
I am mostly a front end/iOS guy, so I'm not sure if this is a correct assumption, but I feel like the above steps should NOT be happening on the user's phone. I feel like it is not only using too much of the user's data plan, but also my gut tells me that this type of logic is not supposed to be on the client-side.
Am I correct in assuming this?
All of our video's are stored on AWS using s3 buckets and are being accessed via CDN URL's. I feel like every time an s3/Cloudfront CDN URL is accessed, that AWS should ping my server and increase the View_Count by 1 for that video, but really I have nothing to go off of but my gut instinct because I've never done something like this before.
Am I on the right track at all with these assumptions, or am I approaching this the wrong way?