Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Serverless Spring

Serverless Spring

Role of Spring in the Serverless Landscape
Spring and Serverless Platform
Knative + riff Value Proposition
Live coding / Demos!

Sabby Anandan

October 10, 2018
Tweet

More Decks by Sabby Anandan

Other Decks in Technology

Transcript

  1. Plot Woah, Serverless! Role of Spring in the Serverless Landscape

    Spring and Serverless Platforms Putting it all together 2
  2. Serverless: The Promise 0 X Scale to Zero $ Billed

    by Use Ideation Implementation Production Focus on Business Logic Event Driven 9
  3. Package: java.util.function public interface Supplier<T> { T get(); } public

    interface Function<T, R> { R apply(T t); } public interface Consumer<T> { void accept(T t); } // source // processor // sink 11
  4. Spring Cloud Function @SpringBootApplication public class Application { @Bean public

    Function<String, String> upper() { return value -> value.toUpperCase(); } public static void main(String[] args) { SpringApplication.run(Application, args); } } 12
  5. Plain Old Functions (Imperative Style) package functions; public class Upper

    implements Function<String, String> { String apply(String name) { return name.toUpperCase(); } } 13
  6. Functional Style @SpringBootApplication public class Application { @Bean public Function<Flux<String>,

    Flux<String>> toUpper() { return flux -> flux .filter(this::isValid) .map(String::toUpperCase); } boolean isValid(String input) { ... } public static void main(String[] args) { SpringApplication.run(Application.class, args); } } 14
  7. FaaS Providers Amazon Lambda [native-Java] Microsoft Azure Functions [native-Java] Google

    Cloud Functions riff [native-Java] IBM OpenWhisk [native-Java] OpenFaaS Fission Kubeless Oracle Fn [native-Java] … Spring Boot FaaS Provider Adapters Function Microsoft Azure Spring MVC Spring Cloud Stream AWS Lambda IBM OpenWhisk Spring Cloud Task Spring Cloud Function - Pluggable Adapters 16
  8. riff is for functions Developers can execute functions in response

    to events. - Event-streaming as first-class design principle - Polyglot - Kubernetes native 18
  9. Knative Developers can use familiar idioms, languages, and frameworks to

    deploy any workload: functions, applications, or containers. 19
  10. A Simple Java Function e38dblsskjlk88o de322sss0909k Function Function Invoker Base

    Image Layers Upper $ riff function create java upper Function Layer package functions; public class Upper implements Function<String, String> { String apply(String name) { return name.toUpperCase(); } } 20
  11. Loosely Coupled Functions Upper Logger bigtext T R I G

    G E R S U B S C R I B E R E P L Y T O S U B S C R I B E text 22 channel channel
  12. • Spring Developers: a smaller, more familiar step with access

    to Spring (dependency injection, integrations, and autoconfiguration) and build tools (testing, continuous delivery, and run locally) • Functionistas: no need to know anything about Spring SCFn Narrative Mark Fisher Dave Syer
  13. Q+A