techhub mobile app - iheavy.com · SERVERLESS ARCHITECTURE 1. User opens app 2. Request hits...

Post on 06-Aug-2020

4 views 0 download

Transcript of techhub mobile app - iheavy.com · SERVERLESS ARCHITECTURE 1. User opens app 2. Request hits...

MOBILE APP FOR ACME INC.by Sean Hull - Cloud Solutions Architect - sean@iheavy.com

ABOUT SEAN HULL

+1-917-442-3939

sean@iheavy.com

iheavy.com/blog

about.me/hullsean

github.com/hullsean

NEWSLETTER - SIGNUP!

iheavy.com/signup

cloud topics

startup focused

innovation inspired!

WHAT DO I DO?

Boutique Professional Services

Advisor, Fractional CTO

10+ years with startups

Devops + Data automation

AWS & GCP Clouds

Terraform + Ansible

Serverless Lambda, Python

MySQL, Postgres, Redshift

–Steve Jobs

“If you play it safe, no onewill ever know who you are.”

SHORT HISTORY OF HOSTING

90’s - on-premise server closet

00’s - managed hosting

10’s - cloud hosting, aws, gcp

Docker containers

Serverless functions

ON-PREMISE HOSTING

full control

need team of hardware experts

need equipment, backups

DATACENTER HOSTING

Professionally managed

Frees you to run your business

Still need operations team

Still slow to provision

CLOUD HOSTING

On-demand compute

Pay for what you use

Stop & save unused servers

Cost by the hour

Need operations team

DOCKER CONTAINERS

Supports microservices

Dockerfile defines server config

Need operations team

SERVERLESS - FUNCTIONS

Worry only about your code

Deploy directly to the cloud

Event-based

No operations team

20TH CENTURY POWER

Nicholas Carr, Edison, Google

Henry Burden -1850 to 1900

Before distributed power grid

Backoffice: waterwheel engineers

Replacement waterwheel parts!

Parallel today’s cloud computing

PRODUCT REQUIREMENTS

Upload images from Web

Image editing w text memes

Track popular phrases

Track top-10 by views

Monthly archiving

Scales easily + low cost

–Dwight D. Eisenhower

“Plans are nothing;planning is everything”

TRADITIONAL ARCHITECTURE

Many moving parts

Full control over servers

Customer managed

Customer patched

Customer monitored

CUSTOMER MANAGED SERVERS

Spinup instance

Install OS

Install packages

Manage dependencies

Manage updates

Monitor

Manage performance

–Adrian Cockroft, VP Cloud Architecture Strategy

“Remember that meltdown patch, and the need to patch all the hosts and containers, but nothing to patch

for Lambda?”

SERVERLESS ARCHITECTURE

1. User opens app

2. Request hits endpoint

3. User Login - cognito, auth0, okta, onelogin

4. Functions - upload, edit, albums, popular

5. Store user, image, text data

6. Store raw, edited & historical images

7. CDN - cache photos at edge

8. Separate AWS account for Meme app

9. CNAME entry acme.io -> endpoint

#2 API ENDPOINT

Paths to your functions

GET method

Post method

Put method

Patch, Delete

#3 USER LOGIN

Security assertion markup SAML

Auth0

Cognito

OneLogin

Active Directory Federated Svc

#4 SERVERLESS LAMBDA

Code in Python, nodejs, java, C#

Respond to events

S3, SNS, CF, API Gateway

IOT, Alexa, SES, SW, Kinesis

Log messages to CloudWatch

Use aliases & versions

#4 LAMBDA: HANDLER.JS

Code in Python, nodejs, java, C#

Respond to events

Log messages to CloudWatch

Use aliases & versions

#4 LAMBDA: BESTENDPOINT.JS

Modularize your business logic

Build unit tests for product code

Easier for testing locally

Supports code reuse

#4 LAMBDA: SERVERLESS.YML

Manifest defines your application

Outlines API gateway

Specifies functions

S3 buckets, Dynamodb tables

IAM users, etc

#4 SERVERLESS LIMITATIONS

Account wide API limits

Memory limits

Max 5 minutes runtime

More difficult to troubleshoot

How to test performance?

AWS X-Ray instrumentation

#5 DATASTORE - DYNAMODB

Configure table-by-table

store users & login info

store image names & paths

store text & meme data

#6 S3 STORAGE FOR IMAGES

object storage

original raw images

edited images

thumbnails

historical copies

lifecycle versions

#7 CLOUDFRONT CDN

Cache images at edge

Speedup user experience

Distribute globally

Integrates with app origin

Integrates with S3 origin

#9 ROUTE53 FOR DNS

Domain name services

Named after port 53

Add CNAME for your domain

References API Endpoint

THOUGHTS ON APP

What type of browsers are supported?

What type of formats need support?

Do we need multi-language support?

How do you measure active users?

THOUGHTS ON INFRA

Are your users global or in one region?

What uptime guarantees are required?

Can we lose images (user re-uploads)?

Ex: Instagram & Twitter lose comments sometimes

THOUGHTS ON TEAM

Will Acme Inc. support finished app?

Does Acme Inc. have devops expertise?

How about lambda & serverless?

Does Acme Inc know technology X?

Do you need to support multi-cloud?

ABOUT SEAN HULL

+1-917-442-3939

sean@iheavy.com

iheavy.com/blog

about.me/hullsean

github.com/hullsean

NEWSLETTER - SIGNUP!

iheavy.com/signup

cloud topics

startup focused

innovation inspired!