startups without servers

Post on 13-Apr-2017

4.208 Views

Category:

Business

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Startups Without ServersDean Bryen - Solutions Architect - AWS

Shaun Pearce - VP of Engineering - Gousto

Priorities for Startups

3

Racing within a window of time

4

Focus is on solving a problem

5

Skills are in Development not Infrastructure

6

Over-Engineering vs Re-Engineering

7

Biggest fear is being a victim of your own success

The Evolution of Architecture

9

The Monolith

10

Micro Services

11

API Driven Development

The Evolution of Compute and Storage

13

Physical Servers / Disks / VM’s

14

Containers

15

Platform Level Services

Dean’s AWS London Loft Challenge

Build an image processing microservice that…..

Scales per request

Requires no deployment effort

Fault Tolerant

Has a RESTful API interface with a Web client

The Catch

NO Servers

NO Monolithic App or Explicit Web Service

NO Explicit code for scaling and fault tolerance

And do it within 45 minutes…

What Services Could we use?

Static Assets in Amazon S3

Internet scale HTTP/S based object store

Inerently Highly Available and Fault Tolerant

Designed for 11 9’s of Durability

Can host static websites

Holds trillions of objects

Serverless micro services with AWS Lambda

Event Driven Computing service

Never pay for idle

Scales per request

Supports Node.js and Java (or other JVM based languages)

Event triggers from other AWS Services

23 different ‘Power Levels’ of AWS Lambda

A RESTful API with Amazon API Gateway

Host multiple versions and stages of your API

Create and distribute API Keys to your developers

Throttle and Monitor API Calls

Cache Responses

Transform Data

Generate SDK’s (Including Swagger Support)

Interact directly with AWS Lambda

A NoSQL Data Store with Amazon DynamoDB

Managed noSQL Data Store

Can be either a Document or Key/Value store

Simply provision read and write throughput

Enables you to focuss on your data

DynamoDB streams enables you to take actions on events

Inherently Highly Available and Fault Tolerant

Putting it all together

The Service Itself

Static Site in S3

Web Client API Gateway Lambda Function + ImageMagic

Auto Deployment

Uploads new version to S3Developer AWS Lambda

Deployment functionUpdateFunction API Call

to AWS Lambda

Unit and Load Testing

HTTPS Invoke Function Image ProcessingFunction

Unit Test Function

Result Stored in DynamoDB

BONUS

BONUS

Let’s Get Building

First, the MicroService itself

Create the Image Processing Lambda Function

Static Site in S3

Web Client API Gateway Lambda Function + ImageMagic

Build the API

Static Site in S3

Web Client API Gateway Lambda Function + ImageMagic

Static site in S3

Static Site in S3

Web Client API Gateway Lambda Function + ImageMagic

Test out the Web Client

Static Site in S3

Web Client API Gateway Lambda Function + ImageMagic

Next, Set up Auto Deployment

Create the Deployment Function

Uploads new version to S3Developer AWS Lambda

Deployment functionUpdateFunction API Call

to AWS Lambda

Upload a new version to S3 to test

Uploads new version to S3Developer AWS Lambda

Deployment functionUpdateFunction API Call

to AWS Lambda

Summary and Next Steps

Summary

Utilise Platform Level Services that have built in HA

Use a microservices approach

Use a common interface for services such as RESTful APIs

Store static files in Amazon S3

Use AWS Lambda as the glue between AWS services

Next Steps

Sign up for an AWS Account

Try out a new server-less ervice

Make use of AWS Forums and Support

Come and meet an architect at the loft

Check out aws.amazon.com for more information

Lambda @ GoustoShaun Pearce

VP Engineering

About Gousto• We are an online recipe box service

offering customers the ability to choose up to 4 recipes for 2 or 4 people every week• We deliver all the ingredients you need

in exact proportions with step-by-step recipe cards.• No planning, no supermarkets and no

food waste – you just cook.• We’re a rapidly growing business, with a

diverse set of technology requirements.• Gousto’s tech team are responsible for

all consumer facing assets (Web, Mobile App) as well as backend ordering platforms and integrations into ERP, Warehouse Automation, Couriers etc

Gousto’s Platform (early 2015)

Web Site (PHP Laravel)

Business Logic(PHP Laravel)

Users

CMS Users

Data Scientists Reporting Read Replica

Production Database

Key Challenges• Large monolithic app covering a broad

set of responsibilities (e-commerce, payment processing, courier integration etc.)• Becoming more complex and difficult to

maintain over time (hard to upgrade)• Increased risk of change starting to slow

progress• A growing development team working on

a single code base – diminishing returns on tech investment• Concerns a single database will become

a performance bottleneck

REST

Roadmap to a Microservices Architecture

Web Site

API Gateway

Users

Recommendation API

(Lambda)Menu

Service (EC2)CustomerService . . .

RecommendationData

MenuData

CustomerData

. . .Data

CMS

CMS Users

Key Enhancements• Each area of concern is broken into a

separate, independent service• We use CloudFormation & Ansible to

heavily automate and standardise our microservice deployments• Where data can be easily extracted from

the existing schema a Lambda / DynamoDB implementation will be preferred• Where data remains relational these

services are being written in Node.js or PHP and deployed onto EC2

REST

Asynchronous Notifications Pattern

Customer Service

Amazon SNS Topic

Payment Service

Delivery Schedule Service

. . .

• Increase performance for customers• Reduce synchronous dependencies between services• Lower the impact of failure of any one service

I’ve changed address

Got it, thanks.<address change>

Subscribe to addr changes

Subscribe to addr changes

Subscribe to addr changes

Amazon SQS Queues

1

3

2

4

5

n

Thank You also… we’re recruiting shaun@gousto.co.uk

Thank YouDean Bryen - Solutions Architect - AWS

Shaun Pearce - VP of Engineering - Gousto

top related