43
Microservices Architecture for Content Management Systems using AWS Lambda and more https://2016. nyc.wordcamp.org Eugene Istrati, Technology Partner [email protected] www.mitocgroup.com

Microservices Architecture for Content Management Systems using AWS Lambda and more

Embed Size (px)

Citation preview

Page 1: Microservices Architecture for Content Management Systems using AWS Lambda and more

Microservices Architecturefor Content Management Systems

using AWS Lambda and more

https://2016.nyc.wordcamp.org

Eugene Istrati, Technology [email protected]

Page 2: Microservices Architecture for Content Management Systems using AWS Lambda and more

© 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Eugen Istrati, Partner @ Mitoc Group

Microservices Architecturefor Digital Platforms with AWS Lambda,

Amazon CloudFront, and Amazon DynamoDB

[email protected]

October 2015

ARC201

Page 3: Microservices Architecture for Content Management Systems using AWS Lambda and more

About

Eugene Istrati

[email protected]

• Partner @ Mitoc Group Inc

• 15+ years in IT; 7+ years on AWS

• AWS Certified Solutions Architect

• Companies: Hearst, Amazon, GrubHub, Tenaris (Europe)

Mitoc Group Inc

• www.mitocgroup.com

• Technology Company focusing on Innovative Enterprise Solutions

• AWS Technology Partner

• Featured AWS Lambda Partner

• Media and Entertainment Industry

Page 4: Microservices Architecture for Content Management Systems using AWS Lambda and more

Agenda• Reference Architecture

• Serverless Microservices

• Demo: todo.deep.mg

• Q&A

Page 5: Microservices Architecture for Content Management Systems using AWS Lambda and more

Demo: todo.deep.mg

• Inspired from open source• www.todomvc.com

• Go to the GitHub repository• github.com/MitocGroup/deep

-microservices-todomvc

• Follow the steps from Getting Started to build and deploy

• todo.deep.com

Page 6: Microservices Architecture for Content Management Systems using AWS Lambda and more

Agenda• Reference Architecture

• Serverless Microservices

• Demo: todo.deep.mg

• Q&A

Page 7: Microservices Architecture for Content Management Systems using AWS Lambda and more

Reference Architecture

Availability Zone A Availability Zone B

Auto Scaling Group

Auto Scaling Group

www.example.com

static.example.com

webservers

webservers

appservers

appservers

• Scales in minutes

Page 8: Microservices Architecture for Content Management Systems using AWS Lambda and more

Reference Architecture

Availability Zone A Availability Zone B

Auto Scaling Group

Auto Scaling Group

www.example.com

static.example.com

webservers

webservers

appservers

appservers

• Scales in minutes• Huge challenge for breaking

news, viral content, or attacks

Page 9: Microservices Architecture for Content Management Systems using AWS Lambda and more

Reference Architecture

Availability Zone A Availability Zone B

Auto Scaling Group

Auto Scaling Group

www.example.com

static.example.com

webservers

webservers

appservers

appservers

• Scales in minutes• Huge challenge for breaking

news, viral content, or attacks

• Reduced operational complexity

Page 10: Microservices Architecture for Content Management Systems using AWS Lambda and more

Reference Architecture

Availability Zone A Availability Zone B

Auto Scaling Group

Auto Scaling Group

www.example.com

static.example.com

webservers

webservers

appservers

appservers

• Scales in minutes• Huge challenge for breaking

news, viral content, or attacks

• Reduced operational complexity• Requires DevOps with experience

Page 11: Microservices Architecture for Content Management Systems using AWS Lambda and more

Reference Architecture

Availability Zone A Availability Zone B

Auto Scaling Group

Auto Scaling Group

www.example.com

static.example.com

webservers

webservers

appservers

appservers

• Scales in minutes• Huge challenge for breaking

news, viral content, or attacks

• Reduced operational complexity• Requires DevOps with experience

• Flexible choice of technology

