Scalable applications are by nature resource intensive, expensive to build and difficult to manage. AWS, through the serverless computing initiative, is changing this perception. In this session, Eugene Istrati from Mitoc Group will show hands-on how they are using serverless building blocks like S3, CloudFront, API Gateway, Lambda, DynamoDB, SQS, Elasticache – and this is only the foundation. As official AWS Technology and AWS Lambda partners, Mitoc Group focuses mainly on building new applications or transforming existing applications that achieve high scalability, high availability, high performance without breaking your bank. At the end, Eugene will demo AdTechMedia.io, an innovative Advertising Technology for Media companies, built on top of serverless components from AWS.
Eugene Istrati has spent over 15 years as a technologist in a variety of industries, including digital media, cloud computing, and reputation marketing. Before joining Mitoc Group as Technology Partner, Eugene worked as Director of Engineering at Hearst Corporation and Program Manager at Amazon Web Services. He holds a dual Bachelor of Science degree in Mathematics and Computer Science and a Master of Science degree in Computer Science and Engineering.
4. Mitoc Group Inc
AWS Technology Partner
Werner Vogels, CTO @ Amazon.com
• on weekends, when you’re having
couple of drinks with friends
• on vacation, when you’re enjoying
quality time with entire family
5. Mitoc Group Inc
AWS Technology Partner
About
• Eugene Istrati
• eugene@mitocgroup.com
• 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
6. Mitoc Group Inc
AWS Technology Partner
Agenda
• Serverless Infrastructure
• Transform any Web App to use Serverless
• Microservices Architecture
• Micropayments Platform
• Q&A
7. Mitoc Group Inc
AWS Technology Partner
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 physical capacities or limits.
https://www.quora.com/What-is-Serverless-Computing
What is “Serverless”?
9. Mitoc Group Inc
AWS Technology Partner
AWS Serverless Options
Storage DatabaseNetwork
Compute Content DeliveryMessaging and QueuesSecurity
Gateways
User Management Monitoring & Logging
Internet of Things
Machine Learning
Streaming Analytics
10. Mitoc Group Inc
AWS Technology Partner
Do It Yourself on AWS
https://blog.mitocgroup.com/how-to-create-
serverless-environments-on-aws-8485ae039765
and
https://www.youtube.com/playlist?list=PLPGfD-
tGOl7sr6R9fZjNp3-qwWIxiShT5
11. Mitoc Group Inc
AWS Technology Partner
Agenda
• Serverless Infrastructure
• Transform any Web App to use Serverless
• Microservices Architecture
• Micropayments Platform
• Q&A
12. Mitoc Group Inc
AWS Technology Partner
Serverless Infrastructure
Availability Zone A Availability Zone B
Auto Scaling Group
Auto Scaling Group
www.example.com
static.example.com
web
servers
web
servers
app
servers
app
servers
S3 bucket
CloudFront
distribution
Web Tier
Cognito
Identity
DB Tier
SQS DynamoDB
LambdaCloudFront
logs
API Gateway
www.example.com
static.example.com
App Tier
AWS Region
RDS Aurora
13. Mitoc Group Inc
AWS Technology Partner
Serverless Infrastructure: Web Tier
S3 bucket
CloudFront
distribution
Web Tier
Cognito
Identity
CloudFront
logs
www.example.com
static.example.com
Availability Zone A Availability Zone B
Auto Scaling Group
www.example.com
static.example.com
web
servers
web
servers
14. Mitoc Group Inc
AWS Technology Partner
Serverless Infrastructure: Web Tier
S3 bucket
CloudFront
distribution
Web Tier
Cognito
Identity
CloudFront
logs
www.example.com
static.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
15. Mitoc Group Inc
AWS Technology Partner
Serverless Infrastructure: Web Tier
S3 bucket
CloudFront
distribution
Web Tier
Cognito
Identity
CloudFront
logs
www.example.com
static.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
16. Mitoc Group Inc
AWS Technology Partner
Serverless Infrastructure: Web Tier
S3 bucket
CloudFront
distribution
Web Tier
Cognito
Identity
CloudFront
logs
www.example.com
static.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
17. Mitoc Group Inc
AWS Technology Partner
Serverless Infrastructure: App Tier
Cognito
Identity
SQS
Lambda
API Gateway
App Tier
Availability Zone A Availability Zone B
Auto Scaling Group
app
servers
app
servers
18. Mitoc Group Inc
AWS Technology Partner
Cognito
Identity
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 Infrastructure: App Tier
19. Mitoc Group Inc
AWS Technology Partner
• 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 Infrastructure: App Tier
Cognito
Identity
SQS
Lambda
API Gateway
App Tier
20. Mitoc Group Inc
AWS Technology Partner
Availability Zone A Availability Zone B
Serverless Infrastructure: Data Tier
DB Tier
SQS DynamoDB
RDS Aurora
21. Mitoc Group Inc
AWS Technology Partner
DB Tier
SQS DynamoDB
RDS Aurora
Serverless Infrastructure: Data 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
22. Mitoc Group Inc
AWS Technology Partner
Serverless Infrastructure: Data 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
23. Mitoc Group Inc
AWS Technology Partner
Serverless Infrastructure: Data 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-compatible, but MUCH better
DB Tier
SQS DynamoDB
RDS Aurora
24. Mitoc Group Inc
AWS Technology Partner
Agenda
• Serverless Infrastructure
• Transform any Web App to use Serverless
• Microservices Architecture
• Micropayments Platform
• Q&A
25. Mitoc Group Inc
AWS Technology Partner
What are “Microservices”?
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
30. Mitoc Group Inc
AWS Technology Partner
Agenda
• Serverless Infrastructure
• Transform any Web App to use Serverless
• Microservices Architecture
• Micropayments Platform
• Q&A
31. Mitoc Group Inc
AWS Technology Partner
Q&A + Next Steps
github.com/MitocGroup blog.mitocgroup.com slideshare.net/MitocGroup
32. Mitoc Group Inc
AWS Technology Partner
Compute Evolved | AWS Loft Architecture Week
Thank You!
Special Thanks to Bryan & Leilani
from
Editor's Notes
The fundamental goal of every web application is to be up and running 24/7. But it’s a huge challenge to do it at scale. Failures can happen to anyone, even the big guys. No name calling today.
To quote Werner: Everything fails, all the time.
And my two cents: I don’t know about you guys, but in my experience, it usually doesn’t happen during business hours, when you are in front of your computer.
My name is Eugene Istrati. I’m the Technology Partner at Mitoc Group. Here are some credentials about myself and the company I represent. As AWS Technology Partners and featured AWS Lambda Partners, it is my please and honor to be here today to speak in front of you guys.
My goal today is to explain as much as I can serverless infrastructure, microservices architecture and show case some real life examples.
Let’s start with serverless concept. What does serverless mean? Intuitively, there should be something that involves “no servers”. Yes, to be precise, we as developers don’t need to deal with servers and all associated operations to keep them up and running at scale. Instead, we are getting abstracted services that are highly secure and highly available, pre-provisioned and pre-scaled.
But my favorite explanation is by Netflix former Chief Architect, Adrian Cockcroft: If your PaaS can efficiently start instances in 20ms that run for half a second, then call it serverless.
AWS offers a large variety of serverless options. To emphasize how big this is, please raise your hand and keep it up if you’re using Amazon S3. Now look around.
This is a blogpost and several how to videos that we’ve published last year on how to do it yourself serverless on AWS.
Let’s assume that we already have some experience working with serverless infrastructure. What’s next? We’ll take an existing web application and transform it using serverless computing. How can we do that?
There is no magic here. Let me show you how we did it for existing application running on AWS. I’ll describe it layer by layer.
First question, how can we transform the web tier into a serverless one? Most of us think of S3 as a storage service available over the Internet. We think of S3 as a cluster of web servers behind load balancers that have turned off server side scripting modules. It is secured through IAM and there is no need to worry about underlying infrastructure.
As we are doing this transformation, the static component stays exactly the same as in reference architecture. We load everything into S3: css, javascript, documents, images, videos. And even html, which usually is served by EC2.
Because S3 doesn’t allow server side scripting, we use client side languages like JavaScript to add dynamic functionality. Modern JavaScript frameworks like AngularJS caught up a lot lately to other popular web frameworks. They provide similar patterns and best practices like Symfony, or Django, or Rails. And they are very friendly with search engines, allowing indexing of both new applications and legacy applications.
But the biggest benefit – it is completely serverless. The infrastructure comes pre-scaled at AWS size, which is virtually infinite. I have heard some people saying quote: “You will reach your budget faster than AWS will reach its physical limits”. And the bigger it is, the better it gets and the lower it costs.
Now let’s see how we transformed our app tier into a serverless one. AWS Lambda can roughly be described a self-managed container service. It deploys code in milliseconds and executes code in seconds. Like in case of web tier, it is secured through IAM and there is no need to worry about underlying infrastructure.
Because of the way Lambda is designed, we get out of the box an accelerated backend that has short time to live. We are writing small functions, loading them into Lambda, and consuming them through API Gateway. It is also possible to call Lambda directly, but then you need to build by yourself caching and throttling, metering and versioning.
And like in case of web tier, it is completely serverless.
Last, but not the least, how do we transform the data tier into a serverless one? We encourage all of us to use DynamoDB because the only operations you care about are reads per second and writes per second. And like in case of both web tier and app tier, it is secured through IAM and there is no need to worry about underlying infrastructure.
DynamoDB is an amazing schema-less key-value database like MongoDB. We only increase or decrease, reads or writes, independently from each other. But at scale, by itself, DynamoDB could be cost intensive. That is why we virtually put SQS in front of DynamoDB and store datasets into the queue that gets asynchronously saved into the database. Apparently, this “eventual consistency” pattern saved Shazam 50% of their database cost.
And again, guess what? It is completely serverless.
But if you are for some reason coupled to relational databases, you can choose RDS Aurora. It is a MySQL like database, cloud native and scales seamlessly.
Now, we have a lot to digest around serverless concept, so why do we need another concept, like microservices?
To understand why, let’s see what does microservices mean. In a nutshell, it is an architectural pattern that can be applied almost anywhere, either we are talking about infrastructure, or platform, or application. Think of it like a shredder for software, that makes from complex into simple and from difficult into easy. If it’s software driven, it could be designed as microservices.
Microservices architecture is the new trend that makes all of us really curious and very excited. That is why it’s so surprising that 2 years ago microservices as a term almost didn’t exist, according to Google Trends.
Now, I would like to switch to the first demo of the day and show you some serverless microservices in action.
To emphasize even further how we are leveraging serverless infrastructure and microservices architecture, I would like to talk about our own experiment, a micropayments platform called AdTechMedia.
AdTechMedia is innovative advertising technology for media companies. It aims to empower publishers and content providers to monetize their content through complimentary revenue streams like native micropayments.
And this concludes my presentation for today.
As a next step, I invite you to checkout our Github and Slideshare, as well as read our blog powered by Medium.com.