Need a cache which is shared between C++, Java and

2019-08-13 18:50发布

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?

6条回答
萌系小妹纸
2楼-- · 2019-08-13 19:17

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/

查看更多
家丑人穷心不美
3楼-- · 2019-08-13 19:20

Memcached works fine across independent applications.

查看更多
我命由我不由天
4楼-- · 2019-08-13 19:24

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.

查看更多
祖国的老花朵
5楼-- · 2019-08-13 19:30

IBM's WebSphere eXtreme Scale has APIs for Java and also REST APIs that can be used by .NET apps and by C++. This product (it used to be called ObjectGrid) has been around for 6 years and is on Release 8.5. Language APIs for C# and C++ are "in the works".

查看更多
小情绪 Triste *
6楼-- · 2019-08-13 19:30

For such a simple use case, memcached would likely work. It has Java, C/C++ and C# clients.

If you're looking at more advanced use cases (anything beyond just "get and put"), then check out an in-memory datagrid (IMDG) solution, such as Oracle Coherence. There's a summary of the In-Memory Data Grid market by Gartner called "Competitive Landscape: In-Memory Data Grids". You can see a copy at: http://www.gartner.com/technology/reprints.do?id=1-1HCCIMJ&ct=130718&st=sb

For the sake of full disclosure, I work at Oracle. The opinions and views expressed in this post are my own, and do not necessarily reflect the opinions or views of my employer.

查看更多
等我变得足够好
7楼-- · 2019-08-13 19:31

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

查看更多
登录 后发表回答