Page 12: Microservices Architecture for Content Management Systems using AWS Lambda and more

Reference Architecture

Availability Zone A Availability Zone B

Auto Scaling Group

Auto Scaling Group

www.example.com

static.example.com

webservers

webservers

appservers

appservers

• Scales in minutes• Huge challenge for breaking

news, viral content, or attacks

• Reduced operational complexity• Requires DevOps with experience

• Flexible choice of technology• Requires devs with rich skill set

Page 13: Microservices Architecture for Content Management Systems using AWS Lambda and more

Reference Architecture

Availability Zone A Availability Zone B

Auto Scaling Group

Auto Scaling Group

www.example.com

static.example.com

webservers

webservers

appservers

appservers

• Scales in minutes• Huge challenge for breaking

news, viral content, or attacks

• Reduced operational complexity• Requires DevOps with experience

• Flexible choice of technology• Requires devs with rich skill set

• Cost-effective

Page 14: Microservices Architecture for Content Management Systems using AWS Lambda and more

Reference Architecture

Availability Zone A Availability Zone B

Auto Scaling Group

Auto Scaling Group

www.example.com

static.example.com

webservers

webservers

appservers

appservers

• Scales in minutes• Huge challenge for breaking

news, viral content, or attacks

• Reduced operational complexity• Requires DevOps with experience

• Flexible choice of technology• Requires devs with rich skill set

• Cost-effective• Over-provisioning and over-paying

Page 15: Microservices Architecture for Content Management Systems using AWS Lambda and more

Reference Architecture

Availability Zone A Availability Zone B

Auto Scaling Group

Auto Scaling Group

www.example.com

static.example.com

webservers

webservers

appservers

appservers

• Scales in minutes• Huge challenge for breaking

news, viral content, or attacks

• Reduced operational complexity• Requires DevOps with experience

• Flexible choice of technology• Requires devs with rich skill set

• Cost-effective• Over-provisioning and over-paying

Page 16: Microservices Architecture for Content Management Systems using AWS Lambda and more

AWS re:Invent 2014

Note: Credits and thanks are listed at the end of the presentation

Page 17: Microservices Architecture for Content Management Systems using AWS Lambda and more

AWS Summit NY 2015

Note: Credits and thanks are listed at the end of the presentation

Page 18: Microservices Architecture for Content Management Systems using AWS Lambda and more

Reference Architecture … Reinvented

Availability Zone A Availability Zone B

Auto Scaling Group

Auto Scaling Group

www.example.com

static.example.com

webservers

webservers

appservers

appservers

S3 bucket

CloudFrontdistributio

n

Web Tier

CognitoIdentity DB Tier

SQS DynamoDB

LambdaCloudFrontlogs

API Gateway

www.example.comstatic.example.com

App Tier

AWS Region RDS Aurora

Page 19: Microservices Architecture for Content Management Systems using AWS Lambda and more

Agenda• Reference Architecture

• Serverless Microservices

• Demo: todo.deep.mg

• Q&A

Page 20: Microservices Architecture for Content Management Systems using AWS Lambda and more

What does “serverless” mean?

Not involving a server; composed only of clients.http://www.wordsense.eu/serverless

Serverless doesn’t mean servers are no longer involved. It simply means that developers no longer have to think "that much" about them. Computing resources get used as services without having to manage around physical

capacities or limits.https://www.quora.com/What-is-Serverless-Computing

Page 21: Microservices Architecture for Content Management Systems using AWS Lambda and more

Serverless vs. Reference

Availability Zone A Availability Zone B

Auto Scaling Group

Auto Scaling Group

www.example.com

static.example.com

webservers

webservers

appservers

appservers

S3 bucket

CloudFrontdistributio

n

Web Tier

CognitoIdentity DB Tier

SQS DynamoDB

LambdaCloudFrontlogs

API Gateway

www.example.comstatic.example.com

App Tier

