abandon all hardware intro to serverless · intro to serverless abandon all hardware. about me ......
TRANSCRIPT
INTRO TO SERVERLESS
ABANDON ALL HARDWARE
ABOUT ME
• Rhys Campbell
• Solution Architect @
• Interest in Web & Cloud
• No vested interest in products and services mentioned today
WHERE ARE WE GOING?
WHATS THE PROBLEM?
• Snow flake servers
• Shared VMs/ISOs
• Scripted VMs
• Scripted Containers
• … why?
Consistency leads to predictable results
ISSUES• Not our core business
• Not our competitive advantage • How much time are you spending on your ISO, Ansible, chef, puppet, docker ...stuff?
• How many lines of code are dedicated to this?
• Are we at least getting value add?
• Is your infrastructure allowing you 5 nines?
• Can you scale immediately?
• Do you pay for infrastructure when no customer are using it? Ie geographically focused
• Don't get me started on build servers.....
SOLUTION?
FUNCTIONS AS A SERVICE
FAAS
• IaaS => PaaS => SaaS
• Now FaaS
• Multiple providers
• Multiple languages
• Small blocks of code
• Event driven
• Pay per execution & resource utilisation
HOW TO CODEZ IN THE CLOUDZ?
WHAT IS REQUIRED
• A cohesive way of defining services
• Which resources constitute the service
• A simple manner of managing these in source control
• A means to effectively deploy the complete service
SERVERLESSTHE FRAMEWORK
GOALS
DEMO
In the next 15 mins, using a skeleton project from github we will:
• Create a new serverless service
• Deploy it
• Test it
• Have a serverless CI tool let us know that it is invalid
• Redeploy the fixed version and assert the changes are valid
CODE
HELLO WORLDS… SUCK
Code is not intended to show rich features
Highlighting iteration 0 is short, not that it is feature complete
Where the hell did Lamb CI come from?
• Just a cloud formation template
• Github (and Slack) tokens are required
NON FUNCTIONAL FEATURES
Crosscutting concerns can not be ignored
• Security - VPC bound resources
• Auth - AWS Cognito and Auth0
• Logging and Monitoring
• AWS Cloudwatch
• Preferably NewRelic
TESTING
• Seperate out your business code from the event handler
• Unit test the business code
• LocalStack to end to end test locally https://bitbucket.org/atlassian/localstack
• Just deploy your stack, test and tear it down!
HATE THE CLOUD?
• Checkout iron.io
• Picasso: a FaaS that can run on OpenStack
• Iron Functions
NOT READY?
• FaaS can be added to exiting applications to add seams, e.g.
• Replace a worker with a schedule FaaS
• Service proxies
• Non business critical backends
• Notifications systems
LINKS• https://github.com/lambci
• iron.io
• serverless.com
• https://newrelic.com/infrastructure
• auth0.com