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

Building Reactive Microservices with JHipster & K8s

Building Reactive Microservices with JHipster & K8s

Microservices are everywhere; These isolated and independent services brings in a lot of benefits (nightmares included). On the other hand, Reactive programming enables you to build resilient systems. Combining these two we can build resilient applications that thrive in high load with low latency. In this session, I’ll show you how to use JHipster to create a reactive microservices architecture with Spring Boot, Spring Cloud, and run it all in Kubernetes.

Bonus Bonus: Why split only your Backend services? When you can split your frontend too? Lets go microfrontends.

Sendil Kumar N

June 01, 2022
Tweet

More Decks by Sendil Kumar N

Other Decks in Programming

Transcript

  1. @sendilkumarn Microservices I own my data I own my data

    I own my data I own my data Microservices
  2. @sendilkumarn Reactive µ-service Get me some data. Green → Yellow

    service - latency : 50ms Yellow → Orange service - latency : 100ms Yellow → Blue service - latency : 20ms 170 ms
  3. @sendilkumarn Reactive µ-service Get me some data. Green → Yellow

    service - latency : 50ms Green → Orange service - latency : 100ms Green → Blue service - latency : 20ms 100 ms Reactive µ-service
  4. @sendilkumarn Spring Reactive @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); } Spring Reactive
  5. @sendilkumarn Spring Reactive @PostMapping("/users") public Mono<User> createUser(@Valid @RequestBody User user)

    { // Handle errors return userRepository.save(user) .flatMap( // Do something with the users ) .map( result -> return ResponseEntity .created(new URI("/api/users/" + result.getId())) .headers(HeaderUtil.createEntityCreationAlert (...)) .body(result); ) } Reactive Spring Reactive
  6. @sendilkumarn Spring Reactive Gateway Service A Service B Message Queue

    reactive reactive reactive reactive Spring Reactive
  7. @sendilkumarn Being Reactive makes our services responsive, resilient, elastic, and

    message-driven Spring Boot 2.0 introduced reactive programming for spring based applications But that is a lot…
  8. @sendilkumarn JHipster Server Client Deployments CI/CD templates Angular / React

    / Vue / Svelte Java / Kotlin Docker / K8s / AWS / GAE GitHub / Gitlab / Sonar…
  9. @sendilkumarn Options • Monolithic / Microservices / Gateway • Spring

    WebFlux / Spring MVC • Authentication • Database • Build Tool - Maven / Gradle • Web Framework JHipster
  10. @sendilkumarn Recap Why Microservices? Why Reactive µ-service? Spring Reactive Code

    walkthrough JHipster Generated microservices with JHipster Deploy on Kubernetes