SlideShare a Scribd company logo
Increasing velocity via
serverless semantics
Kfir Bloch
kfirb@wix.com @kfirondev
The path to productivity in Microservices ecosystem
● Developer 20 years
● Cook Since I remember myself
● Photographer 1 year
● Manager 15 years
This is me
Just a normal result driven developer
By the end of this talk you will
Think more about productivity
Get more ideas about speeding up velocity
Hopefully will adopt serverless semantics
The scale we are currently facing
~1000
Microservices
~700
Developers
Our Microservices stack
~1000
Microservices
~700
Developers
In order to have many Microservices
by many teams you need to
standardize the infra
Productivity Libraries
Kafka
Abstraction
RPC server RPC client Configuration
Logging HTTP controllers Secret keys Auth & cookies
Containers Caching policy BI reporting ORM support
And many more...
Supporting web tools
And many more...
Deployment settings portal Build settings portal
...and some “non-functional”
Health tests Monitoring Metrics
Graceful
shutdown
Headers
propagation
Error handling Security Plugins support
It worked for us!
It worked for us!
But not good enough!
Too much
boilerplate
Too much
boilerplate
.eslintrc
package.json
.gitignore
Dockerfile
webpack
.jshintrc
.npmignore
.nvmrc
.babelrc
Package.json
hell
“Too much
information”
abstraction
bootstrap(opts)
.use(require('@wix/wix-bootstrap-bi'))
.use(require('@wix/wix-bootstrap-require-login'))
.use(require('@wix/wix-bootstrap-grpc'))
.use(require('@wix/wix-bootstrap-api-gw-client'))
.config('./lib/config')
.express('./lib/express-app')
.express('./lib/express-errors')
.express('./lib/express-health')
.start();
Infra developer is
the worst person to
define abstraction
Rule #1
Infra developer is
the worst person to
define abstraction
The only person
that can define
great abstraction is
the developer that
uses the library
Rule #1
So let’s generate the code based
on wizard with questions!
Yeoman to the rescue
Yoshi tool
Still not good enough...
▪ Code generation does not get new updates
▪ Runtime injected in compile time
▪ We generate the code with the problem instead of hiding the problem
▪ Code generate still has maintenance cost
▪ Project got bigger, it is hard know know what it does because of the code generation
The secret of
productivity
library that no
one tells you
Productivity library is what makes you
productive in the beginning
Then it becomes frameworks
with 40 pages docs...
Check your productivity library and you’ll find out
that 80% of the projects uses only 20% of the
features
Rule #2
▪ Still need to use/know so many tools
▪ Microservice tend to become
mini-monolith
▪ “distributed monolith” due to
compile time wiring of the runtime
▪ Slow onboarding
▪ Runtime as a service
▪ Simplify deployment & configuration
▪ Let developer focus on the logic
▪ Simple API
▪ 20% of the interfaces from the
productivity libraries to support 80%
of the applications
▪ Still need to use/know so many tools
▪ Microservice tend to become
mini-monolith
▪ “distributed monolith” due to compile
time wiring of the runtime
▪ Slow onboarding
So we need
▪ Runtime as a service
▪ Simplify deployment & configuration
▪ Let developer focus on the logic
▪ Simple API
▪ 20% of the interfaces from the
productivity libraries to support 80%
of the applications
▪ Still need to use/know so many tools
▪ Microservice tend to become
mini-monolith
▪ “distributed monolith” due to compile
time wiring of the runtime
▪ Slow onboarding
So we need
Serverless to the rescue
Also takes us to better engineering
1. Passes the tests
2. Reveals intention
3. No duplication
4. Small parts
Kent Beck’s Four Rules of Software Design AKA “Simple Design”
The fundamental
of software
engineering
If you have complex
problem, you should
break it to smaller
mini problems
Real life metaphor - fine granular approach
Action: Clean the house
Test: is the house clean
Action: wipe the dust
Test: do we have dust
Action: wash the dishes
Test: is the dishes clean
Action: Clean the floor with water
Test: Is the floor clean?
Action: Do the laundry
Test: Is the laundry clean?
Service Function
Why Amazon lambda is not good for us?
▪ Cold start problem
▪ Instantiating singletons
▪ Nearby our servers/databases to reduce the I/O
▪ Integration to the rest of the Microservices ecosystem
▪ AWS is optimized for multi tenancy. This does not fit our scale.
So let’s build our own lambda based on
the node.js platform we already have
Requirements
Zero boilerplate
Zero configuration - code only
Add only features that are good to
80% of the projects
CLI tool
Hide deployment and runtime
complexity
Documentation must be one page
only!
We started with API first approach!
Developers feedback before developing the platform
module.exports = functionsBuilder =>
functionsBuilder
.withContextPath('conferneces-locator')
.addWebFunction('GET', '/confernces-list', async (ctx, req) =>{
return [
'geektime code',
'serverless days',
'Reversim'
]
});
http://serverless.wix.com/conferences-locator/conferences-list
Defining the API
module.exports = functionsBuilder =>
functionsBuilder
.withContextPath('foo')
.addWebFunction('GET', '/bar', async (ctx, req) => {
ctx.database.insert({id: 'bla'})
ctx.abTesting.conduct('my-experiment',doSomthing)
ctx.kafka.produce('my-topic',{msg: 'message'})
ctx.secretStore.getKey('google-token')
return {baz: 'dar'}
});
ctx to access productivity libraries
Multi repo - by conventions
http://github.com/wix-private/serverless/my-scope/serverless.js
Code should be in any repo in a folder with convention
Org scope Entry file
http://github.com/wix-private/serverless/my-scope/serverless.ts
Org scope Entry file
What is proper replacement for
deployment and configuration portal?
CLI tool
Why CLI tool?
▪ The best DSL for the developer
▪ We can be really fast by just using the CLI
▪ Github - we use CLI mostly, but only for advance we go to the web
▪ Only code and CLI approach - no config
CLI interface
~> wix-serverless deploy my-scope
~> wix-serverless rollback my-scope
~> wix-serverless define-db-schema my-scope
~> wix-serverless traffic-info my-scope
To keep it simple,
we are exposing only interface
which is good for 80% of the projects
To keep it simple,
we are exposing only interface
which is good for 80% of the projects
~> wix-serverless eject
But i need to have low level access
It is great approach to
expose 2 types of API
always for any library
1. Full blown features
2. Most used features
Tip
Architecture
But most of us
does not have
the capacity to
develop such
platform
Start by exposing
reduced API from your
current platform
You will solve most of the problems
Serverless semantics
is a good start
Serverless semantics
is a good start
Takeaways
▪ Think of your target audience when exposing APIs
▪ Avoid abstraction with too much information
▪ Function is smaller, smaller is better
▪ Go serverless - Amazon lambda is also a good choice
▪ Make 2 types of APIs, make them separately
▪ Make your developers focus on business logic mostly
▪ API first - don’t think on the engine in the beginning
▪ Junior developer must be able to write his first service on his first week
Thank you & Q&A
kfirb@wix.com @kfirondev

