SlideShare a Scribd company logo
1 of 77
Building a Serverless
Backend
Jacob Meacham
Director of Engineering, ClassPass
VP Engineering, Doppler Labs
Serverless is a MINDSET
Serverless is COMPUTE +
BUILDING BLOCKS
Why Did We Go
Serverless?
“The enemy of art is the absence of
limitations” - Orson Welles
Cognito
Audio Data Collection
Geotemporal
Engine
Deep Learning
Logs Analytics
Kinesis
How do we
Deploy, Monitor, & Debug?
How do we
Deploy, Monitor, & Debug?
Standard DevOps
rules don’t apply
How do we
Deploy, Monitor, & Debug?
Normal tools don’t work
out of the box
Standard DevOps
rules don’t apply
How do we
Deploy, Monitor, & Debug?
Normal tools don’t work
out of the box
Cloud-first makes good local
DevEx hard to achieve
Standard DevOps
rules don’t apply
Let’s make some
memes
Serverless Framework
Serverless is BUILDING
BLOCKS
serverless.com
arn:aws:sns:us-east-1:770772978315:static-
meme-topic???
A fully functional local AWS cloud
stack
Localstack
Local
LocalSt
ack
CI Staging Prod
Unit
Tests
LocalSt
ack
Unit
Tests
Integration
Tests
(406) 203-3961
TEXT
$ = Time x Memory x
Invocations
TEXT
(406) 203-3961
1000 ms
TEXT
(406) 203-3961
1000 ms x 20,000,000 requests
TEXT
(406) 203-3961
1000 ms x 20,000,000 requests x
$0.00000208*
*at a cost of $0.000000208/100ms
TEXT
(406) 203-3961
1000 ms x 20,000,000 requests x
$0.00000208*
*at a cost of $0.000000208/100ms
=
$38.81/mont
h
TEXT
(406) 203-3961
< 150 Lines of Code
TEXT
(406) 203-3961
Is our service
ready?
TEXT
(406) 203-3961
Is our service
ready?
TEXT
(406) 203-3961
…Kind of
Downsides
Still really new
TEXT
(406) 203-3961
Downsides
Still really new
Vendor lock in
TEXT
(406) 203-3961
Downsides
Still really new
Vendor lock in Moving Target
TEXT
(406) 203-3961
Downsides
Not suited for all applications
Still really new
Vendor lock in Moving Target
TEXT
(406) 203-3961
Serverless is a MINDSET
You can start TODAY
…and now you know (some of)
the PITFALLS
TEXT
(406) 203-3961
Questions?
TEXT
(406) 203-3961
What about logging?

More Related Content

Similar to BSDC 2018 Serverless Presentation

DCSF19 Transforming a 15+ Year Old Semiconductor Manufacturing Environment
DCSF19 Transforming a 15+ Year Old Semiconductor Manufacturing EnvironmentDCSF19 Transforming a 15+ Year Old Semiconductor Manufacturing Environment
DCSF19 Transforming a 15+ Year Old Semiconductor Manufacturing Environment
Docker, Inc.
 
OCCIware Project at EclipseCon France 2016, by Marc Dutoo, Open Wide
OCCIware Project at EclipseCon France 2016, by Marc Dutoo, Open WideOCCIware Project at EclipseCon France 2016, by Marc Dutoo, Open Wide
OCCIware Project at EclipseCon France 2016, by Marc Dutoo, Open Wide
OCCIware
 

Similar to BSDC 2018 Serverless Presentation (20)

DCSF19 Transforming a 15+ Year Old Semiconductor Manufacturing Environment
DCSF19 Transforming a 15+ Year Old Semiconductor Manufacturing EnvironmentDCSF19 Transforming a 15+ Year Old Semiconductor Manufacturing Environment
DCSF19 Transforming a 15+ Year Old Semiconductor Manufacturing Environment
 
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
 
DevOps and the C64: what's your excuse
DevOps and the C64: what's your excuseDevOps and the C64: what's your excuse
DevOps and the C64: what's your excuse
 
Jozua velle + silviu luca dev ops
Jozua velle + silviu luca   dev opsJozua velle + silviu luca   dev ops
Jozua velle + silviu luca dev ops
 
DevOps
DevOpsDevOps
DevOps
 
PHP Unconference Continuous Integration
PHP Unconference Continuous IntegrationPHP Unconference Continuous Integration
PHP Unconference Continuous Integration
 
NoSQL for SQL Server Developers using Couchbase
NoSQL for SQL Server Developers using CouchbaseNoSQL for SQL Server Developers using Couchbase
NoSQL for SQL Server Developers using Couchbase
 
My personal story from azure it pro to azure dev ops
My personal story from azure it pro to azure dev opsMy personal story from azure it pro to azure dev ops
My personal story from azure it pro to azure dev ops
 
