E
E
egorkozelskij2017-11-05 21:21:05
Java
egorkozelskij, 2017-11-05 21:21:05

How to properly design the server?

Hello!
I chose Java as a server part for the application (I am writing for self-study) and I do not quite understand which technology. choose.
The essence of the project:
There are many modules - we can consider that this is a mini program that runs on the server, and the result is visible on the client + the module of one user can access the methods of the module of another user through the server.
1) The clients themselves are android + web.
2) Each has its own set of modules, its own settings. All this is stored in the database.
It turns out that there is something simple here: the client asked the server to give him some JSON data.
There are situations where one client wants to contact another through the server: That is, the server must be able to notify clients.
But I have doubts from a misunderstanding of the issue of server varieties. As I understand it, there are 2 options for mutual exchange: the client constantly listens to the server and the server itself notifies the client.
The second option is preferable, but as I understand it, it requires a permanent connection, which is not very good.
As a result, we got a number of requirements for the server (correct if I'm wrong):

  • Receive command and response in JSON format
  • Processing modules in threads in "user space" (Storing an active list of users, modules and settings)
  • Notification of clients at the request of modules (for example, notification at a certain time)
  • All this in multi-threaded mode (Many requests - many answers)
  • Some kind of protection against left requests

Can you tell me what is the best way to use this?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question