More Related Content

PDF
Serverless On Stage - Serverless URL Shortener
PDF
20161103 Serverless Italy Meetup
PDF
Application Security in a Container World - Akash Mahajan - BCC 2017
PDF
Continuous Integration at Mollie
PDF
Fastest to Mobile with Scalatra + Swagger
PDF
NCUG 2019: Super charge your API’s with Reactive streams
PDF
Engage 2020: Hello are you listening, There is stream for everything
PPTX
Spring webflux
Serverless On Stage - Serverless URL Shortener
20161103 Serverless Italy Meetup
Application Security in a Container World - Akash Mahajan - BCC 2017
Continuous Integration at Mollie
Fastest to Mobile with Scalatra + Swagger
NCUG 2019: Super charge your API’s with Reactive streams
Engage 2020: Hello are you listening, There is stream for everything
Spring webflux

What's hot (20)

PDF
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
PDF
Immutable Infrastructure: Rise of the Machine Images
PDF
Intro to CakePHP
PPTX
Cloud Native Apps ... from a user point of view
PPTX
APIDays Australia - Openresty for scale
PDF
Orchestrator for QlikView: add-on product description
PDF
Containers across Clouds - Docker Randstad, April 17th, 2015
PDF
Dev objective2015 lets git together
PPTX
Next generation pipelines
PDF
Full-Stack Development with Spring Boot and VueJS
PDF
Using SaltStack to DevOps the enterprise
KEY
Network with node
PPTX
Continuous Delivery
PPTX
Going serverless with aws
PPTX
Managing Requirements with Word and TFS by Max Markov
PPTX
A Simple 8-Step Guide to Setting Up a Dev Shop
PDF
Collaborative communication
PDF
NGINX.conf 2017 - Not all microservices are created equal ... some are server...
PPTX
Running Rancher and Docker on Dev Machines - Rancher Online Meetup - May 2016
PDF
DevOp with Me!
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Immutable Infrastructure: Rise of the Machine Images
Intro to CakePHP
Cloud Native Apps ... from a user point of view
APIDays Australia - Openresty for scale
Orchestrator for QlikView: add-on product description
Containers across Clouds - Docker Randstad, April 17th, 2015
Dev objective2015 lets git together
Next generation pipelines
Full-Stack Development with Spring Boot and VueJS
Using SaltStack to DevOps the enterprise
Network with node
Continuous Delivery
Going serverless with aws
Managing Requirements with Word and TFS by Max Markov
A Simple 8-Step Guide to Setting Up a Dev Shop
Collaborative communication
NGINX.conf 2017 - Not all microservices are created equal ... some are server...
Running Rancher and Docker on Dev Machines - Rancher Online Meetup - May 2016
DevOp with Me!
Ad

