Say hi to "OnePush", our new push delivery backend!
This past week, our team launched OnePush -- our new push delivery backend written in Rust. The number of developers using OneSignal has more than doubled since the start of the year. As our user base grows, the load on our system responsible for delivering notifications reaches closer and closer to 100% of our capacity during peak times. In order to ensure reliability and stability, we have been working on a successor for this system which can grow with us and our users.
With OnePush, iOS notification delivery is up to 100x faster.
We are now sending 100% of iOS and Safari Push Notifications through this new backend using Apple’s brand new HTTP/2 API. Notification delivery for Web Push, Android (GCM) and other platforms will be migrated to the new backend in the following weeks.
How do these improvements work?
Dramatic performance increases are able to be accomplished for two reasons:
- Moving away from a dynamic language with a GIL (Ruby) to a compiled language with true multithreading (Rust)
- Switching to Apple's new HTTP/2 delivery API.
Our previous delivery system was written in Ruby. As with other interpreted languages, Ruby has a global interpreter lock (aka the GIL) which prevents more than one Ruby thread in that process from executing in parallel. In addition to the GIL limitation, Ruby code is interpreted; this has the consequence of being generally slower than compiled code. Implementing the new system in Rust eliminated both limitations and allows us to fully utilize the infrastructure which runs our delivery system.
Apple's new HTTP/2 API is also a huge contributor to increased notification throughput. Without getting into too much detail, their legacy delivery API required resending every notification that you've already sent when a single notification from that stream had an error. The upper limit on transmissions with the old protocol is
n! where n is the number of notifications; for example, this could occur where every notification in a set is rejected by Apple. This history makes the HTTP/2 API extremely attractive. Every notification gets a response and rejections do not require re-transmitting subsequently sent notifications.
Delivery for other push services supported by OneSignal will be added to OnePush over the coming weeks starting with Android, Chrome Web Push, and Firefox Web Push platforms.
Stay tuned for some engineering focused blog posts about this new system!
~The OneSignal Team