Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 06-15-2005
DeepDiver's Avatar
DeepDiver DeepDiver is offline
Registered User
 
Name: Thomas Müller
Organization: Freelance Software Developer
Project: Project depend on Customers
 
Join Date: Nov 2004
Location: Munich, Bavaria, Germany
Posts: 100
ServantLocator implementation

hi guys,

i'd like to implement a server using a ServantLocator implementation, which
runs against a database in order to fetch required data needed by the servant.
[standard approach described in the manual]

in order to encapsulate the database we plan to hide the database behind
a ice based server aswell.

so i need to make a call to an ice proxy inside the ServantLocator implementation.

for scaleability and robustness all proxies shall use mutliple endpoints.

do you see any trouble with this approach?

i'd like to know your opinion.

thanks alot

tom
Reply With Quote
  #2 (permalink)  
Old 06-15-2005
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 971
Hi Tom,

Unless you're planning to do some sort of caching (such as using an evictor-style locator), this approach could have some serious performance problems. Specifically, latency is going to take a big hit if the locator makes a remote request to the database server for every incoming request.

However, if the requests on the database server are relatively infrequent, then it sounds like a reasonable approach.

Take care,
- Mark
Reply With Quote
  #3 (permalink)  
Old 06-15-2005
bernard's Avatar
bernard bernard is online now
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 813
Hi Tom,

You can make remote calls from your servant locator, so I can't see anything wrong from an Ice point of view.
However I am curious on how you plan to update the databases and ensure they are all in sync. Or is it just read-only access?

For your servant locator implementation, you may have a look at the IceUtil::Cache C++ template and IceUtil.Cache class: they can help you write a servant locator where you don't lock everything while (slowy) loading an object from its database.

Cheers,
Bernard
Reply With Quote
  #4 (permalink)  
Old 06-16-2005
DeepDiver's Avatar
DeepDiver DeepDiver is offline
Registered User
 
Name: Thomas Müller
Organization: Freelance Software Developer
Project: Project depend on Customers
 
Join Date: Nov 2004
Location: Munich, Bavaria, Germany
Posts: 100
hi Mark, hi Bernard,

thanks for your replys.

the servant implementation will be on basis of the evictor.

for the database consistency we plan to use the replication feature of the
sql server. or we let it run on a windows 2003 server cluster in order get the
desired fault toleranz. we are working on that.

i'll have a look at the Cache class. thanks for the hint.

Gentlemen, thanks a lot! It's always a pleasure talking to you.


Take care,

Tom
Reply With Quote
  #5 (permalink)  
Old 06-16-2005
DeepDiver's Avatar
DeepDiver DeepDiver is offline
Registered User
 
Name: Thomas Müller
Organization: Freelance Software Developer
Project: Project depend on Customers
 
Join Date: Nov 2004
Location: Munich, Bavaria, Germany
Posts: 100
hi again,

i scripted a small uml diagramm in order to show the workflow.

another question came to my mind while doing so:

what is the event/reason on proxy side to switch to another endpoint?

is it only - as shown in my uml model - in case the call to the currently used
endpoint fails??

what i want to avoid is the existance of the same session on two servers.


thx again

tom
Attached Thumbnails
servantlocator-implementation-multiple-endpoints-servantlocator.gif  
Reply With Quote
  #6 (permalink)  
Old 06-16-2005
benoit's Avatar
benoit benoit is offline
ZeroC Staff
 
Name: Benoit Foucher
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Rennes, France
Posts: 1,534
The Ice runtime might switch to another endpoint if the connection associated to the proxy is closed and a new connection needs to be established. The connection can be closed for various reasons: a network problem, active connection management (ACM), timeouts, etc.

Benoit.
Reply With Quote
  #7 (permalink)  
Old 06-16-2005
DeepDiver's Avatar
DeepDiver DeepDiver is offline
Registered User
 
Name: Thomas Müller
Organization: Freelance Software Developer
Project: Project depend on Customers
 
Join Date: Nov 2004
Location: Munich, Bavaria, Germany
Posts: 100
hi again,

this wouldn't work this way, i guess.
because the returned session proxy comes with one endpoint only
he has no knowledge about the other servers, who are capable of hosting
the session as well.

could the client add additional endpoints to the returned proxy?

by doing so the mechanism could still work - but does it make scence?!?

reagrds,

tom

Quote:
Originally Posted by DeepDiver
hi again,

i scripted a small uml diagramm in order to show the workflow.

another question came to my mind while doing so:

what is the event/reason on proxy side to switch to another endpoint?