AWS Region RDS Aurora

vs

Page 22: Microservices Architecture for Content Management Systems using AWS Lambda and more

Serverless Architecture – Web Tier

S3 bucket

CloudFrontdistribution

Web Tier

CognitoIdentity

CloudFrontlogs

www.example.comstatic.example.com

Availability Zone A Availability Zone B

Auto Scaling Group

www.example.com

static.example.com

webservers

webservers

Page 23: Microservices Architecture for Content Management Systems using AWS Lambda and more

Serverless Architecture – Web Tier

S3 bucket

CloudFrontdistribution

Web Tier

CognitoIdentity

CloudFrontlogs

www.example.comstatic.example.com

• Static Assets• Same as in reference architecture• css, js, docs, images, videos + html

• Dynamic Functionality• Use JS framework (e.g. Angular)• SEO-friendly (Custom Error

Response + HTML5 History API)

• Completely Serverless• Pre-scaled• Low-cost• Low-maintenance

Page 24: Microservices Architecture for Content Management Systems using AWS Lambda and more

Serverless Architecture – Web Tier

S3 bucket

CloudFrontdistribution

Web Tier

CognitoIdentity

CloudFrontlogs

www.example.comstatic.example.com

• Static Assets• Same as in reference architecture• css, js, docs, images, videos + html

• Dynamic Functionality• Use JS framework (e.g. Angular)• SEO-friendly (Custom Error

Response + HTML5 History API)

• Completely Serverless• Pre-scaled• Low-cost• Low-maintenance

Page 25: Microservices Architecture for Content Management Systems using AWS Lambda and more

Serverless Architecture – Web Tier

S3 bucket

CloudFrontdistribution

Web Tier

CognitoIdentity

CloudFrontlogs

www.example.comstatic.example.com

• Static Assets• Same as in reference architecture• css, js, docs, images, videos + html

• Dynamic Functionality• Use JS framework (e.g. Angular)• SEO-friendly (Custom Error

Response + HTML5 History API)

• Completely Serverless• Pre-scaled• Low-cost• Low-maintenance

Page 26: Microservices Architecture for Content Management Systems using AWS Lambda and more

Serverless Architecture – App Tier

CognitoIdentity

SQS

Lambda

API Gateway

App Tier

Availability Zone A Availability Zone B

Auto Scaling Group

appservers

appservers

Page 27: Microservices Architecture for Content Management Systems using AWS Lambda and more

CognitoIdentity

SQS

Lambda

API Gateway

App Tier • Accelerated Backend• Write node.js functions and load

into Lambda• Power up Lambda with RESTful

endpoints on API Gateway• Cache, throttle, meter, version, etc.

• Completely Serverless• Pre-scaled• Low-cost• Low-maintenance

Serverless Architecture – App Tier

Page 28: Microservices Architecture for Content Management Systems using AWS Lambda and more

• Accelerated Backend• Write node.js functions and load

into Lambda• Power up Lambda with RESTful

endpoints on API Gateway• Cache, throttle, meter, version, etc.

• Completely Serverless• Pre-scaled• Low-cost• Low-maintenance

Serverless Architecture – App Tier

CognitoIdentity

SQS

Lambda

API Gateway

App Tier

Page 29: Microservices Architecture for Content Management Systems using AWS Lambda and more

Availability Zone A Availability Zone B

Serverless Architecture – DB TierDB Tier

SQS DynamoDB

RDS Aurora

Page 30: Microservices Architecture for Content Management Systems using AWS Lambda and more

DB Tier

SQS DynamoDB

RDS Aurora

Serverless Architecture – DB Tier• First choice – DynamoDB + SQS

• Schema-free• Scale only reads and writes

• Completely Serverless• Pre-scaled• Low-cost• Low-maintenance

• Next choice – RDS Aurora• Relational• MySQL-like approach, but 5x better

Page 31: Microservices Architecture for Content Management Systems using AWS Lambda and more

