PubNub's CTO discusses scaling their messaging network with Rust for low-latency signal delivery, overcoming memory leaks in C, and the benefits of Rust in improving memory usage and performance. The podcast explores language choices, memory management challenges, and the trade-offs of using Rust for system development.
PubNub focuses on enabling near-instant signal delivery for seamless user experience.
Adopting Rust at PubNub led to 5x improvement in memory and performance.
Deep dives
Popnub's Edge Messaging Network for Enhanced API Performance
Popnub is a company that has built an edge messaging network with a focus on enhancing API performance. They have invested heavily in building a network that can handle billions of devices connected at once. Their network provides near-instant signal delivery, even at massive scales, ensuring a seamless user experience. Popnub's infrastructure is globally distributed, running on AWS with Kubernetes clusters in multiple regions. This setup enables them to provide low-latency experiences for users worldwide. Performance and latency are key considerations in their architecture and services to meet customer expectations.
The Importance of Latency and Performance for Popnub
Popnub places a strong emphasis on low latency and high performance. Speed plays a crucial role in the evaluation of their services by prospective customers. While some use cases may not require lightning-fast speeds, the overall user experience is greatly enhanced when actions happen almost instantaneously. Popnub's globally distributed infrastructure, running on Amazon's network, allows them to achieve millisecond latency for users near their regions, while also delivering excellent performance across continents. They have designed their architecture to prioritize performance and ensure users have an exceptional experience using their services.
Rust's Role in Popnub's Scalability and Performance
Popnub chose Rust as part of their technology stack to scale their edge messaging network effectively. Rust has been integral in handling Popnub's non-homogeneous workload, with billions of devices needing to receive numerous messages simultaneously. The language's performance capabilities and memory safety features have allowed Popnub to achieve impressive results. By leveraging Rust, they have reduced memory usage and improved overall performance. Rust is now the most popular language at Popnub and will be their go-to choice for future services.
Challenges and Successes of Adopting Rust at Popnub
Adopting Rust at Popnub has come with its challenges and successes. While the language brings benefits such as memory safety and high performance, the pool of experienced Rust engineers can be limited. Popnub aims to expand this pool by attracting people interested in learning Rust on the job. The company encourages knowledge sharing through various channels and supports on-the-job training. Popnub values simplicity and maintainability in their codebase, and they believe in finding the right balance between utilizing Rust's capabilities without adding unnecessary complexity. They recognize the potential of Rust in the AI and machine learning space and are enthusiastic about exploring it further.
PubNub is a global Data Stream Network (DSN) and realtime infrastructure-as-a-service company. PubNub's primary product is a realtime publish/subscribe messaging API built on a global data stream network which is made up of a replicated network with multiple points of presence around the world. PubNub's primary headquarters are in San Francisco, California, with additional offices in Mountain View, California, Eindhoven, Netherlands, and Cambridge, UK.
About Stephen Blum
Stephen Blum is the founder and CTO of PubNub. He has worked in the realtime communications space for over 15 years, developing technologies that have been used by companies like Yahoo!, AOL, and Google. He is the author of several books on realtime communications and has been awarded several patents for his inventions.