Upgrade to Pro — share decks privately, control downloads, hide ads and more …

IO 2019 Firebase and Cloud

IO 2019 Firebase and Cloud

Avatar for sakajunquality

sakajunquality

May 25, 2019
Tweet

More Decks by sakajunquality

Other Decks in Technology

Transcript

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

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

    - Local Emulator - Performance Monitoring - Web - BigQuery - ...
  3. GCP Serverless Computing - Cloud Functions - App Engine -

    Cloud Run Cloud Functions App Engine Cloud Run New
  4. Cloud Functions - Deploy a function - Handle Request /

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

    log.Println(string(m.Data)) // Your Logic Here... return nil }
  6. Scheduler - Cloud Functions New - Schedule a function like

    cron - https://firebase.googleblog.com/2019/04/schedule-clo ud-functions-firebase-cron.html
  7. 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
  8. 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)) }
  9. 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
  10. Where Should I Run My Code? Choosing From 5+ Compute

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

    CDN - Cache can be control by HTTP headers