Serverless Architecture – DB Tier• First choice – DynamoDB + SQS

• Schema-free• Scale only reads and writes

• Completely Serverless• Pre-scaled• Low-cost• Low-maintenance

• Next choice – RDS Aurora• Relational• MySQL-like approach, but 5x better

DB Tier

SQS DynamoDB

RDS Aurora

Page 32: Microservices Architecture for Content Management Systems using AWS Lambda and more

Serverless Architecture – DB Tier• First choice – DynamoDB + SQS

• Schema-free• Scale only reads and writes

• Completely Serverless• Pre-scaled• Low-cost• Low-maintenance

• Next choice – RDS Aurora• Relational• MySQL-like approach, but 5x better

DB Tier

SQS DynamoDB

RDS Aurora

Page 33: Microservices Architecture for Content Management Systems using AWS Lambda and more

Lessons Learned

• Serverless approach is challengingly awesome

• Frontend is restricted to JS (and JS Frameworks)• Backend is restricted to Python, Java or JS (for now)• SOA and APIs are required by design

Page 34: Microservices Architecture for Content Management Systems using AWS Lambda and more

Lessons Learned

• Serverless approach is challengingly awesome

• Frontend is restricted to JS (and JS Frameworks)• Backend is restricted to Python, Java or JS (for now)• SOA and APIs are required by design

• Services must be as small as possible

• AWS Lambda constrains• Browser limitations (on mobile devices)

Page 35: Microservices Architecture for Content Management Systems using AWS Lambda and more

Lessons Learned

• Serverless approach is challengingly awesome

• Frontend is restricted to JS (and JS Frameworks)• Backend is restricted to Python, Java or JS (for now)• SOA and APIs are required by design

• Services must be as small as possible => microservices

• AWS Lambda constrains• Browser limitations (on mobile devices)

Page 36: Microservices Architecture for Content Management Systems using AWS Lambda and more

Google Trends: Microservices

Page 37: Microservices Architecture for Content Management Systems using AWS Lambda and more

What does “microservices” mean?

In computing, microservices is a software architecture style in which complex applications are composed of small, independent processes communicating with each other using language-agnostic APIs. These services are small, highly

decoupled and focus on doing a small task, facilitating a modular approach to system-

building.https://en.wikipedia.org/wiki/Microservices

Page 38: Microservices Architecture for Content Management Systems using AWS Lambda and more

WordPress on Microservices

?

Page 39: Microservices Architecture for Content Management Systems using AWS Lambda and more

Agenda• Reference Architecture

• Serverless Microservices

• Demo: todo.deep.mg

• Q&A

Page 40: Microservices Architecture for Content Management Systems using AWS Lambda and more

Demo: todo.deep.mg

• Inspired from open source• www.todomvc.com

• Go to the GitHub repository• github.com/MitocGroup/deep

-microservices-todomvc

• Follow the steps from Getting Started to build and deploy

• todo.deep.mg

Page 41: Microservices Architecture for Content Management Systems using AWS Lambda and more

Agenda• Reference Architecture

• Serverless Microservices

• Demo: todo.deep.mg

• Q&A

Page 42: Microservices Architecture for Content Management Systems using AWS Lambda and more

Q&A + Next Steps

github.com/MitocGroup medium.com/@[email protected]

Thanks: Winstina & Mark from WordCamp NYC

Hosting Team from United Nationshttps://2016.nyc.wordcamp.org

Page 43: Microservices Architecture for Content Management Systems using AWS Lambda and more

Credits and Thanks• Slide 19: AWS re:Invent 2014

• https://venturebeat.com/wp-content/uploads/2014/11/aws-reinvent-lambda.png

• Slide 20: AWS Summit NY 2015• https://d0.awsstatic.com/events/aws-hosted-events/2015/AWS-Global-Summit-Series/new-york/press-room/introducing-amazon-api-

gateway.jpg