is it only - as shown in my uml model - in case the call to the currently used
endpoint fails??

what i want to avoid is the existance of the same session on two servers.


thx again

tom
Reply With Quote
  #8 (permalink)  
Old 06-16-2005
benoit's Avatar
benoit benoit is offline
ZeroC Staff
 
Name: Benoit Foucher
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Rennes, France
Posts: 1,534
You could add endpoints in the server or client. This requires to stringify the proxy (with the communicator->proxyToString() method), add the endpoints and convert back the stringified proxy to a proxy.

Another option (which isn't available yet but will be available with IceGrid) would be to use an indirect proxy with a replicated object adapter (see the article on IceGrid in the second issue of the Ice newsletter for more information).

I think the main issue with your approach is that it requires to have no more than one instance of a session object at any point in time. If the connection associated to the session proxy is closed -- the Ice runtime will eventually establish a new connection on another endpoint. How do you make sure that the previous instance of the session object is destroyed?

Benoit.
Reply With Quote
  #9 (permalink)  
Old 06-16-2005
DeepDiver's Avatar
DeepDiver DeepDiver is offline
Registered User
 
Name: Thomas Müller
Organization: Freelance Software Developer
Project: Project depend on Customers
 
Join Date: Nov 2004
Location: Munich, Bavaria, Germany
Posts: 100
hi benoit,

thanks for your comments.

Quote:
Originally Posted by benoit
How do you make sure that the previous instance of the session object is destroyed?
this is exactly the problem i'm facing.

i think i'll take care about switching the server myself in the client implementation.

a proxy can have routers and locators. could i use one of them to plugin
my server switching approach?

the only thing i'd like to achieve is a set of servers, capable of hosting the
same objects and in case of server breakdown the client switches to one of
the other servers.
because the hosted object have no state in ram, but in the common share
database(s) this should work.

the only thing which has to be ensured is the endpoint switching only occurrs
on failure of the server.

take care

tom
Reply With Quote
  #10 (permalink)  
Old 06-16-2005
benoit's Avatar
benoit benoit is offline
ZeroC Staff
 
Name: Benoit Foucher
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Rennes, France
Posts: 1,534
Quote:
Originally Posted by DeepDiver
a proxy can have routers and locators. could i use one of them to plugin
my server switching approach?
Yes, it's quite possible that the location of the session object could be handled by a specific locator implementation. This might however not be trivial to implement, especially if you want this locator implementation to be highly available as well .

Quote:
Originally Posted by DeepDiver
the only thing i'd like to achieve is a set of servers, capable of hosting the
same objects and in case of server breakdown the client switches to one of
the other servers.
because the hosted object have no state in ram, but in the common share
database(s) this should work.

the only thing which has to be ensured is the endpoint switching only occurrs on failure of the server.
If the hosted objects have no state, why do you need to ensure that there's always only one instance of such an object? Couldn't you instead allow having several replicas of the object on the different servers?

From your diagram, it actually looked like your session objects are caching the state retrieved from the database and therefore they aren't really stateless . If that's the case, it seems like it's indeed a better solution to handle the failures in the client directly: if a session object becomes unavailable, the client re-creates another session object on another server and forgets about the previous one.

Benoit.
Reply With Quote
  #11 (permalink)  
Old 06-16-2005
DeepDiver's Avatar
DeepDiver DeepDiver is offline
Registered User
 
Name: Thomas Müller
Organization: Freelance Software Developer
Project: Project depend on Customers
 
Join Date: Nov 2004
Location: Munich, Bavaria, Germany
Posts: 100
hi benoit,

maybe the naming of the object as 'session' is very descriptive.
the session has the responsibilty to interact with a 3rd party system, which
includes monitoring tasks. results of monitoring are propergated to the client
- who started the session - and need to be stored in the database.

from the logic view the session is not stateless. from the implementation view
they have not state stored in memory - which can be lost in case of server fault.

i think i'll handle the situation in the client myself.

thanks alot for spending your time on this.

cu tom
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
ACL implementation extending EvictorI xdm Help Center 0 01-05-2006 01:41 PM
Question on the IcePack implementation stephan Help Center 3 03-29-2005 03:38 AM
ServantLocator::deactivate signature andreynech Bug Reports 1 05-23-2004 06:08 PM
C# implementation issues? vukicevic Comments 5 02-11-2004 04:46 PM
ServantLocator and dispatching thread ganzuoni Help Center 8 07-10-2003 01:38 PM


All times are GMT -4. The time now is 10:33 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.