Zoomy Controls Dispatch and Real-time GPS Maps Using PubNub
The Need for a Real-Time NetworkThe appeal of Zoomy is real-time responsiveness and interaction for both the user and the taxi driver. This meant that Roam had to build two different applications (one for customers and one for drivers), built on top of a real-time network to allow the two applications to interact and communicate, in real-time, with one another. Roam needed a real-time network to power two key components of the Zoomy app:
- Control the overall communication and notification flow between customers and drivers
- Dynamic GPS updates to show location of driver on a real-time updating map
It hammered the backend server for every 10 seconds to check for updates and to publish data. And of course, that’s not real-time. It overloaded the infrastructure unnecessarily, and it just didn’t have that smooth feeling. It would be up to 10 seconds depending on where they fell on the polling interval,Chris Moore co-founder and Director of Roam Creative
Build-vs-BuyWhen Roam experimented with SocketRocket and Socket.io, they had another build vs buy discussion. Building and integrating a custom real-time network is only part of the development process. Scaling and maintaining that network is another.
After Roam decided to implement a real-time network rather than building their own with polling, they tried another real-time service provider first. This provider’s biggest limitation was their compatibility and functionality on mobile. Because the Zoomy app is entirely mobile, battery constraints and cross-SDK compatibility were key concerns. Additionally, the first provider they experimented with had 3rd party SDKs, were weaker on mobile, and only seemed to be focused on web based real-time.
In the back of my mind, I was thinking ‘Do I want to run a real-time network as well?’ Scalability, operations, and writing the mobile client on two different platforms, and maintaining it, felt like a stretch of resources. Because for us, real-time was one of many pieces of the puzzle,Moore
As a result, Roam chose the PubNub Real-Time Network to power all real-time communication, signaling, and updating in the Zoomy app. Using a Node backend and MongoDB lookup, Roam easily implemented PubNub into the Zoomy app to update and connect drivers and customers, all in under a second.
“When I started looking at mobile, someone else had done a library for them, it wasn’t the real-time service provider themselves. I felt that it wasn’t going to meet the reliability needs, and having a real point of contact that would support it, rather than a 3rd party contact. You can’t run a business on those,”Moore
The main use is to, in real-time, control the flow of the ride between two parties, the passenger and the driver, as well as dynamic GPS updates,” Moore.
A Tight Real-Time LoopZoomy uses several PubNub features to make the entire experience real-time and seamless. Using PubNub Broadcast and Unicast, the drivers and passengers are connected in a tight real-time loop that eases the flow of communications and events between them accounting for dropouts and port networking conditions.
As a driver, you might have accepted the job, and as far as you’re concerned you start driving towards the passenger, but you don’t know that the passenger never received that, because maybe his network dropped out temporarily. So we included an acknowledgment system over PubNub, and that works fantastically, MooreZoomy also uses PubNub for GPS updates, so the customer can watch their taxi approach on a map interface in real-time. Using MongoDB lookups, GPS coordinates are sent at 1/4 second between the driver and the passenger via PubNub. The apps then publish the coordinates on the map straight through PubNub, rather than going through the backend servers.
The passenger can, in real-time, on their map updated once a second, see where the driver is. That was something that we couldn’t do before with polling. And that works really well. It really brings the app to life. When it was all on a polling system, it would feel kind of clunky, and for example, your taxi driver might move through a building or across a river. It works fantastically.
Bringing the App To Life
As a web and mobile app development studio, Roam’s designs, develops, and deploys applications for customers from start to finish. They needed a solid service to be integrated into the application when they handed the finished product to Zoomy.
It’s a far smoother and faster experience. It feels really fluid along with the app animations. It just brings it all to life.
If it was our own app internally, we could re-engineer it as we found bugs or issues. But when we’re developing an app for somebody else, we really have to pick something solid and reliable, and that’s going to be around, and stay around. We rely on PubNub for real-time services. Our benefit is in design and delivery of mobile apps, not getting into building and maintaining real-time infrastructure.