Effective OBD work for large RPS



  • Started studying the Java, decided to give an example of a simple REST API server, with simple tasks:

    • Ask him to go to the D.O.D. to see if the user has a lead on such a request.
    • Go to the OBD again, take the article or create a new article.
    • Save the answer and send the user

    As can be seen, the server is basically communicating with the OBD, and in itself does little work.

    My question is how to process the maximum number of requests from this server.

    I can't googling anything useful about asynchronous interaction in java, everyone's only offering to create friction, but I'm interested in productivity, I want to process new requests while I'm waiting for a response from the OBD system, and if every request is to create a new track, the resources of the OS will end, and if a pool of tracks is created, the server doesn't do anything useful, but just wait for 100 trid.

    In nodejs, there's no problem with the loop event, but I decided to try java because he has a good PLO and a typical. What approach does java use developers to effectively handle such tasks? And how do you even communicate with the OBD asynchronous? If there's something I don't understand right in the trade, please correct me.



  • Looks like your problem is the best thing to do with it. Reactive programming

    In Java, there's plenty of libraries and frimvors for that.Project Reactor, RxJava, Vert.x, Spring WebFlux etc.)

    A simple example of a reactive REST on a WebFlux requesting a base through SpringData+R2DBC can be found, say, https://habr.com/ru/post/565752/

    There are also many examples, articles and documentation on reactive programming, libraries and francs that can be found through googles




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2