The Boss: A Petascale Database for Large-Scale Neuroscience, Powered by Serve...
The Boss: A Petascale Database for Large-Scale Neuroscience, Powered by Serve...The Boss: A Petascale Database for Large-Scale Neuroscience, Powered by Serve...
The Boss: A Petascale Database for Large-Scale Neuroscience, Powered by Serve...
 
Test Automation for Packaged Systems: Yes, You Can!
Test Automation for Packaged Systems: Yes, You Can!Test Automation for Packaged Systems: Yes, You Can!
Test Automation for Packaged Systems: Yes, You Can!
 
EclipseCon 2016 - OCCIware : one Cloud API to rule them all
EclipseCon 2016 - OCCIware : one Cloud API to rule them allEclipseCon 2016 - OCCIware : one Cloud API to rule them all
EclipseCon 2016 - OCCIware : one Cloud API to rule them all
 
OCCIware Project at EclipseCon France 2016, by Marc Dutoo, Open Wide
OCCIware Project at EclipseCon France 2016, by Marc Dutoo, Open WideOCCIware Project at EclipseCon France 2016, by Marc Dutoo, Open Wide
OCCIware Project at EclipseCon France 2016, by Marc Dutoo, Open Wide
 
50 Shades of DevOps
50 Shades of DevOps50 Shades of DevOps
50 Shades of DevOps
 
Automating Software Deployments with AWS CodeDeploy by Matthew Trescot, Manag...
Automating Software Deployments with AWS CodeDeploy by Matthew Trescot, Manag...Automating Software Deployments with AWS CodeDeploy by Matthew Trescot, Manag...
Automating Software Deployments with AWS CodeDeploy by Matthew Trescot, Manag...
 
You Too Can Be a Radio Host Or How We Scaled a .NET Startup And Had Fun Doing It
You Too Can Be a Radio Host Or How We Scaled a .NET Startup And Had Fun Doing ItYou Too Can Be a Radio Host Or How We Scaled a .NET Startup And Had Fun Doing It
You Too Can Be a Radio Host Or How We Scaled a .NET Startup And Had Fun Doing It
 
DevOps, Common use cases, Architectures, Best Practices
DevOps, Common use cases, Architectures, Best PracticesDevOps, Common use cases, Architectures, Best Practices
DevOps, Common use cases, Architectures, Best Practices
 
Skills Matter DevSecOps eXchange Forum 2022 - Software architecture in a DevO...
Skills Matter DevSecOps eXchange Forum 2022 - Software architecture in a DevO...Skills Matter DevSecOps eXchange Forum 2022 - Software architecture in a DevO...
Skills Matter DevSecOps eXchange Forum 2022 - Software architecture in a DevO...
 
JavaLand 2022 - Software architecture in a DevOps world
JavaLand 2022 - Software architecture in a DevOps worldJavaLand 2022 - Software architecture in a DevOps world
JavaLand 2022 - Software architecture in a DevOps world
 
David Lowe, Sr. Technical Director, EAi
David Lowe, Sr. Technical Director, EAiDavid Lowe, Sr. Technical Director, EAi
David Lowe, Sr. Technical Director, EAi
 
Scaling Continuous Integration Practices to Teams with Parallel Development
Scaling Continuous Integration Practices to Teams with Parallel DevelopmentScaling Continuous Integration Practices to Teams with Parallel Development
Scaling Continuous Integration Practices to Teams with Parallel Development
 

Recently uploaded

VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 

Recently uploaded (20)

VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 

BSDC 2018 Serverless Presentation

