Real time notification

S

SSawhney

Hi everybody,

I have a c-sharp application where we draw some graphs using a third party
controls after getting data from a sql server database. The data is updated
continuously through out the day. We want to refresh the graphs window
opened on any user computer as soon as when data is updated in sql server.
so, i am looking to create some framework for "real time" data update
notification from sql server 2000 to all users of applications without
increasing the time to update the data. Any ideas or pointers to begin
design for such framework?

regards
SSawhney
 
S

Sahil Malik [MVP]

How "realtime" is "realtime" ? Is a delay of few milliseconds acceptable?
few seconds? What kind of network connex are you on?
 
S

Sachil Sawhney

Thanks Sahil for quick reply.

To give some more details, the application is used by traders in a
investment bank and is being used for making buy/sell decisions for high
dollar value trades. Delay of few milli seconds is acceptable, but lower
the delay is better it is. Data being updated are booked trades, and
market conditions/indexes at that point of time and some other data from
service like bloomberg. so, faster we are better/safe we are.

Network connection i believe is 1 GB ethernet and is pretty reliable and
fast enough as we are on same network as that of other core trading
apps.

regards
Sachil
 
S

Sahil Malik [MVP]

Sachil,

I have worked on an application that did exactly that. That was a financial
system too, so let me share what I learnt out of that first .. maybe you'll
find it helpful.

In my scenario atleast, I had so much data to worry about, so my first
reaction was that I will use a database. Beacuse a database inherently goes
to the file system, and it does involve a lot of transactional locks, a
database really didn't give me the right architecture. I instead then ended
up creating a huge in-memory cache of data in unmanaged C++. The data I was
managing was a huge 12 GB in-memory cache of symbols and their historical
prices. Various algorithms would run on that data, to analyze the historical
data - a database would just not have cut it.

Thought I'd share my experience on the implementation difficulties I faced
:), but irrespective of if you choose a database or an in-memory cache, this
is more a remoting problem than an ADO.NET problem. Generally for eventing
there are two approaches.

a) Logical - The central server informs the clients of a change. Generally
not scaleable, but better response time. This can be implemented in Sql2k as
an extended stored proc that touches a file, a FileDependency object that
fires up some code to send off a notification. SQL2k5 has much better
alternatives.

b) Better approach - The remote clients keep checking for a change (I know
this sounds crazy in a millisecond environment but keep reading). Usually
the change check is implemented as "IsUpdateAvailable". If one is available,
a second method call is made to the central server farm, which returns the
actual data. This can live within the millisecond delay range, on a LAN
environment but what is notable about this approach is that the server is
stateless, so you can network load balance it as your needs grow. Might I
point that IM services, such as MSN messenger rely on this kind of
approach - and that is quite instantaneous huh? :)

Now, you can choose either a) or b), but if you are writing this application
for hundereds of users, you may want to go with approach b instead.
Specifically in approach a), the client is *listening* for a notification,
and in approach b) the server is listening. So this means once you have such
a notification setup, you can simply setup a CAO remoting service to fulfill
the necessary communication. In approach a) the service would have to exist
on both the client and the server, but in approach b) the service would
exist only on the server :).

Hope this helped. Sorry for the longdrawn answer, I'm a bit high on coffee
;-)

- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.malik/archive/2005/05/13/63199.aspx
 
S

SSawhney

Thanks Sahil for detailed reply. This is very helpful and gives me good
understanding.
I am also looking in tibco solutions and their services for some specific
databases for realtime services.

regards
Sachil
 
A

Adrian Moore

Sachil,

If you are looking for a reliable, real-time database that supports SQL-92
syntax and real-time queries out-of-the-box, try Polyhedra
(www.polyhedra.com). It runs on several platforms, including Windows,
supports multiple CPU's, is designed for large in-memory databases and is
used in the TeleComm. and Oil & Gas industry.

Hope this helps
Ad.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top