Overview
Tennis is a fantastic game. We’ve seen some of the greatest tennis players of our time like Roger Federer and Rafael Nadal who have changed the very definition of performance. One thing that is common with these top players is that they improve their game not just by sweating on the court but by smartly analyzing their each move too. They analyze their match videos with their coaches and learn from their mistakes. BreakPoint Analysis, one of the Australia’s largest tennis coaching academy, provides such video analysis services to players at all levels. They film approximately 10,000 tennis matches per year in 4 cities around Australia, and provide athletes and coaches with opportunities to learn from their matches through a number of different video analysis options within their online learning platform. The players can purchase their videos and order separate detailed analysis.
Problems
Until now, their platform was built on WordPress which is known to have security vulnerabilities, performance issues and a very hard maintenance cycle. The platform’s website was rife with lots of (unused) plugins and the database was highly cluttered too. The main issues with the existing site were:
- Players not being notified when their match videos were available which meant losing potential customers
- Manually calling multiple scripts to update the database after uploading the videos
- No payment gateway integration. The players had to email the admin separately if they wanted to buy any video
- Non-responsive website
- Very slow page loading and sometimes timeout exceptions
Approach
We started collecting new requirements from the client, like managing players, coaches, tournament, payment gateway integration etc. We then analysed the existing wordpress database because we had to import a huge amount of existing data like users, players, videos etc. The UI was designed keeping in mind the low-tech knowledge of the users with one-click payment option by integrating Stripe.
Solution
Since the website would be getting large traffic in peak times like tournaments, we decided to go with Laravel and PostgreSQL along with Redis for data caching. To stream videos from the Amazon S3, we used the versatile VideoJS library. Since the client was already using AWS, we decided to leverage the same and created a web server on AWS EC2 and database server on AWS RDS. We also decided to use AWS Lambda to directly updated the database as soon as any video file (with specific file name format) was uploaded to AWS S3 bucket. This solved two problems:
- There was no need to run any script (bash or otherwise) to update the database when the files were successfully uploaded to Amazon S3 buckets.
- The players were notified the instant the files were uploaded of their matches.
We want to stress here the excellent opportunities that Amazon Labda provide when it comes to event driven programming. It’s an excellent programming model, which can be scaled infinitely and is extremely cost effective. We essentially enabled events on the Amazon S3 bucket to call our Lambda function which in turn would call our API to the update the database and send respective emails to the players.
Results
The final results have been astounding. There is a massive increase of 40% in sales of videos and analysis. This is what the client said after the final deployment: