Giter VIP home page Giter VIP logo

kerno-ws-demo's Introduction

Kerno WS Homework

Author: Luca Rospocher

Tech

  • Java 17
  • Spring Webflux
  • R2DBC + PostgreSQL
  • Kafka

Run

  1. Start Kafka + PostgreSQL and the actual backend service using docker-compose up

OR

  1. Start Kafka + PostgreSQL using docker-compose -f docker-compose-dependencies.yaml up
  2. Run the service yourself with you favourite IDE or with ./gradlew bootRun

Then the web socket is reachable at ws://localhost:8080/chat

Notes

Hi there, it was "hinted" to split WS and message logic, I've decided to use a single backend service in order to have only one service reading and writing on the same database, avoiding breaking microservices best practices. Basically the service is both the producer and consumer of the Kafka queue, but that still improves availability and being able to handle high-traffic or delay some operations (database message storage). I'm open to discussions.

The app is built in a reactive / async manner providing functional web-socket logic, kafka and database management.

Issues

  1. Depending by the dockerised gradle build and the Kafka partition setup, the application can be kinda slow. I have not spent time on this as any real app will have it's own CI/CD setup to run the app
  2. WebSockerHandler in a functional style leads to some complexity
  3. R2DBC drivers and libraries still have major bugs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.