cloudsolutionday 2016: docker & faas at getvero.com

30
TU HOANG Software Engineer / @rebyn / [email protected] Docker @ Vero Data Migration with Docker @ Vero CLOUD FUNCTIONS @ VERO

Upload: aws-vietnam-community

Post on 16-Apr-2017

132 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Cloudsolutionday 2016: Docker & FAAS at getvero.com

TU HOANGSoftware Engineer / @rebyn / [email protected]

Docker @ VeroData Migration with Docker @ Vero

CLOUD FUNCTIONS @ VERO

Page 2: Cloudsolutionday 2016: Docker & FAAS at getvero.com

@getveroAutomate customer interactions based on what your customers do, ie: fire welcome coupon campaign when● User signs up; and● Has at least an

outstanding item in cart for a week; and

● Has never received a coupon before.

+250 large consumer businesses use Vero daily:

Page 3: Cloudsolutionday 2016: Docker & FAAS at getvero.com

#CONTAINERS- Opinionated: EC2-Spot,

ECS, ELB, Logentries- 20+ kinds of workers- Memory spec ranging

from 302MB to 2048MB memory

- Anytime: 148 containers (across 80 instances)

- Autoscaled: +350

- Peak: 16 million emails/day

- Weekly volume: 32.2M 75.2M

- Track 20.000 46.296 customer actions/min (+1B +2B/mth)

- Software engineering: 6- DevOps-y engineers: 3

Scale @getvero (with changes since Nov 2015)

Page 4: Cloudsolutionday 2016: Docker & FAAS at getvero.com
Page 5: Cloudsolutionday 2016: Docker & FAAS at getvero.com
Page 6: Cloudsolutionday 2016: Docker & FAAS at getvero.com
Page 7: Cloudsolutionday 2016: Docker & FAAS at getvero.com
Page 8: Cloudsolutionday 2016: Docker & FAAS at getvero.com

Cloud Functions- Stateless compute containers- Ephemeral- Event-triggered- (AND/OR) Significantly depend on third-party

services

Page 9: Cloudsolutionday 2016: Docker & FAAS at getvero.com

Cloud Function 1/7: autoscaling

Page 10: Cloudsolutionday 2016: Docker & FAAS at getvero.com

Cloud Function 2/7: deliverability

Page 11: Cloudsolutionday 2016: Docker & FAAS at getvero.com

Cloud Function 2/7: deliverability

Page 12: Cloudsolutionday 2016: Docker & FAAS at getvero.com

Cloud Function 2/7: deliverability

Page 13: Cloudsolutionday 2016: Docker & FAAS at getvero.com

Cloud Function 2/7: deliverability

Page 14: Cloudsolutionday 2016: Docker & FAAS at getvero.com

Cloud Function 3/7: newsletter diagnosis

Page 15: Cloudsolutionday 2016: Docker & FAAS at getvero.com

Cloud Function 3/7: deployment

Page 16: Cloudsolutionday 2016: Docker & FAAS at getvero.com

@dustay ecs:deploy_by_image mailship:master

1. Check latest SHA’s pending status2. Check ongoing deployments (if any)

2a. YES: cancel | set a reminder2b. NO: DEPLOY AWAY

Cloud Function 3/7: deployment

Page 17: Cloudsolutionday 2016: Docker & FAAS at getvero.com

Cloud Function 3/7: deployment

Page 18: Cloudsolutionday 2016: Docker & FAAS at getvero.com

@dustay stats:low --threshold=50 | stats:refetch $newsletter_id

Triggershttps://bot.getvero.com:1234 /v1/triggers/UUID

HTTP

Chat commands

Page 19: Cloudsolutionday 2016: Docker & FAAS at getvero.com

- Amazon S3

- Amazon DynamoDB

- Amazon Kinesis Streams

- Amazon Simple Notification Service

- Amazon CloudWatch Logs

- Scheduled Events (powered by Amazon CloudWatch Events)

- Amazon API Gateway

- Other Event Sources: Invoking a Lambda Function On Demand

Trigger Options

Page 20: Cloudsolutionday 2016: Docker & FAAS at getvero.com

- Cloud agnostic (vanilla Docker)

- Navigate our setup of security firewalls (though not much desired since most services are public)

- Language agnostic (unified input/output)

Why we rolled out our own

cloud function service

Page 21: Cloudsolutionday 2016: Docker & FAAS at getvero.com

- Of course, it’s always better if someone else manages it

- Startup latency = used to be an issue (then we learnt how to autoscale and/or prewarm infra)

- Horizontal scaling = rough around edges (also applies to our services (micro/nano), not just functions)

- Testing was a pain

Why we ate up along the

way

Page 22: Cloudsolutionday 2016: Docker & FAAS at getvero.com

- Development friction = extremely minimal now

- Services are being created with confidence and scalability in mind despite small team

- 100% automation = within reach now

- Testing = microservice testing. Should bring about no changes.

- Matured autoscaling agent + spot fleet management = #BIGWIN for both functions and services

- See 75% cost reduction upon spot adoption

#WINS

Page 23: Cloudsolutionday 2016: Docker & FAAS at getvero.com

- Stack decomposing = trend forward. Start first with parts of a monolith that interact with external services significantly.

- We control scaling-up. This is equally crucial.

#WINS

Page 24: Cloudsolutionday 2016: Docker & FAAS at getvero.com

- Functions are being gradually treated as first class citizens

- We usually sit down and approach an issue re: can we narrow this business down to nano services / functions

Misc

Page 25: Cloudsolutionday 2016: Docker & FAAS at getvero.com

- Credentials should be loaded upon instance provisioning or container provisioning, not hardcoded into scripts

- Vendor lockin = a concern, though not pressing. IAM- and security group-based services = kept to minimum and has failover.

- Instrumentation = crucial.

- Request/response mapping templates = must. Shared library.

Gotchas

Page 26: Cloudsolutionday 2016: Docker & FAAS at getvero.com

Infrastructure Setup

Page 27: Cloudsolutionday 2016: Docker & FAAS at getvero.com

Infrastructure Setup

Page 28: Cloudsolutionday 2016: Docker & FAAS at getvero.com

Development Productivity

To quote Amazon:Focus on the code that mattersInnovate rapidlyReduce time to market/product

Continuous scaling

Page 29: Cloudsolutionday 2016: Docker & FAAS at getvero.com

DEPLOYMENT(I run out of time)

Page 30: Cloudsolutionday 2016: Docker & FAAS at getvero.com

https://www.getvero.com/careers(Senior Backend Engineers / Site Reliability Engineers

much needed!)

Thanks for tuning in.