Similar to Increasing velocity via serless semantics (20)

PDF
Codecoon - A technical Case Study
PPTX
Mini-Training Owin Katana
PDF
Serverless brewbox
PDF
Continuos Integration and Delivery: from Zero to Hero with TeamCity, Docker a...
PDF
DevOps demystified
PPTX
JCON_15FactorWorkshop.pptx
PPTX
Web Performance & Latest in React
PDF
API workshop by AWS and 3scale
PDF
Openshift serverless Solution
PDF
Journey to the cloud, the why and how of serverless
PDF
Developer-Friendly CI / CD for Kubernetes
KEY
Scaling Rails With Torquebox Presented at JUDCon:2011 Boston
PPTX
Cloud Native Transformation (Alexis Richardson) - Continuous Lifecycle 2018 ...
PDF
Jeremy Edberg (MinOps ) - How to build a solid infrastructure for a startup t...
PPT
Praxistaugliche notes strategien 4 cloud
PDF
SOA with Zend Framework
PDF
The path to a serverless-native era with Kubernetes
PPTX
Azure Functions Real World Examples
PDF
Octo API-days 2015
PDF
Top 7 wrong common beliefs about Enterprise API implementation
Codecoon - A technical Case Study
Mini-Training Owin Katana
Serverless brewbox
Continuos Integration and Delivery: from Zero to Hero with TeamCity, Docker a...
DevOps demystified
JCON_15FactorWorkshop.pptx
Web Performance & Latest in React
API workshop by AWS and 3scale
Openshift serverless Solution
Journey to the cloud, the why and how of serverless
Developer-Friendly CI / CD for Kubernetes
Scaling Rails With Torquebox Presented at JUDCon:2011 Boston
Cloud Native Transformation (Alexis Richardson) - Continuous Lifecycle 2018 ...
Jeremy Edberg (MinOps ) - How to build a solid infrastructure for a startup t...
Praxistaugliche notes strategien 4 cloud
SOA with Zend Framework
The path to a serverless-native era with Kubernetes
Azure Functions Real World Examples
Octo API-days 2015
Top 7 wrong common beliefs about Enterprise API implementation
Ad

More from Kfir Bloch (9)

