auto-scalable rest apis with yawp! and google cloud

53
Auto-Scalable REST APIs with YAWP! and Google Cloud

Upload: fernando-ultremare

Post on 16-Apr-2017

200 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Auto-Scalable REST APIs with YAWP! and Google Cloud

Auto-Scalable REST APIs

with YAWP! and Google Cloud

Page 2: Auto-Scalable REST APIs with YAWP! and Google Cloud

Hello!• Full-stack developer since 1998

• Operations manager Dextra

• Creator of YAWP! Framework

• Google Cloud GDE

@feroult

Page 3: Auto-Scalable REST APIs with YAWP! and Google Cloud

You’ve got an idea!

Page 4: Auto-Scalable REST APIs with YAWP! and Google Cloud

It is an Mobile APP?

Page 5: Auto-Scalable REST APIs with YAWP! and Google Cloud

You just build it.

Page 6: Auto-Scalable REST APIs with YAWP! and Google Cloud

Beautiful, Shinning App

Page 7: Auto-Scalable REST APIs with YAWP! and Google Cloud

Your users LOVE IT

Page 8: Auto-Scalable REST APIs with YAWP! and Google Cloud

Now you just need to scale, and…

Page 9: Auto-Scalable REST APIs with YAWP! and Google Cloud

Let the money FLOW

Page 10: Auto-Scalable REST APIs with YAWP! and Google Cloud

But WAIT

Page 11: Auto-Scalable REST APIs with YAWP! and Google Cloud

You’ve got your backend from your buddy developer

Page 12: Auto-Scalable REST APIs with YAWP! and Google Cloud

Things start to get

Page 13: Auto-Scalable REST APIs with YAWP! and Google Cloud

Auto-Scalable APIs

Page 14: Auto-Scalable REST APIs with YAWP! and Google Cloud

A simple problem

Page 15: Auto-Scalable REST APIs with YAWP! and Google Cloud

The model

Post Like*

COUNT

Page 16: Auto-Scalable REST APIs with YAWP! and Google Cloud

not that simple

Page 17: Auto-Scalable REST APIs with YAWP! and Google Cloud
Page 18: Auto-Scalable REST APIs with YAWP! and Google Cloud
Page 19: Auto-Scalable REST APIs with YAWP! and Google Cloud

select post, sum(count) from likes group by post

Page 20: Auto-Scalable REST APIs with YAWP! and Google Cloud

A little bit of theory

Page 21: Auto-Scalable REST APIs with YAWP! and Google Cloud

Stateless

Sharding

Asynchronous

Automated

Page 22: Auto-Scalable REST APIs with YAWP! and Google Cloud

Stateless

Page 23: Auto-Scalable REST APIs with YAWP! and Google Cloud

No client affinity

Page 24: Auto-Scalable REST APIs with YAWP! and Google Cloud
Page 25: Auto-Scalable REST APIs with YAWP! and Google Cloud

Sharding

Page 26: Auto-Scalable REST APIs with YAWP! and Google Cloud

Sharding the database

• High-throughput for writes and reads

• Distributed instances

• Shard Key

• Replication

• No data joins across tables

Page 27: Auto-Scalable REST APIs with YAWP! and Google Cloud

The hard work

Page 28: Auto-Scalable REST APIs with YAWP! and Google Cloud

Sharding the database

POST /likes

Routing

Shard Key

replication

bye bye joins

shard groups

Page 29: Auto-Scalable REST APIs with YAWP! and Google Cloud

Eventual consistency

Page 30: Auto-Scalable REST APIs with YAWP! and Google Cloud

Eventual consistencyGET /likes?post=1

hot instances

eventual replication

Page 31: Auto-Scalable REST APIs with YAWP! and Google Cloud

Strong consistency

Page 32: Auto-Scalable REST APIs with YAWP! and Google Cloud

Strong consistency

GET /likes?post=1

hot instances

wait transactions

Page 33: Auto-Scalable REST APIs with YAWP! and Google Cloud

Asynchronous

Page 34: Auto-Scalable REST APIs with YAWP! and Google Cloud

Async flow your data to different outlets

Page 35: Auto-Scalable REST APIs with YAWP! and Google Cloud
Page 36: Auto-Scalable REST APIs with YAWP! and Google Cloud

Automated

Page 37: Auto-Scalable REST APIs with YAWP! and Google Cloud
Page 38: Auto-Scalable REST APIs with YAWP! and Google Cloud

Tools and Platforms

Page 39: Auto-Scalable REST APIs with YAWP! and Google Cloud

Stateless

Sharding

Asynchronous

Automated

Page 40: Auto-Scalable REST APIs with YAWP! and Google Cloud

YAWP! and Google Cloud

Page 41: Auto-Scalable REST APIs with YAWP! and Google Cloud

Google Cloud Platform

Page 42: Auto-Scalable REST APIs with YAWP! and Google Cloud

YAWP! Adds UP

Page 43: Auto-Scalable REST APIs with YAWP! and Google Cloud
Page 44: Auto-Scalable REST APIs with YAWP! and Google Cloud

not that simple

Page 45: Auto-Scalable REST APIs with YAWP! and Google Cloud
Page 46: Auto-Scalable REST APIs with YAWP! and Google Cloud
Page 47: Auto-Scalable REST APIs with YAWP! and Google Cloud

Pipes

Page 48: Auto-Scalable REST APIs with YAWP! and Google Cloud

Fork-Join Queues

Page 49: Auto-Scalable REST APIs with YAWP! and Google Cloud

Asynchronous pipelines

Like Post Author

POST /likes GET /posts GET /authors

Page 50: Auto-Scalable REST APIs with YAWP! and Google Cloud

Asynchronous pipelines

POST /likes

accumulators

Like Post

GET /posts

sequencing

Page 51: Auto-Scalable REST APIs with YAWP! and Google Cloud
Page 52: Auto-Scalable REST APIs with YAWP! and Google Cloud

Final Thoughts

Page 53: Auto-Scalable REST APIs with YAWP! and Google Cloud

Thanks!• Demo code

github.com/feroult/like-demo

• YAWP!yawp.io @feroult