Editor's Notes

  1. Goal is to turn this into this
  2. born and raised in Montana, recently returned Director of Engineering @ ClassPass VP Engineering @ Doppler ClassPass on servers, Doppler serverless, Palantir monolith Servers -> Serverless -> Servers gives me insight
  3. Not well-defined No servers, but really that’s a misnomer. There are servers. A mindset, change the level at which you think It's the attempt to free yourself from having to think as much about things like: Infrastructure, Scaling, Availability. Focus on writing the most important software to delight users
  4. Another lens Glue building blocks together with compute/Functions as a service AWS Lambda Building blocks are created by others, your mindset is about focusing on the important software Building blocks implies event-driven, because you don’t control them Lambda is the computation part of it, running code on events, HTTP requests, db, AND queues among others Offload everything. Lots of smart people have worked on problems for a long time; leverage their expertise
  5. AWS is not the only one in this space. There are definitely lots of others
  6. Constraints: Monetary, People, had other hard problems (ML), Didn’t have the expertise to think about uptime OR scaling infrastructure Really successful in a lot of ways. Had to pitch hard. Never went down We spent ~1/100th what we would have need to with a standard micro services architecture
  7. 38:00 Still, pretty complex! Lots of moving parts A central messaging queue Everything glued together with Lambdas Don’t build what you don’t have to (Cognito, Dynamo and S3, AND Elasticsearch) It wasn’t all perfect though. We ran into lots of issues along the way
  8. At Doppler, we adopted Serverless really early, back in 2015. It was a wild west! As we built our infrastructure out, found limitations in things that we just took for granted when working with servers. We had to build some of our own tools to fix them For example:
  9. You might ask: How do we deploy? What does deploy mean? With servers, it’s obvious - is a new server running? With a slew of lambdas, how do you version them across time? Throw out the DevOps rule books, they don’t apply No guideposts
  10. Our normal monitoring tools, Papertrail or Loggly, NewRelic or DataDog are all built for servers Your servers might not go down, but stuff can still go wrong!
  11. Because we’re outsourcing so much work, we have a Cloud-first model. what does it even mean to have a dev environment on your local machine? Can you work offline? Can you set breakpoints? Some of the issues we encountered
  12. Build our own serverless service, using the lessons learned to ground us lets users text captions and then we’ll text back a meme with that caption
  13. Our architecture Users send to Twilio, Twilio send to API Gateway Invoke Lambda that puts request on queue and returns Lambda that reads events off of queue, generates a meme and uploads it to S3 Sends that URL back to Twilio, which will text the user Event-driven already!
  14. First serverless function. logs, returns with a status code and a body Now what though? I upload a zip file of code to an S3 bucket, I create a Lambda function that calls that code, I hand-craft an API Gateway definition to call into that, I hope I didn't make a mistake How do I keep track of even this one function, let alone dozens? There’s a better way
  15. Now, frameworks. We’ll use Serverless Framework (like @ Doppler) Lets us define functions, events, infrastructure all in one place atomically. Open source, actively maintained, supports different vendors, different languages Lots of community plugins! Many problems solved
  16. This is the serverless framework definition, serverless.yml Define service Provider (where/what/defaults) Functions (the functions that we’ve defined and how they’re triggered)
  17. Same first function Let’s get this thing onto the cloud! (Next slide)
  18. Going to deploy our function using the serverless framework CLI, sls This packages up our code, creates an AWS stack and wires everything together And we see that we’ve deployed one function, helloServerless to us-east
  19. Let’s invoke that function Return is what we expect
  20. Let’s look at our logs. Has what we expect See how long it took and how much memory it took. Something fishy here. To test this, I had to deploy it to the cloud. Something we hit at Doppler. Let’s fix that and build the first portion of our service
  21. 28:00 So, we now have a Lambda that’s invokable. Let’s invoke it via HTTP, which is what Twilio will eventually do
  22. Add event to our function. Path meme, a GET
  23. So let’s use the event variable passed in to us via Lambda. What we want to do is log out the meme text that is passed in as a query param I don’t totally remember how to access query parameters, so we’ll stub this out for now Instead of looking at docs or deploying and looking at logs to figure this out, let’s run locally
  24. we’re going to add a plugin (easy to do) Adding serverless-offline, gives you a local web server to invoke lambdas with
  25. We can even debug this! I’ve set up VSCode to debug using the Serverless CLI Add breakpoint Listening on localhost at 3000 See that our function is trigger by an http event
  26. Let’s execute that in the browser
  27. Hit our breakpoint! Let’s look at event. Ahh that’s right, it’s in event.queryStringParameters
  28. Let’s now fix our function to use that information. We’ll read from the queryStringParameters when replying
  29. We’re going to debug again and hit the local URL Give it a query parameter And we see it here. That’s really cool! We’re debugging the same code that will run in the cloud
  30. Finally, let’s let the function run What we see is that, sure enough, our query parameter shows up So, we’ve solved one problem for the time being, which is debugging locally. big issue averted because having to deploy and not step through code makes the test->fix cycle very slow
  31. Let’s tackle the next part of our service Our createMeme lambda should put some data on a queue And a lambda responsible for sending memes should pull off of that queue
  32. I added some code to our createMeme function to send the message We’re now using a POST instead of a GET, and we receive text of the message, who from, who to We now need to define sendMeme
  33. First, we’ll add the function in our serverless.yml sns event Using a pre-created SNS Topic SNS is Simple Notification Service, and Lambdas can be woken by these notifications
  34. Alright, let’s add some code to our sendMeme function Code to read the messages from SQS And just print out a TODO
  35. Alright, we’ll deploy again using sls deploy Get an endpoint back from AWS
  36. We’ll post some data to that endpoint using curl My data.json has some fake data
  37. Ran this verbosely, so we get a lot of cruft But we see that we received a 200 back What should have happened is that createMeme was invoked, added to the queue and returned Then, sendMeme was invoked. Did this happen? Let’s check the logs to see
  38. We’ll check the sendMeme logs Shows up! Now, I’ve tried to sneak something by you that you may have noticed. It’s a long string
  39. What the heck is this? I made the SQS queue and SNS topic ahead of time Hard coded, no longer testable fully locally
  40. Luckily, Localstack A fully functional local AWS cloud stack Didn’t exist at Doppler, had to cobble stuff together Using localstack, we’ll regain the ability to debug offline again while working on the next part of the service
  41. sendMeme is getting called, needs to generate the meme and upload to S3 Ideally without so much hardcoding!
  42. Add 2 new plugins serverless-plugin-deploy-environment, sls-offline-sns 1st lets us define environments and refer to variables at deploy time or run time With the aid of serverless, let’s us spin up new resources programmatically! 2nd lets a localstack SNS topic trigger offline lambdas (Look at some new files added by the deploy-environment plugin)
  43. These variables are around at deploy time 3 different environments Bucket names Also set up dummies for local and resources that will be built for develop/production
  44. Passed into the lambda at runtime Defaults for accessing our resources But also endpoints for Localstack (there is a plugin for this so you don’t have to do it manually)
  45. We’ll do two things now. 1st, add generateAndUpload with the text and S3 bucket Log out the media URL (2nd replace our hard-coded strings with the ones passed in to the environment at runtime)
  46. 2nd replace our hard-coded strings with the ones passed in to the environment at runtime (Next Slide: We’ll also have to change the hardcoded topic in serverless.yml)
  47. We’ll also have to change the hardcoded topic in serverless.yml Nothing hardcoded now
  48. Let’s try debugging again. Add a breakpoint to sendMeme
  49. Post some data to our local listener
  50. Our breakpoint gets hit! And a meme is generated. Notice that the URL is local
  51. Let’s go download it and get a preview of what our first meme looks like Neat! Even more cool - let’s now deploy and see the same thing running in our develop environment
  52. Deploy as usual, but add stage, which for us is the environment name Done! Notice how our url now has the environment backed right in
  53. Grab that and hit it again Succeeds, now we’ve hit this function in the cloud
  54. Now we’ll look at the cloud logs for sendMeme And it read off the queue! We’ll grab this URL, which is an S3 URL (and download the file, we have a second meme)
  55. Paste the url into chrome to download
  56. Download the file, and we have a second meme Same code, no changes, deployed locally and in the cloud!
  57. 15:00 Clear CD pipeline No Localstack at Doppler, but similar integration tests run directly against staging If all pass, deploy automatically to prod
  58. Now that our meme is generated, need to send that URL and the number to Twilio, who will text it to the user Also need to have Twilio call our API
  59. Not much code necessary to make this happen Also added a Twilio webhook that hits our Lambda endpoint (in their UI) We’re done, so…
  60. Before this, I deployed to the production environment. This is live. Text the number Splits on period for top + bottom I’ll leave the number on the rest of the slides
  61. While everyone is generating memes, let’s talk about cost This is the cost formula
  62. We have 2 lambdas, each of which take ~1000ms
  63. Let’s say 20M requests/10M memes
  64. At the current really small rate AWS charges per 1000ms
  65. <$40. This isn’t all in, we’ll have a bit of spend on S3 and SQS, but not a ton Really Twilio is what bites us Even cooler. 100MM memes? $400. 1MM memes? $4. Infinitely scalable
  66. I hid a bit of library code away to keep the code we wrote simpler, but even added in, this entire service is <150 lines of code!
  67. Security/Authz/Authn Alerting/pagerduty integration (serverless-plugin-aws-alerts) Secrets (deploy-environment supports credstash) We’re missing some key components, but also have environments, local dev experience, effortless scaling We get a B- right now, wouldn’t take much to get to an A+
  68. 3:30 Serverless is still really new, so lots of tools just don’t exist or aren’t as good yet, people don’t support it or know it when hiring, etc (Often you become pretty locked in, because of how much you’re relying on)
  69. Often you become pretty locked in, because of how much you’re relying on (Moving target, things are changing and you have less control)
  70. Moving target, things are changing and you have less control (Long running services, services with lots of state, services that require specific memory, security, or execution time guarantees)
  71. Long running services, services with lots of state, services that require specific memory, security, or execution time guarantees. And cold starts, if you always need the same response time
  72. Final thoughts We put together a pretty compelling service in less than 45 minutes. That’s awesome! 3 takeaways: Serverless is a mindset It's possible to build a serverless service starting today and there are huge benefits ...There are pitfalls too, and we've walked through some of the things to be careful with.
  73. What about logging? tailing the logs is ok if we’re looking at just a single function. Not good in a system What are logs? Well, they’re streams of data output by our lambda Streams? Serverless! lambda -> Cloudwatch Logs -> triggered lambda -> wherever @ Doppler, we used Sumologic, there’s a plugin for that Not going to write code for this, let’s look at the last part of our service