PPTX
The secrets of building a team that can do everything
PPTX
A sweet taste of clean code and software design
PPTX
Rest is bad
PPTX
TDD For Mortals
PPTX
Design pattern-refactor-functional
PPTX
Refactoring Design Patterns the Functional Way (in Scala)
PPTX
Scala from the Trenches - Java One 2016
PPTX
Scala from the Trenches
PDF
The art of decomposing monoliths
The secrets of building a team that can do everything
A sweet taste of clean code and software design
Rest is bad
TDD For Mortals
Design pattern-refactor-functional
Refactoring Design Patterns the Functional Way (in Scala)
Scala from the Trenches - Java One 2016
Scala from the Trenches
The art of decomposing monoliths

Recently uploaded (20)

PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PDF
Digital Logic Computer Design lecture notes
PPTX
Sustainable Sites - Green Building Construction
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPT
Project quality management in manufacturing
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPTX
web development for engineering and engineering
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PDF
PPT on Performance Review to get promotions
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
CH1 Production IntroductoryConcepts.pptx
PPT
Mechanical Engineering MATERIALS Selection
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Digital Logic Computer Design lecture notes
Sustainable Sites - Green Building Construction
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Project quality management in manufacturing
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
web development for engineering and engineering
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Embodied AI: Ushering in the Next Era of Intelligent Systems
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Lesson 3_Tessellation.pptx finite Mathematics
PPT on Performance Review to get promotions
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
CH1 Production IntroductoryConcepts.pptx
Mechanical Engineering MATERIALS Selection
bas. eng. economics group 4 presentation 1.pptx
UNIT-1 - COAL BASED THERMAL POWER PLANTS

