1 of 52

Case Studies, with

...and why you should use the cloud for your application needs

Weiyuan Liu

GDE, Google Cloud

Director Of Engineering, ZilLearn

Title safe

Action safe

2 of 52

Title safe

Action safe

Title safe

Action safe

3 of 52

Title safe

Action safe

Title safe

Action safe

4 of 52

Title safe

Action safe

Title safe

Action safe

5 of 52

It’s overwhelming … but you don’t have to use everything

Title safe

Action safe

Title safe

Action safe

6 of 52

“Live streaming” with

Case study I

Title safe

Action safe

7 of 52

Problem Statement

Title safe

Action safe

8 of 52

Problem Statement

  • No physical events
  • Need a live streaming solution that is
    • Easy to use
    • Affordable
    • Can stream to multiple destinations

Title safe

Action safe

9 of 52

Solutions #1 - Streaming solutions - Facebook, Twitch

Solutions #2 - Free Open Source Solutions (OBS)

Solutions #3 - Streamyard

What if we just improve the current solution?

Title safe

Action safe

10 of 52

Solutions #3! - Streamyard + DIY

  • Easy to use
  • Affordable
  • Can stream to multiple locations

And more...

Title safe

Action safe

11 of 52

Solutions #3!! - “Anything” + DIY

  • Easy to use
  • Affordable
  • Can stream to multiple locations

And more...

Some RTMP Stream�(e.g. Streamyard, Zoom, Google Meet)

Title safe

Action safe

12 of 52

How?

Title safe

Action safe

13 of 52

Architectural Diagram (Intention)

RTMP Stream�(e.g. Streamyard)

And more...

RTMP Stream Mux

Title safe

Action safe

14 of 52

Architectural Diagram (Compute Solutions?)

RTMP Stream�(e.g. Streamyard)

And more...

Serverless?

FaaS?�IaaS?

Serverless - Easier to scale, maintain, harder to customize (Cloud Run, App Engine, Cloud Functions)��IaaS - Easier to customize, harder to maintain (Compute Engine)

Title safe

Action safe

15 of 52

Architectural Diagram (Compute Solutions?)

RTMP Stream�(e.g. Streamyard)

And more...

Serverless?

FaaS?�IaaS?

Serverless - Easier to scale, maintain, harder to customize (Cloud Run, App Engine, Cloud Functions)��IaaS - Easier to customize, harder to maintain (Compute Engine) NEED RTMP to be supported!

Title safe

Action safe

16 of 52

Architectural Diagram (Compute Solution)

RTMP Stream�(e.g. Streamyard)

And more...

VM Instance

Compute Engine

Title safe

Action safe

17 of 52

Architectural Diagram (Compute Solution)

RTMP Stream�(e.g. Streamyard)

And more...

NGINX Server,

RTMP module

Compute Engine

Title safe

Action safe

18 of 52

Nginx

Stunnel

… and Node

Title safe

Action safe

19 of 52

Architectural Diagram (Compute Solution)

RTMP Stream�(e.g. Streamyard)

And more...

NGINX Server,

RTMP module

Compute Engine

Title safe

Action safe

20 of 52

Architectural Diagram (Networking?)

RTMP Stream�(e.g. Streamyard)

And more...

NGINX Server,

RTMP module� (Port: 1935)

Compute Engine

Title safe

Action safe

21 of 52

Architectural Diagram (Networking?)

Is it easy to use?

RTMP Stream�(e.g. Streamyard)

And more...

NGINX Server,

RTMP module� (Port: 1935)

Compute Engine

Cloud Network

Title safe

Action safe

22 of 52

Architectural Diagram (Containerization)

RTMP Stream�(e.g. Streamyard)

And more...

NGINX Server,

RTMP module (Port: 1935)�Container-Optimized OS

Compute Engine

Cloud Network

Container-Optimized OS

Title safe

Action safe

23 of 52

COS

Title safe

Action safe

24 of 52

Architectural Diagram (Containerization)

Where to build the image?

RTMP Stream�(e.g. Streamyard)

And more...

NGINX Server,

RTMP module (Port: 1935)�Container-Optimized OS

Compute Engine

Cloud Network

Container-Optimized OS

Container Registry

Image Registry

Title safe

Action safe

25 of 52

Architectural Diagram (CICD)

RTMP Stream�(e.g. Streamyard)

And more...

NGINX Server,

RTMP module (Port: 1935)�Container-Optimized OS

Compute Engine

Cloud Network

Container-Optimized OS

Container Registry

Image Registry

Cloud Build

CICD Pipeline

Title safe

Action safe

26 of 52

cloudbuild.yaml

Title safe

Action safe

27 of 52

Architectural Diagram (CICD)

What about secrets?

RTMP Stream�(e.g. Streamyard)

And more...

NGINX Server,

RTMP module (Port: 1935)�Container-Optimized OS

Compute Engine

Cloud Network

Container-Optimized OS

Container Registry

Image Registry

Cloud Build

CICD Pipeline

Title safe

Action safe

28 of 52

Architectural Diagram (Secrets?)

RTMP Stream�(e.g. Streamyard)

And more...

NGINX Server,

RTMP module (Port: 1935)�Container-Optimized OS

Compute Engine

Cloud Network

