[ZODB-Dev] Scalable Container for Log-Entries
Thomas Guettler
hv at tbz-pariv.de
Wed Jan 28 10:15:38 EST 2004
Am Mittwoch, 28. Januar 2004 16:04 schrieben Sie:
> On Wed, 28 Jan 2004 10:44:01 +0100
>
> Thomas Guettler <hv at tbz-pariv.de> wrote:
> > Hi!
> >
> > How would you code a scalable container which holds
> > log-entries ordered by the time the data was inserted into
> > the container.
> >
> > There are several process which add log-entries (ZEO + Filestorage).
> > The API is very simple:
> >
> > 1. logContainer.add(data)
> > 2. data_list=logContainer.get(from_date, to_date)
> >
> > I think of a BTree with the time as key. The time in seconds
> > since 1970 is not enough because there will be several
> > log entries per second. If you have an other solution, please
> > let me know.
>
> The float value returned by time should be OK, but the resolution of it
> may not be good enough in your application. The resolution varies by
> platform AFAIK, but I'm not sure if this is a problem in your case.
It seems to be OK. I am running this script since
several minutes:
frac=1000000
while 1:
now=time.time()
now2=time.time()
now=long(now*frac)
now2=long(now2*frac)
if now==now2:
raise("Equal: %s" % now)
> You could also consider putting the log in a separate storage so that it
> doesn't content with access to the main storage server. This could be
> done later, however.
I want to log references to objects (not strings). I think this is not
possible if I use serveral storages.
thomas
More information about the ZODB-Dev
mailing list