Google App Engine
今とこれから
@sinmetal
GCPUG Admin
Google Developers Expert
メルカリ / メルペイ ソリューションチーム
goo.gl/cWcDzQ
https://gcpug.jp
What is Google App Engine?
2
https://gcpug.jp
Google App Engineの特徴
3
https://gcpug.jp
2つのApp Engine
4
https://gcpug.jp
2つのApp Engine
5
https://gcpug.jp
App Engine Standard for Go, Hello World
6
package main
import (
"fmt"
"net/http"
"google.golang.org/appengine"
"google.golang.org/appengine/log"
)
func init() {
http.HandleFunc("/hello", handler)
}
func handler(w http.ResponseWriter, r *http.Request) {
c := appengine.NewContext(r)
log.Infof(c, "Hello %s", "world")
fmt.Fprint(w, "Hello, world!")
}
https://gcpug.jp
App Engine Standard for Go, Hello World
7
application: gaegohandson # change here
version: 1
runtime: go
api_version: go1
handlers:
- url: /.*
script: _go_app
https://gcpug.jp
App Engine Flex for Go, Hello World
8
package main
import (
"fmt"
"log"
"net/http"
)
func main() {
http.HandleFunc("/", handle)
http.HandleFunc("/_ah/health", healthCheckHandler)
log.Print("Listening on port 8080")
log.Fatal(http.ListenAndServe(":8080", nil))
}
func handle(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "Hello world!")
}
func healthCheckHandler(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "ok")
}
https://gcpug.jp
App Engine Flex for Go, Hello World
9
runtime: go
env: flex
automatic_scaling:
min_num_instances: 1
max_num_instances: 15
cool_down_period_sec: 180
cpu_utilization:
target_utilization: 0.6
https://gcpug.jp
Google App Engine for Standard Architecture
10
Google Datacenter
App Engine Services
Frontend
App Engine
Frontend
Static Server
Pending Request Queue
App Server
Datastore
Memcache
Task Queue
Search
URL Fetch
Socket
自分のDeployしたApplicationが動いている場所
https://gcpug.jp
Google App Engineの先進的な機能
11
https://gcpug.jp
Google App Engine for Standardの制約
12
https://gcpug.jp
Google App Engine for Standardの課題
13
https://gcpug.jp
Google App Engine
Next Generation
sinmetalの妄想を含んでいます!
https://gcpug.jp
https://gcpug.jp
Google App Engine Enviroment
Standard
Flex
Standard
Next Generation
16
Host OS
Borg
Host OS
Borg
VM
Docker
Host OS
gVisor
Container
ここにBorgはいるかも
https://gcpug.jp
Google App Engine Standard Next Generation
17
https://gcpug.jp
Google App Engine Standard Next Generation
18
https://gcpug.jp
Google App Engine Standard Next Generation
19
https://gcpug.jp
Google App Engine Standard Next Generation
20
https://gcpug.jp
Standard Next Generation VS Flex
21
https://gcpug.jp