Container-Optimized OS

Container Registry

Image Registry

Cloud Build

CICD Pipeline

Secret Manager

Secret + config repository

Title safe

Action safe

29 of 52

Secret management

Title safe

Action safe

30 of 52

Architectural Diagram (Secrets)

What about access control?

RTMP Stream�(e.g. Streamyard)

And more...

NGINX Server,

RTMP module (Port: 1935)�Container-Optimized OS

Compute Engine

Cloud Network

Container-Optimized OS

Container Registry

Image Registry

Cloud Build

CICD Pipeline

Secret Manager

Secret + config repository

Title safe

Action safe

31 of 52

Architectural Diagram (Access Control)

Backing up the stream?

RTMP Stream�(e.g. Streamyard)

And more...

NGINX Server,

RTMP module (Port: 1953)�Container-Optimized OS

Compute Engine

Cloud Network

Container-Optimized OS

Container Registry

Image Registry

Cloud Build

CICD Pipeline

Secret Manager

Secret + config repository

Cloud IAM

Title safe

Action safe

32 of 52

Architectural Diagram (Backup)

RTMP Stream�(e.g. Streamyard)

And more...

NGINX Server,

RTMP module (Port: 1935)�Container-Optimized OS

Compute Engine

Cloud Network

Container-Optimized OS

Container Registry

Image Registry

Cloud Build

CICD Pipeline

Secret Manager

Secret + config repository

Cloud IAM

Backup video files

Cloud Storage

Title safe

Action safe

33 of 52

Cloud Storage Bucket

Title safe

Action safe

34 of 52

Architectural Diagram

RTMP Stream�(e.g. Streamyard)

And more...

NGINX Server,

RTMP module (Port: 1935)�Container-Optimized OS

Compute Engine

Cloud Network

Container-Optimized OS

Container Registry

Image Registry

Cloud Build

CICD Pipeline

Secret Manager

Secret + config repository

Cloud IAM

Backup video files

Cloud Storage

Title safe

Action safe

35 of 52

Are you sure it’s easy to set it up?

Title safe

Action safe

36 of 52

Architectural Diagram

RTMP Stream�(e.g. Streamyard)

And more...

NGINX Server,

RTMP module (Port: 1935)�Container-Optimized OS

Compute Engine

Cloud Network

Container-Optimized OS

Container Registry

Image Registry

Cloud Build

CICD Pipeline

Secret Manager

Secret + config repository

Cloud IAM

Backup video files

Cloud Storage

Deployment Manager

Title safe

Action safe

37 of 52

Deployment Config

Initialization Shell Script

Title safe

Action safe

38 of 52

Architectural Diagram

RTMP Stream�(e.g. Streamyard)

And more...

NGINX Server,

RTMP module (Port: 1935)�Container-Optimized OS

Compute Engine

Cloud Network

Container-Optimized OS

Container Registry

Image Registry

Cloud Build

CICD Pipeline

Secret Manager

Secret + config repository

Cloud IAM

Backup video files

Cloud Storage

Deployment Manager

Title safe

Action safe

39 of 52

End Result

Title safe

Action safe

40 of 52

Billing

Take note of your free quotas! - https://cloud.google.com/free

Title safe

Action safe

41 of 52

  • Cloud Monitoring
  • Speech to Text - Speech API

Compute Engine

Cloud Network

Container Registry

Cloud Build

Secret Manager

Cloud IAM

Cloud Storage

Deployment Manager

Container-Optimized OS

Hosting Solution

Network Solution

Access Control

Storage Solution

Developer Tools

Now

Future

Title safe

Action safe

42 of 52

Where do I start?

Title safe

Action safe

43 of 52

“Conference Submissions” with

Case study II

Title safe

Action safe

44 of 52

Problem Statement

Title safe

Action safe

45 of 52

Problem Statement

Needed a cheap and easy to setup “conference submission tool”

What we have:

  • Project code for running a web server

What we need:

  • Hosting environment
  • Database
  • (Optional) Containerize application

Title safe

Action safe

46 of 52

Architectural Diagram

Web Browsers

Cloud Run�(Serverless solution)�(Runs with Docker images)

Artifact Registry

Image Registry

Secret Manager

Secret + config repository

Cloud IAM

Cloud Run

Cloud SQL

Database

Title safe

Action safe

47 of 52

Title safe

Action safe

48 of 52

Time costs:

  • Test the functionality locally of the OSS (3 h) (25%)
  • Dockerize application (4 h) (33%)
  • Integrating email functionality on code side (1 h) (8.3%)
  • Fixing bugs (1 h) (8.3%)
  • Cloud Deployment (3 h) (25%)

Title safe

Action safe

49 of 52

Monetary costs (ignoring credits):

$2.09- 3.5 days

~ $18 - 30 days

Take note of your free quotas! - https://cloud.google.com/free

Title safe

Action safe

50 of 52

Take note of your free quotas! - https://cloud.google.com/free

Title safe

Action safe

51 of 52

References

Title safe

Action safe

Title safe

Action safe

52 of 52

medium.com/@weiyuan.liu

twitter - @weiyuan_lanegithub.com/Weiyuan-Lane

bit.ly/weiyuan-linkedin

Questions?

Title safe

Action safe

Title safe

Action safe