The Untappd application lets users record their beer selections, share their likes with friends, win rewards, get recommendations, and participate in a shared passion of beer with others around the world. A solid design, a fun set of features, and a responsive application are just a few of the reasons they’re one of the fasting growing entertainment-based social communities.
What’s even more impressive about Untappd is that it’s just a two-person company – a designer and a developer, both of whom have other jobs and are doing Untappd on the side. This is a story on how they got started and the work that goes on behind the scenes to power their success.
The Untappd StoryGreg Avola and Tim Mather met over Twitter six years ago when Greg was looking for a collaborator for a Twitter mobile app. They ended up working together on the app and then proceeded to take on several other projects as a designer/developer combination. In early summer of 2010, Tim came up with the idea for a check-in system for beer drinkers. The idea mapped well with Greg’s interest in beer and so they quickly created a mobile app and got to market by the fall.
The team works closely with breweries and beer venues to increase the connections that users have with their favorites beers. They help breweries and other partners create badges and other promotional elements for beers and events. The badges are hugely popular and are posted and shared widely within the app and across social media.
|Checking In a Beer|
Registered users top over a million and they service over 300,000 check-ins on weekend nights and have processed over 50M events (the majority of them using Iron.io). Users love the Untappd app and use it to keep track of their beer, discover new favorites, meet new people, and find new places of interest.
The Untappd app is a model that works – a fanatical user base, an app that provides rewards, hundreds of happy partners, and an almost limitless opportunity.
Behind the Scenes of the App
Before Iron.ioInitially, the check-in processes were being handled as a large batch job after hours at night. Because actions were being posted well after the actual event, the check-in process obviously wasn’t as responsive enough for their users as they needed. The Untappd team then moved these actions to the check-in response loop. That lasted for a little while as it resulted in a more responsive check-in but it quickly showed signs of strain. On heavy nights, the Untappd main app servers would start to melt because they were being used to process all the actions for each check-in, in addition to serving pages and providing query responses.
This tightly coupled serial approach also resulted in users having to wait for each process to start and finish in sequence. The delayed response times began having noticeable impacts on engagement. It was taking much longer to check-in as the app wouldn’t return for up to many seconds at a time. Users were getting frustrated and so they were not checking in for the second beer or the third.
|Serial Processing Events at Check In = Slow Response Times|
To keep user engagement high and their user base growing, they needed find a solution to their check-in problem. They turned to Iron.io to do so.
After Iron.ioTo make their application more responsive and scalable, Untappd move their event processing to Iron.io as a combination of IronMQ and IronWorker. Each check-in event is sent to a queue within IronMQ and then routed to workers within IronWorker. The processing runs outside the user response loop, which speeds up check-ins as well as provides the ability to handle any and all spikes in traffic.
Continual Event ProcessingThe way the event flow works is that they put a check-in event onto a single queue and then that fans out to multiple queues – with each sub-queue controlling a different action, such as posting to social media or updating the recommendation engine. Multiple workers spin up soon after a check-in happens and so by the time the user has laid down their phone and sampled their beer, every action is either in process or has completed.
There are 4 main processing flows for Untappd events. General tasks handle the basic parts of Untappd; Social tasks push messages to social media for checkings; SocialBadge tasks push to social media for badges earned within the service, and PostPush tasks handle push notifications.
Untappd employs master tasks to control and manage the scaling of each flow. Each master task runs every 60 seconds as a scheduled job and calculates the number of open jobs left on MQ for each type of event. If the queue is large, the task will spin up new workers on demand to deal with the load. When a worker runs, it will poll a queue based on their job type, get the event payload, execute the job, delete the message, and then repeat. Each worker will run for a set duration ranging from seconds to minutes.
This structure gives them immediate flexibility to handle high traffic loads but also kill off worker jobs when loads are light. In terms of concurrency, they might have 50-100 tasks running at once per processing flow at peak times, scaling down to at least 8-10 on slow periods.
|Processing Events Concurrently = Fast Response Times|
Real-time RecommendationsThe local recommendations feature was rolled out at the beginning of 2014 and became an instant hit. One of the biggest problems with making recommendations on beer is that users are drinking it in locations around the world. Untappd can't recommend a beer to someone in San Francisco when it’s only available in New York City. It’s not a relevant recommendation and so all it does is distract from the experience.
The End ResultThe combination of IronMQ and IronWorker has saved Untappd hundreds of hours of development time and greatly increased their ability to release new features and build new capabilities. It has also given them a very reliable and scalable processing framework. Untappd just pushes events to IronMQ and the Iron.io platform takes care of everything else. The Untappd team can concentrate on building their app and serving their customers, plus they get to relax on even their busiest nights.
First off, can you tell us how advertising and promotions fit into the application and the growth of the community?
Badges are similar to ads but better people are posting and sharing these items on their own. When’s the last time someone saw an ad and shared it on Twitter with their friends. Nobody does that. People tend to get pretty obsessed with badges which is why we’re continually evolving ways for people to get them and then share them. It's a different take on advertising, for sure, but one that we think is a heck of a lot more sustainable.
Doing things in a more distributed asynchronous manner that you're able to develop features much more quickly because you're working on just that feature and everything else is still working as it did. It's also just a great way to modify the app without having a whole production come down on us if we make a mistake.
If I want to tweak the recommendations setting a bit, I just go into that task, adjust it, push it through some QA testing, and then push it into production. Or if I want to do something new – say I wanted to perform a large task such as pulling all the check-ins for a single day into a separate table and perform some complex analysis. All I have to do is fire up a worker or alter one of the ones we have and we’re good to go. You can do it independently knowing you aren't going to affect any production actions or workflows.
How has this type of architecture changed your development approach?
|I'll Be Bock Badge|
It has helped even from a code analysis perspective. I'm a very visual person so when I go into the Iron.io dashboard, I can see all the worker code that’s in there. I know which ones are part of which tasks. I can inspect them out and modify them without affecting the app in full. It’s sped up our developing task for sure.
An analyst we know is a fan of Untappd plus he also uses your application as an example in his slide presentation about mobile development. Can you explain how you’re able to gain leverage in the market with such a small team?
We have to use all the tools we can to help us develop because we're already at a disadvantage against other companies that have way more funding and any number of developers. I'm the only one writing back-end code and so anything I can to help me develop faster, more efficiently, and more effectively I'm going to take that opportunity. Obviously, the tools that I've been able to use from Iron.io have been able to help me significantly with that. Sounds like a commercial but it's really true.
What are some of your favorite things about working with Iron.io?
|To Infinium |
Another thing I enjoy about working with Iron.io is the chat system that's pretty much manned 24 hours, seven days a week. As a developer working on things in production, I don't have time to use email support, fill out forms, or whatever to get someone to help me. I can hop into your support channel if we’re running into a problem or seeing an issue and get a quick answer. The documentation is great, but it's even better to get a real person on the line and get the answer right away. That's very important to us.
Weekend nights are your most active periods and yet you talk about being able to enjoy your evenings. Can you explain more about this application peace of mind?
This is a key point for us in using Iron.io. Of course I can easily install packages on my own servers but then I have to manage a lot of infrastructure and I don't want to do that. Being able to use the right tools to help us excel in our development practices, without having to manage ops, is a major thing for us.
If we’re worrying about ops all the time, we can't build the product. If we're worrying about building infrastructure, we're not worrying about building the best experience we can for our users.
Thank you for your time.
No problem. Thank you. Have a great weekend.
About Greg Avola
For more information on Untappd and their widely popular mobile app, download the Untappd app on iTunes or Google Play or visit their website.
To learn more about how Iron.io can help you create more responsive and scalable systems, visit Iron.io today.