views:

103

answers:

4

Is there a caching solution which works with C++, .Net and Java all accessing and populating same data in cache? (Data is composed of simple strings only)

Longer version:

I have 4 applications which work on different areas of a problem. Two of them are developed in C++, one is a java desktop application, and another is a C# application using .Net 3.5.

Currently they get data individually in their own special ways from same source (a web-service). Programs use this data and instantiate and populate other data structures (read: simple strings using separators) which are also used by other applications.

Currently it is done through (local/remote) sockets between individual programs. The problem is that, the consumer of a specific information caches the results provided by another program for later use in its own memory. The producer also stores it in its own memory to give to another program if it requires, and so on and so on, and in the end I end up with same information copied in every program's memory.

I'm thinking if there is a middle layer of, say a cache, and every program populated and accessed the data in that cache, it'd solve memory issue. Also it'd solve the problem of every application making queries to data source for same data. I'd then have one program populating input data and others working on it. Is there any caching solution which solves this?

+5  A: 

Memcached works fine across independent applications.

Malte Clasen
+1, My answer can't compete with this perfect solution!
used2could
+1 + Accepted, Perfect solution for the problem. Thanks!!
Elister
A: 

depending on how often this data is updated / accessed you may want to look at using exactly what you suggested (middleware). Tibco offers the concept of a tibcache to store data that can later be retrieved by many client applications. Its using in many high frequency trading applications and provides good access times but obviously not as good as a literal in memory cache.

avirtuos
Are all these processes on the same machine? my comment is more relevant only if they may at some point spread onto seperate hosts. Otherwise, Malte's suggestion is better.
avirtuos
No they are not on same machine. The 2 C++ apps run on one machine, Java and C# applications are on their separate machines.
Elister
If this app may use even more inter process type messaging, I'd really take a look at a mature middle ware like tibco w/tibcache. With that said, memcached will indeed be cheaper to implement but certainly not as fast (millisecond scale).
avirtuos
A: 

you could create a wrapper for each language that interacts with a flat file or key/value database. i'd recommend Tokyo Cabinet. It has bindings floating around the net for several languages

Tokyo Cabinet performance examples: http://www.igvita.com/2009/02/13/tokyo-cabinet-beyond-key-value-store/

used2could
A: 

You should have a look at Gigaspaces datagrid ... http://www.gigaspaces.com/datagrid

crowne