Filmgrain ranks movies by popularity on Twitter and enables users to watch what people are tweeting about those movies in real time. Part 1 describes how we built our backend making extensive use of Redis. This post focuses on why we chose to build a TCP API, how we structured our API, and the technologies we use on the endpoints so that they can handle a large number of concurrent TCP clients.
Why Build A TCP API?
While an HTTP API is ideal for many types of apps, the fact that there is so little discussion of alternatives is troubling. I fear that we as a community of developers have gotten dogmatic in our thinking that an HTTP API is always the best choice. In fact, I believe it is definitely the wrong choice if you're building an app that would benefit from doing things other than simply downloading and presenting information to the user.
Filmgrain enables users to see what movies are popular on Twitter and watch what people are tweeting about those movies in real time. We had to do some out-of-the-box thinking on our backend and the way apps communicate with it in order to make this functionality possible.
The Backend Architecture
Modularity has many benefits that are pretty obvious to most programmers. Unfortunately, many backends aren't built with modularity in mind from the very beginning and so end up becoming monolithic monstrosities.
Going to see a movie is a pastime with a long history. Finding out which movie to see, however, has hardly changed. We're trying to fix that.
Movie trailers, critics' reviews, and word of mouth are pretty much the only ways to find interesting movies. The problem is, unless a friend happens to mention an upcoming movie, it's hard to know which movies people are actually the most interested in. Until now.
Filmgrain makes it easy to find out which movies people are excited about, fast.
The moment you open the Filmgrain app, you see which movies are the most popular in theaters and which upcoming movies are generating the most buzz. With Filmgrain, you'll know which movie you should go see and what movies your friends are likely eager to see as well.