# S6 E1: PubNub and Scaling Real-Time Messaging to 1 Trillion with Stephen Blum

Published: 2022-01-18
Duration: 1855s
Audio: https://pdst.fm/e/pscrb.fm/rss/p/audio4.redcircle.com/episodes/0b267b76-12c9-48ec-9ed6-cd08086c47f3/stream.mp3

## Key Takeaways
- Performance From the Kernel Up: PubNub is written in C from the edge to the PubSub bus. Going directly to Linux kernel APIs, rather than importing a library, was key to its low latency, efficiency and control of the network stack.
- Auto-Scaling Came Later: Scaling was manual and predictive for years. Starting in 2020, PubNub moved to containers, CI/CD and Kubernetes auto-scaling, which absorbed a surge of millions of users during a BTS online audience experience.
- When Retries Become a DDoS: After a vendor's DNS mistake, an SDK retry policy on 120 million AT＆T phones flooded PubNub. The team siphoned those clients to an endpoint returning success, which reset them to one retry per second.
- Spend 90% on Promotion: Blum says founders should put 90% of their time into promotion. He wishes PubNub had invested more in it and dreams of a dedicated media studio showing what the product can do.
- Hire for Drive: Blum values inspiration and motivation over credentials or years of experience. He sets key objectives and outcomes, then leaves the team open to define goals and create solutions that move business metrics.

Stephen Blum finds that his life outside of tech is tricky to define, given we are surrounded by tech everywhere. He was inspired to be a game developer at an early age, and he found it fun and exciting. In the gaming days, he really enjoyed the Legend of Zelda, Metroid - those adventures and the animation was fascinating to him. After a while, he found more excitement within the business world, and using technology to solve problems and profit. In fact, he finds it so much fun, that what he loves to do outside of work and business... is just chill. He likes it when there is no plans.

Stephen likes to support and invest in earlier stage AI and API companies. He has 18 different companies he has invested in, and he wants to continue expanding that portfolio, and into crypto as well - specifically arbitrage through API's, which he finds particularly fun and lucrative. One of the tricks he found is to make all trades simultaneously within the same wallet.

In their inception, they were trying to solve a problem... by simply creating a button to order a taxi. In the process of building that, they figured out they needed tech to allow more than one party to participate. And their product vision clicked.

This is the creation story of [Pubnub](https://www.pubnub.com/).

Sponsors

- [Immediate](http://joinimmediate.com/codestory)
- [Orbit](http://orbit.love/codestory)
- [Postmark](https://postmark.com/codestory)
- [Stytch](http://stych.com/codestory)
- [Verb Data](https://verbdata.com/codestory)
- [Webapp.io](http://webapp.io/codestory)

Links

- Website: [https://www.pubnub.com/](https://www.pubnub.com/)
- LinkedIn: [https://www.linkedin.com/in/stephenlb/](https://www.linkedin.com/in/stephenlb/)

  

Timestamps

00:00 – Intro

05:41 – Building the PubNub MVP

07:28 – MVP Decisions and Tradeoffs

11:50 – Maturing Product and Roadmap

14:23 – Building the PubNub Team

16:34 – Scaling PubNub Efficiently

19:23 – Proudest Accomplishments

20:44 – A Mistake and Response

23:34 – The Future of PubNub

24:52 – Stephen's Influences

25:59 – What He'd Do Differently

28:04 – Advice for Young Entrepreneurs

Times are from the episode recording; ad breaks in your player may shift them a bit later.

  

Read the key answers from this episode, with quotes and timestamps from Stephen Blum from PubNub: [https://www.codestory.co/episodes/s6-e1-scaling-to-1-trillion-messages-building-the-real-time-fabric-of-the-internet-with-stephen-blum-of-pubnub/](https://www.codestory.co/episodes/s6-e1-scaling-to-1-trillion-messages-building-the-real-time-fabric-of-the-internet-with-stephen-blum-of-pubnub/)

  
  

Current Sponsors:

- [Tiger Data](https://tigerdata.com/)

- [Protected Harbor](http://protectedharbor.com/codestory)

- [Render](https://render.com/)

- [Fitnexa](https://www.fitnexa.com/)

- [Perplexity](https://pplx.ai/codestory)

- [Entelligence](https://entelligence.ai/)

Checkout our Stacklist! [https://stacks.codestory.co/](https://stacks.codestory.co/)

Check out our [Patreon!](https://www.patreon.com/cw/codestory)

Hosted by  [Noah Labhart | Technical Founder & Startup Mentor.](https://noahlabhart.com/)

  
  
Our Sponsors:  
* Check out Granola and use my code granola.ai/CODESTORY for a great deal: https://granola.ai  
* Check out Perplexity: https://pplx.ai/codestory  
  
  
Advertising Inquiries: [https://redcircle.com/brands](https://redcircle.com/brands)  
  
Privacy & Opt-Out: [https://redcircle.com/privacy](https://redcircle.com/privacy)

## Chapters
- 0:00 — Intro
- 5:41 — Building the PubNub MVP
- 7:28 — MVP Decisions and Tradeoffs
- 11:50 — Maturing Product and Roadmap
- 14:23 — Building the PubNub Team
- 16:34 — Scaling PubNub Efficiently
- 19:23 — Proudest Accomplishments
- 20:44 — A Mistake and Response
- 23:34 — The Future of PubNub
- 24:52 — Stephen's Influences
- 25:59 — What He'd Do Differently
- 28:04 — Advice for Young Entrepreneurs

## Frequently Asked Questions
- **Q:** What is PubNub and what is it used for? — **A:** Stephen Blum describes PubNub as powering virtual spaces where multiple parties interact, such as food delivery updates, multiplayer games, chat and collaboration. In his words, PubNub empowers "that connection in that virtual space. So you can facilitate the multi-party environment." [03:21]
- **Q:** How did PubNub get started? — **A:** Stephen Blum and his team set out to build an app with a button that ordered a taxi. While building it, "it turned out that we need something like PubNub." [04:32] They opened up the API, and game developers became one of the first big groups of paying users.
- **Q:** How does PubNub achieve low-latency messaging at scale? — **A:** Stephen Blum credits a tech stack written in C and a design that runs globally across every data center. He said that "a key part of what made PubNub possible was actually just directly going to the kernel" [11:18] to use the capabilities Linux already offered.
- **Q:** How did PubNub handle a DDoS caused by its own SDK retry policy? — **A:** Stephen Blum explained that after a DNS issue was fixed, AT＆T phones stuck in a retry loop overwhelmed the network. The team isolated that IP block, and "we had a separate endpoint that would return successful statuses to all those phones." [23:10] Healthy traffic was then migrated back to the main network.
- **Q:** What advice does Stephen Blum give early-stage founders? — **A:** Blum warns that launching a product is only the beginning and that instant unicorns are rare. He urges founders to build promotion into the business plan: "I would always go back to say, spend 90% of your time on promotion." [29:35]