Increasing velocity via serless semantics

  • 1. Increasing velocity via serverless semantics Kfir Bloch kfirb@wix.com @kfirondev The path to productivity in Microservices ecosystem
  • 2. ● Developer 20 years ● Cook Since I remember myself ● Photographer 1 year ● Manager 15 years This is me Just a normal result driven developer
  • 3. By the end of this talk you will Think more about productivity Get more ideas about speeding up velocity Hopefully will adopt serverless semantics
  • 4. The scale we are currently facing ~1000 Microservices ~700 Developers
  • 6. In order to have many Microservices by many teams you need to standardize the infra
  • 7. Productivity Libraries Kafka Abstraction RPC server RPC client Configuration Logging HTTP controllers Secret keys Auth & cookies Containers Caching policy BI reporting ORM support And many more...
  • 8. Supporting web tools And many more... Deployment settings portal Build settings portal
  • 9. ...and some “non-functional” Health tests Monitoring Metrics Graceful shutdown Headers propagation Error handling Security Plugins support
  • 11. It worked for us! But not good enough!
  • 16. Infra developer is the worst person to define abstraction Rule #1
  • 17. Infra developer is the worst person to define abstraction The only person that can define great abstraction is the developer that uses the library Rule #1
  • 18. So let’s generate the code based on wizard with questions! Yeoman to the rescue
  • 20. Still not good enough... ▪ Code generation does not get new updates ▪ Runtime injected in compile time ▪ We generate the code with the problem instead of hiding the problem ▪ Code generate still has maintenance cost ▪ Project got bigger, it is hard know know what it does because of the code generation
  • 21. The secret of productivity library that no one tells you Productivity library is what makes you productive in the beginning Then it becomes frameworks with 40 pages docs...
  • 22. Check your productivity library and you’ll find out that 80% of the projects uses only 20% of the features Rule #2
  • 23. ▪ Still need to use/know so many tools ▪ Microservice tend to become mini-monolith ▪ “distributed monolith” due to compile time wiring of the runtime ▪ Slow onboarding
  • 24. ▪ Runtime as a service ▪ Simplify deployment & configuration ▪ Let developer focus on the logic ▪ Simple API ▪ 20% of the interfaces from the productivity libraries to support 80% of the applications ▪ Still need to use/know so many tools ▪ Microservice tend to become mini-monolith ▪ “distributed monolith” due to compile time wiring of the runtime ▪ Slow onboarding So we need
  • 25. ▪ Runtime as a service ▪ Simplify deployment & configuration ▪ Let developer focus on the logic ▪ Simple API ▪ 20% of the interfaces from the productivity libraries to support 80% of the applications ▪ Still need to use/know so many tools ▪ Microservice tend to become mini-monolith ▪ “distributed monolith” due to compile time wiring of the runtime ▪ Slow onboarding So we need Serverless to the rescue
  • 26. Also takes us to better engineering 1. Passes the tests 2. Reveals intention 3. No duplication 4. Small parts Kent Beck’s Four Rules of Software Design AKA “Simple Design”
  • 27. The fundamental of software engineering If you have complex problem, you should break it to smaller mini problems
  • 28. Real life metaphor - fine granular approach Action: Clean the house Test: is the house clean Action: wipe the dust Test: do we have dust Action: wash the dishes Test: is the dishes clean Action: Clean the floor with water Test: Is the floor clean? Action: Do the laundry Test: Is the laundry clean? Service Function
  • 29. Why Amazon lambda is not good for us? ▪ Cold start problem ▪ Instantiating singletons ▪ Nearby our servers/databases to reduce the I/O ▪ Integration to the rest of the Microservices ecosystem ▪ AWS is optimized for multi tenancy. This does not fit our scale.
  • 30. So let’s build our own lambda based on the node.js platform we already have
  • 31. Requirements Zero boilerplate Zero configuration - code only Add only features that are good to 80% of the projects CLI tool Hide deployment and runtime complexity Documentation must be one page only!
  • 32. We started with API first approach! Developers feedback before developing the platform
  • 33. module.exports = functionsBuilder => functionsBuilder .withContextPath('conferneces-locator') .addWebFunction('GET', '/confernces-list', async (ctx, req) =>{ return [ 'geektime code', 'serverless days', 'Reversim' ] }); http://serverless.wix.com/conferences-locator/conferences-list Defining the API
  • 34. module.exports = functionsBuilder => functionsBuilder .withContextPath('foo') .addWebFunction('GET', '/bar', async (ctx, req) => { ctx.database.insert({id: 'bla'}) ctx.abTesting.conduct('my-experiment',doSomthing) ctx.kafka.produce('my-topic',{msg: 'message'}) ctx.secretStore.getKey('google-token') return {baz: 'dar'} }); ctx to access productivity libraries
  • 35. Multi repo - by conventions http://github.com/wix-private/serverless/my-scope/serverless.js Code should be in any repo in a folder with convention Org scope Entry file http://github.com/wix-private/serverless/my-scope/serverless.ts Org scope Entry file
  • 36. What is proper replacement for deployment and configuration portal? CLI tool
  • 37. Why CLI tool? ▪ The best DSL for the developer ▪ We can be really fast by just using the CLI ▪ Github - we use CLI mostly, but only for advance we go to the web ▪ Only code and CLI approach - no config
  • 38. CLI interface ~> wix-serverless deploy my-scope ~> wix-serverless rollback my-scope ~> wix-serverless define-db-schema my-scope ~> wix-serverless traffic-info my-scope
  • 39. To keep it simple, we are exposing only interface which is good for 80% of the projects
  • 40. To keep it simple, we are exposing only interface which is good for 80% of the projects ~> wix-serverless eject But i need to have low level access
  • 41. It is great approach to expose 2 types of API always for any library 1. Full blown features 2. Most used features Tip
  • 43. But most of us does not have the capacity to develop such platform Start by exposing reduced API from your current platform You will solve most of the problems
  • 45. Serverless semantics is a good start Takeaways ▪ Think of your target audience when exposing APIs ▪ Avoid abstraction with too much information ▪ Function is smaller, smaller is better ▪ Go serverless - Amazon lambda is also a good choice ▪ Make 2 types of APIs, make them separately ▪ Make your developers focus on business logic mostly ▪ API first - don’t think on the engine in the beginning ▪ Junior developer must be able to write his first service on his first week
  • 46. Thank you & Q&A kfirb@wix.com @kfirondev