IO 2019 Firebase and Cloud

IO 2019 Firebase and Cloud

923237754890d536819892ad42451555?s=128

sakajunquality

May 25, 2019
Tweet

Transcript

  1. I/O 2019 Firebase and Cloud FJUG Osaka #3 #io19jp 19.05.26

    @sakajunquality
  2. Agenda - What’s new in Firebase - Firebase Serverless Computing

  3. Who am I? - @sakajunquality - Google Developers Expert for

    Cloud - SRE at Ubie inc.
  4. What’s new in Firebase

  5. What's New in Firebase (Google I/O'19) https://www.youtube.com/watch?v=x8qTEMkZCPs

  6. What’s new in Firebase? #io19 - ML Kit - Object

    Detection && Tracking API - Translation API - AutoML Vision Edge - Crashlytics - BigQuery - Firestore - Collection Group Query
  7. What’s new in Firebase? #io19 - Cloud Functions - Schedule

    - Local Emulator - Performance Monitoring - Web - BigQuery - ...
  8. https://firebase.googleblog.com/2019/05/whats-new- Google-IO-2019.html

  9. Firebase Serverless Computing

  10. GCP Serverless Computing - Cloud Functions - App Engine -

    Cloud Run Cloud Functions App Engine Cloud Run New
  11. Firebase Serverless Computing - Cloud Functions - - Cloud Run

    Cloud Functions Cloud Run New
  12. Cloud Functions - Deploy a function - Handle Request /

    Events - Request and Response HTTPS - Events from Cloud
  13. Cloud Functions Example func Hello(ctx context.Context, m PubSubMessage) error {

    log.Println(string(m.Data)) // Your Logic Here... return nil }
  14. Cloud Functions New - Scheduler - Local Emulator

  15. Scheduler - Cloud Functions New - Schedule a function like

    cron - https://firebase.googleblog.com/2019/04/schedule-clo ud-functions-firebase-cron.html
  16. Emulator - Cloud Functions New - Local Emulator - https://firebase.google.com/docs/functions/local-emul

    ator
  17. Cloud Run - Deploy a container image - Listen $PORT

    - Request and Response HTTPS
  18. Cloud Run - Managed Endpoint w/ SSL Termination - 5

    min Timeout* Firebase - ~2GB RAM - 0 to 1000 instances scale - 1-80 concurrent requests - Pay for CPU and memory @100ms + Network Transfer
  19. Cloud Run Example: app package main import ( "fmt" "log"

    "net/http" "os" ) func handler(w http.ResponseWriter, r *http.Request) { fmt. Fprintf(w, os.Getenv("HELLO_MESSAGE" )) } func main() { http. HandleFunc ("/", handler) log. Fatal(http.ListenAndServe (":8080", nil)) }
  20. Cloud Run Example: Dockerfile FROM golang:1.12-alpine as build RUN apk

    add alpine-sdk WORKDIR $GOPATH/src/github.com/sakajunquality/hello COPY . . RUN go get -d -v ./... RUN go install -v ./... FROM alpine RUN apk add --no-cache ca-certificates COPY --from=build /go/bin/hello /usr/local/bin/hello
  21. Differences? https://firebase.google.com/docs/hosting/serverless-overview

  22. Where Should I Run My Code? Choosing From 5+ Compute

    Options (Cloud Next '19) https://www.youtube.com/watch?v=wzPmgWJ5fpU
  23. Fastly Integration - All of them are covered with Fastly

    CDN - Cache can be control by HTTP headers
  24. Thankyou