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

Building Reactive Microservices with Kotlin & r...

Building Reactive Microservices with Kotlin & running on Kubernetes

Sendil Kumar N

November 06, 2022
Tweet

More Decks by Sendil Kumar N

Other Decks in Technology

Transcript

  1. Sendil Kumar N & 03 Nov 2022 Building Reactive Microservices

    & Running on Kubernetes using KHipster @sendilkumarn
  2. Does one thing & do it well Should avoid Single

    Point of Failure @sendilkumarn
  3. How to know whether the service is running? How to

    scale the services? @sendilkumarn
  4. How will we know whether the service is running or

    not? How to know whether the service is running? How to scale the services? @sendilkumarn
  5. How will we know whether the service is running or

    not? How to know whether the service is running? How to scale the services? How to safely update a con fi g / password? @sendilkumarn
  6. How to know whether the service is running? How to

    scale the services? Load Balancing & Service Discovery Automatic Scaling based on conditions @sendilkumarn
  7. How will we know whether the service is running or

    not? How to know whether the service is running? How to scale the services? Load Balancing & Service Discovery Automatic Scaling based on conditions Automated monitoring to start & stop services @sendilkumarn
  8. How will we know whether the service is running or

    not? How to know whether the service is running? How to scale the services? How to safely update a password? Load Balancing & Service Discovery Automatic Scaling based on conditions Automated monitoring to start & stop services Secret & Con fi g Management @sendilkumarn
  9. Highly interactive & fast experience consistent & reliable experience Scale

    dynamically Less resource utilisation @sendilkumarn
  10. @PostMapping("/users") public User createUser(@Valid @RequestBody User user) { // Handle

    errors User result = userRepository.save(user); // do something with the result return ResponseEntity .created(new URI("/api/users/" + result.getId())) .headers(HeaderUtil.createEntityCreationAlert(...)) .body(result); } @sendilkumarn
  11. Mono Flow Emit 0 or 1 value Emits 0 or

    many values @sendilkumarn
  12. @PostMapping(“/users") Mono<User> public User createUser(@Valid @RequestBody User user) { //

    Handle errors User result = userRepository.save(user); // do something with the result return ResponseEntity .created(new URI("/api/users/" + result.getId())) .headers(HeaderUtil.createEntityCreationAlert(...)) .body(result); } @sendilkumarn
  13. @PostMapping(“/users") Mono<User> public User createUser(@Valid @RequestBody User user) { //

    Handle errors return User result = userRepository.save(user) .flatMap(// do something with the result) .map(return ResponseEntity .created(new URI("/api/users/" + result.getId())) .headers(HeaderUtil.createEntityCreationAlert(...)) .body(result)); } @sendilkumarn
  14. @PostMapping("/users") public Mono<User> createUser(@Valid @RequestBody User user) { // Handle

    errors return userRepository.save(user) .flatMap( // Do something with the result/users ) .map( result -> return ResponseEntity .created(new URI("/api/users/" + result.getId())) .headers(HeaderUtil.createEntityCreationAlert(...)) .body(result); ) } @sendilkumarn
  15. @PostMapping("/users") fun createUser(@Valid @RequestBody user: User) = // Handle errors

    userRepository.save(user) .flatMap { // Do something with the users } .map { ResponseEntity .created(URI("/api/users/${it.id}”)) .headers(HeaderUtil.createEntityCreationAlert(…)) .body(it) } @sendilkumarn
  16. Kotlin • Null Safety • Less verbose • Co-routines •

    Expressive & Concise • “Hacky” & Fun @sendilkumarn
  17. Kotlin • Null Safety • Less verbose • Co-routines •

    Expressive & Concise • “Hacky” & Fun Java Catching up… @sendilkumarn
  18. Kotlin • Null Safety • Less verbose • Co-routines •

    Expressive & Concise • “Hacky” & Fun Java Project Loom @sendilkumarn
  19. Kotlin • Null Safety • Less verbose • Co-routines •

    Expressive & Concise • “Hacky” & Fun Java @sendilkumarn
  20. Kotlin • Null Safety • Less verbose • Co-routines •

    Expressive & Concise • “Hacky” & Fun @sendilkumarn
  21. Kotlin • Null Safety • Less verbose • Co-routines •

    Expressive & Concise • “Hacky” & Fun Personal Preference @sendilkumarn
  22. Various options • Monolithic / Microservices • Spring WebFlux /

    Boot • Authentication • Database • Maven / Gradle • Web Frameworks • CI & CD • Kubernetes & Istio @sendilkumarn
  23. Recap • Microservices • Kubernetes splitting your services enable you

    to scale faster super power to manage & maintain your services @scale @sendilkumarn
  24. Recap • Microservices • Kubernetes • Reactive splitting your services

    enable you to scale faster super power to manage & maintain your services @scale makes things fast & resilient @sendilkumarn
  25. Recap • Microservices • Kubernetes • Reactive • KHipster splitting

    your services enable you to scale faster super power to manage & maintain your services @scale makes things fast & resilient makes it easier to develop & deploy @sendilkumarn
  26. Recap • Microservices • Kubernetes • Reactive • KHipster •

    Demo splitting your services enable you to scale faster super power to manage & maintain your services @scale makes things fast & resilient makes it easier to develop & deploy @sendilkumarn