BACKGROUND: I have application server logic that hosts stateful object instances. I plan to have multiple servers - each hosting stateful object instances. NOTE: this is not a cluster with the same objects mirrored, but more of a federated model.
Each instance of my application server is using Netty and supports HTTP and WebSockets.
I wish to use the Netty WebSocket plumbing as the communication layer for not only server_1/server_2, but also for server_1/object_A talking to server_2/object_X.
For Example:
- Server_1 has objects {OA, OB, OC} and Server_2 has objects {OX, OY, OZ}
- S1:OA could communicate with S2:OX
- S1:OB could also communicate with S2:OX
QUESTION (s):
- 1) Is there a recommended approach to communicate between objects running in different servers using Netty? Are there any examples?
- 2) Should I cache the Channel between servers and funnel all object-object requests over that? Is this thread-safe?
- 3) OR, should I use separate Channels for server and object level communication - dynamically creating/destroying them as needed?
From a network utilization standpoint, I would think option #2 would be preferred for all bi-directional communication between Server_1 and Server_2.
If you need any clarification or more details, please don't hesitate to ask.