Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any Caching Frameworks for Delphi?

Question: What Caching Frameworks available for Delphi and how well developed are they? If there aren't any then is there a widely-accepted way of achieving the same objective? Applicable to Win32 targeting versions of Delphi.

Question Detail: The type of framework that I'm enquiring about exists largely in Web Development frameworks allowing the user to:

  • Check the Cache for previously stored Data/Object
  • Retrieve the Data/Object
  • Store the new Data/Object
  • Optionally tag the Data/Object and label it.
  • Expire Data/Objects based on some criteria (labels, tags, time limits etc).

I understand that a lack of reflection services for Delphi Objects without RTTI means that they probably won't exist in quite the same way but is there a similar way of achieving at least part of same end result in a more Delphi way?

Alternative Approach: As an alternative to a native Delphi library: Is there for example a good set of bindings for memcached or something similar?

like image 603
jamiei Avatar asked May 04 '09 10:05

jamiei


People also ask

What is caching framework?

The caching framework can handle multiple caches with different configurations. A single cache consists of any number of cache entries. A single cache entry is defined by these parts: identifier. A string as unique identifier within this cache.

What is Hazelcast caching?

Hazelcast enables caching when connected to a persistent data store such as a relational database. The most common access patterns are read-through, write-through, and write-behind.


1 Answers

I have used memcached on Linux (there are versions on Windows and MacOS, as well as almost any other OS), It's quite simple.

I dealt with it directly, using indy's TIDTelnet, by reading the protocol's documentation, I only used set , get, delete, and quit.

I used this kind of commands (I set and get "name", 14 is the number of bytes to be stored):

osama@osama:~$ telnet 127.0.0.1 11211
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
set name 0 0 14
Osama Alassiry
STORED
get name
VALUE name 0 14
Osama Alassiry
END
quit

memcached allows you to store up to 1MB per cache key, I used composite keys like 'Person|17|name', 'Person|17|picture', 'Employee|7|Salary|Basic' (these are fictitious names unrelated to what I really did) ... I have stored some binary files in the cache as base64 which allows to use up to 768k of binary data.

memcached can also be distributed on several servers by hashing the keys, and selecting one of several servers based on they hash.

like image 169
Osama Al-Maadeed Avatar answered Sep 23 '22 00:09

Osama Al-Maadeed