Skip to Content.
Sympa Menu

freetds - [freetds] freetds cache

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddy77 AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] freetds cache
  • Date: Sun, 29 Jun 2008 14:21:56 +0200

Hi,
I'm just thinking about caching for auto discoveries and port
instances. Our implementation for protocol discovery require fail&try in
order to get correct protocol while instance detect require a query to
server for every connection. A good way to avoid these extra round-trips
is to cache somewhere. The cache should be a lookup table with
- ip of server (we don't want to cache even dns...)
- port or instance
- real port (for instance)
- last protocol version
- a "last time" for cleanup and updates
this in order to do ip+port -> version and ip+instance -> version+port
lookups. All seems fine and easy however:
- where should we store this cache?? $HOME/.freetds.cache is ok? The
worst case is PHP with Apache, is $HOME/.freetds.cache writable? should
we add an additional configuration to store the path?
- how to implement the cache, in a binary way or in a character format??
this cache is updated and used not by human but being readable is not
that bad... however we need to be able to read it by many processes
while some process should also update it and this require file locking
for every update. Using binary could lead to single record locking but
is more difficult to implement and not human readable. A trick would be
to update the last time if quite old (say one week) and delete record if
very old (say 1 month). Also we should consider that using binary way we
can use trees or other lockup optimizations. We could use libdb but we
would add an additional dependency just for an optimization.

freddy77






Archive powered by MHonArc 2.6.24.

Top of Page