How to direct DataSnap client connections to various DS Servers?
Asked Answered
C

1

3

I have a quite big DataSnap server that will be running 24/7, it will substitute a currently running MIDAS (COM) server. Now I'm facing the problem of how to update that server without having to force disconnection of all connected clients.

With the current midas server (that, by the way, doesn't have a huge traffic to serve) I simply wait until there are no connections, then shut down the server application and substitute the exe file. If a new connection occurred while the server was "down", being it a COM object, it will be "pulled up" by the OS, giving no problems to the clients.

The new DataSnap architecture isn't anymore based on COM (great!), but this way I lose the opportunity to stop the server without causing new connections to fail.

I've thought that a sort of TCP "proxy" or "tunnel" could solve my problem, so I can simply put a new server exe somewhere and have that "proxy" redirect client connections to the new DS server. I've tried TIdMappedPortTCP, but it continuously hangs at random points of the server-client dialog.

Any ideas?

EDIT: I'm using DataSnap on pure TCP/IP transport for efficiency reasons, so http proxies are not suitable for my specific case.

Canula answered 6/8, 2012 at 7:47 Comment(3)
For some ideas see #945148Kaffiyeh
You may want to take a look at the TDSHTTPService.HttpServer.TunnelService events to use the built-in tunneling wich allows you to implement FailOver scenarios using DataSnap. You may want also to read implementing failover and load-balancing in datasnap 2010 by Andreano Lanusse to get some ideas.Norvun
Thank you for your comments. Unfortunately the first suggestion talks about the old datasnap architecture, the one based on midas that I'm currently using (though some ideas could apply to the new DataSnap architecture too, but not in my case). The second suggestion is very interesting, but applies to DataSnap on HTTP transport only, while I'm using pure TCP/IP transport for efficiency reasons. So neither solution is applicable to my specific case. I'll edit my question to be more specific.Canula
R
1

Maybe you should look at the equivalent of a naming service? Could be as simple as a Datasnap server that you make a method call on and returns the IP address of the "main" server. Then when you want to drop a server for maintenance you can change the IP address your naming server is handing out, so new clients get routed to it instead. When your main server is back up, you can change the IP back.

You still have the bootstrap problem (ie. how do they find the IP of the naming server) but this can be as simple as having a couple of IP addresses in a config file on the client and if the first one fails drop back to the second.

Reseau answered 16/8, 2012 at 1:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.