Building a serverless app
-
Upload
vinay-krishna -
Category
Technology
-
view
75 -
download
0
Transcript of Building a serverless app
Building a Serverless AppVinay Krishna
Pre-cloud daysWhen developer’s life was easy only code was complex Really?
Development
ClientDatabase
Server(App logic)
Not only Development – What about Deployment• We also need to think a lot about
• Servers
• Budget / Cost
• Deployment time
• Scale
• Migration
• Maintenance
• Connectivity
• Availability
Later• As demand grows, it became more complicated
• Many servers
• Providing racks, power, Internet access and other key resources.
• Dealing with provisioning, clustering, and maintaining servers required spending:
• Lots of money (capital expenditures, power, internet, cooling, security)
• Tons of time and detailed planning (contingency, develop/test/produce, site growth, and so on)
http://docplayer.net/docs-images/24/2575088/images/3-0.png
The shift to Cloud daysNo worry on servers, manage infrastructure on demand
http://docplayer.net/docs-images/24/2575088/images/3-0.png
What does it mean?
• On demand service
• Cost reduction
• Scalability and Elasticity
• Easy Maintenance
• High Performance
• Multi-tenancy
• Reliability
• Resource pooling
Cloud – Seismic shift
• Provides an almost limitless supply of virtual machines
• With no upfront costs
• With just a bit of effort, developers can • fire up servers with their operating system of choice
• load in their applications (custom or open-source)
• and they’re off and running.
• Launching hundreds of servers and coordinating among them is a bit more work but it’s still far easier than it was just few years ago.
• Total cost of ownership of servers has fallen dramatically.
https://www.iron.io/wp-content/uploads/2012/10/eras_compute_units-300x114.png
Yet, Shift is not overOh really!! What’s left now?
https://d262ilb51hltx0.cloudfront.net/max/800/1*FXxFtLqfIQdMT2i6T5Og1w.png
Serverless – a game changer
VMsMachine as unit of scaleAbstracts the Hardware
ContainersApplications as the unit of scale
Abstracts the OS
ServerlessFunctions as the unit of scale
Abstracts the language runtime
I want to configure machines, storage, networking and my
OS
I want to run servers, configure applications
and control scaling
I want to run my code when it’s needed
Still, it needs server
• Serverless does not mean “No Server” required
• It means think less about servers• such as scalability, high-availability, infrastructure-security, and so forth
https://pbs.twimg.com/media/Cr1HEpnXgAAK9vV.jpg
Serverless
• Run code without provisioning or managing servers• Backend as a Service
• A model for providing web app and mobile app developers with a way to link their applications to backend cloud storage and APIs exposed by back end applications while also providing features such as user management, push notifications, and integration with social networking services.
• Function as a Service• Develop, run, and manage application functionalities without the complexity of building
and maintaining the infrastructure typically associated with developing and launching an app
Pay only for time your code runs
Scenarios
• Time based processing
• Event based activity / processing
• Serverless web application architectures
• Serverless mobile backends
• Real-time stream processing
• File Processing
• Data and Analytics
• Websites
• Mobile applications
• Problem
• Replicate one log from one data center to another
• Analyze the logs
• Take action
• Before Serverless
• Setup a VM/Container/WebJobs
• Build/Patch/Deploy
• Monitor
• Manage FTP cred
• Use FTP library
• Use cloud service SDK
• Using Serverless
• Setup a VM/Container/WebJobs
• Build/Patch/Deploy
• Monitor
• Manage FTP cred
• Use FTP library
• Use cloud service SDK
Hands-onLets try it now
Pre-requisites
• Create your AWS account
• Create pair or group
• Knowledge of Node.js / Python / Java
My first serverless application
• Write your “Hello participants!” serverless app
• Test the app
Link with AWS API
Monitor and MetricsCloudWatch and CloudTrail
What’s next…..
http://www.scuba-snorkeling-adventures.com/image-files/scuba-snorkeling-adventures.com-snorkelingdeep.jpg