0

I need some advice from someone experienced in networking.

I have already created a system designed to monitor some tasks (5-30) that are written in java started by a auomatic scheduler or by operator. These tasks are engaged in systems in the context of banking or insurance.

The system consists of a client class, from a multithread server and from the web application. The tasks will use the client to communicate with the server and the web application does the same to monitor the performance of the tasks registered on the server and the webapp may send to the tasks some commands too, like "stop" or "pause".

task[1-n] <---> Server <---> webapp

Since the web application must be able to send commands to the batch, here lies the problem. I have found 2 solutions:

1) Connectionless; are not kept open connections between the parties, the client periodically sends the status to the server and asks to the server if there are commands for him, the period should be a few seconds, each request opens and then closes a socket connection in a similar way to http protocol.

2) Connectionfull; active connections are maintained between the parties. At this point, the tasks can communicate with the server and the server with the tasks without polling. For example, every time the web application requests the status of a task to the server, he will ask the client who will provide it.

For a moment I adopted the solution 1 and in a simulated test environment, it works fine.

The question is, in terms of employment of resources and flexibility exists a solution between the two definitely better, if so, which one?

If you have some link with specific discussion of the topic this is wellcome.

Thanks, Bye.

1 Answer 1

1

This question is probably off-topic for Server Fault. It's certainly opinion-based.

The right architecture for your software depends on the network and security architecture of the environment in which the application will be used. It will also depend on the desired frequency of communication between the component parts and how much bandwidth polling versus persistent connections might utilize.

If this is a product being built to resell I'd make it as flexible as possible and would probably try to utilize multiple architectures.

If the client and server components run in the same security "zone", for example, you might consider an architecture where either component can initiate communication to the other (in effect making both components "servers" to some extent). That would minimize latency and eliminate polling.

Alternatively, if the client will be segregated in such a manner that the server can't make arbitrary connections to the client (if the client was on the internal side of a firewall separating them, for example), then polling or persistent connections from the client are probably the way to go. Polling may be too "expensive" (from a bandwidth utilization perspective) if your polling frequency is high, but persistent connections will need a periodic "heartbeat" to keep them "alive" across stateful filtering devices.

There's no one-size-fits all solution.

1
  • Thank you vm. Ok, the server run in same security zone of the clients, may be some times, in same system. The webapp anywhere, may be out of security zone. Based me on your reply I think to implement persistend connections between client server and a connectionless comunication between webapp and server.
    – danielec
    Oct 24, 2014 at 16:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .