KEMBAR78
Kotlin for backend using serverless + aws lambda | PPTX
Kotlin for backend using
Serverless + AWS Lambda
80/20 rule of why Kotlin
- Concise
80/20 rule of why Kotlin - Concise
80/20 rule of why Kotlin
- Concise
- Type safety
80/20 rule of why Kotlin
- Concise
- Type safety
- Great IDE support
80/20 rule of why Kotlin
- Concise
- Type safety
- Great IDE support
- Interoperability with Java
80/20 rule of why Kotlin
- Concise
- Type safety
- Great IDE support
- Interoperability with Java
- Minimal learning curve
80/20 rule of why Kotlin - Minimal learning curve
What is AWS Lambda
AWS Service that allows you to run code
without managing servers
source: https://www.einfochips.com/blog/serverless-architecture-the-future-of-software-architecture/
Why AWS Lambda
- Almost free
Why AWS Lambda
- Almost free
- Minimal learning curve
Why AWS Lambda
- Almost free
- Minimal learning curve
- Horizontal scaling by default
Why AWS Lambda - Horizontal scaling by default
Why AWS Lambda
- Almost free
- Minimal learning curve
- Horizontal scaling by default
- Allows you to focus on your code. No need to manage servers
What is Serverless
framework?
The Serverless Framework is a CLI tool that allows users to build & deploy auto-
scaling, pay-per-execution, event-driven functions.
Why Serverless?
- Cloud agnostic ( In theory)
- Fast set-up
Fast set-up
Fast set-up
Fast set-up
Why Serverless?
- Cloud agnostic ( In theory)
- Fast set-up
- Minimal learning curve
Why Serverless?
- Cloud agnostic ( In theory)
- Fast set-up
- Minimal learning curve
- Infrastructure code can be managed with your project
Cons AWS Lambda
- If you don’t want to be tied to AWS
- Package size limit of 50MB
- Has 300 seconds time-out. Not suitable for long running processes i.e image
processing, batch etc
- You have no control on how your application scale.
- Cold Startup issues. Can be fixed by
- having a keep-alive function
Cons AWS Lambda
Cons AWS Lambda
- If you don’t want to be tied to AWS
- Package size limit of 50MB
- Has 300 seconds time-out. Not suitable for long running processes i.e image
processing, batch etc
- You have no control on how your application scale.
- Cold Startup issues ( Specific to compiled runtime)
Cons Serverless
- As your project get bigger, initial deploy could take some time ( Anecdotal
evidence )
Lessons using AWS lambda and serverless
Warm up your functions. Lambda functions , specially those running in compiled
runtime have a tendency to have a slow start-up time ( cold start).
Solutions :
1. Use warmup plugin https://www.npmjs.com/package/serverless-plugin-
warmup
2. Use cloudwatch to ping your functions
Lessons using AWS lambda and serverless
AWS Cloudformation has a 200 resource limit.
Solution
1. use https://github.com/SC5/serverless-plugin-additional-stacks
2. Split your APIs to microservices
Questions
bertanasco@gmail.com
banasco@4impact.com.au
https://www.linkedin.com/in/bertanasco

Kotlin for backend using serverless + aws lambda

Editor's Notes

  • #3 https://www.reddit.com/r/ProgrammerHumor/comments/8ts8l9/me_rlang/
  • #20 Assuming you have JDK and node js set-up. It’s just a matter of installing serverless Running serverless create Configuring credentials Then doing a deploy Install severless Install serverless npm install -g serverless Create function serverless create —-template aws-kotlin-jvm-gradle --path FUNCTION_NAME Configure aws credentials serverless config credentials --provider aws --key YOUR_KEY --secret YOUR_SECRET Deploy ./gradlew deploy
  • #21 It would create the boiler plate code for you. Serverless.yml is where you manage your infrastracture An initial handler is created for you inside serverless/handler
  • #22 It would create the boiler plate code for you. Serverless.yml is where you manage your infrastracture An initial handler is created for you inside serverless/handler