niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » Berkeley DB
Using recno as a queue; alternative for consume()?
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
Author Message
ubell@sleepycat.com
*nix forums beginner


Joined: 06 Jun 2005
Posts: 49

PostPosted: Thu Feb 03, 2005 9:45 pm    Post subject: Re: Using recno as a queue; alternative for consume()? Reply with quote

Marco,

One thing you can consider is to use a queue sized big enough for
your "typical" record and then use a btree to handle records which
are too big to fit in the queue indexed by their queue record number.
If most of your record are "typical" or less in size then you get
the advantage of the queue and little contention in the btree.

You would need to have some format information in your queue
data so you can tell what the real size of the record is and if you
have to read the btree.

RECNO has relatively poor concurancy since the whole tree
must be locked on updates so that record numbers can be
maintianed in the tree.

Michael Ubell
Sleepycat Software.
Back to top
Marco Nicosia
*nix forums beginner


Joined: 25 Feb 2005
Posts: 5

PostPosted: Wed Feb 02, 2005 12:38 am    Post subject: Using recno as a queue; alternative for consume()? Reply with quote

Hi gang,

I'm putting together an application which queues messages in the
case of a communications failure/delay. I want that queue to be
reliable in the case of failure (machine reboot, process crash,
etc) so I've been playing with Berkeley DB.

Ideally I'd use a Queue, but the messages are of variable length.
So, I've been using a Recno. Is there a better alternative?

Specifically, I want consume(). Is there a best practice to
simultaneously read (in insertion order) and delete a record from
a Recno db?

This will be a multi-treaded app (in Python, whee).

Thanks!

--
_______________________________________________________________________
Marco E. Nicosia | http://www.escape.org/~marco/ | marco@escape.org
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
The time now is Thu Jan 08, 2009 4:39 am | All times are GMT
navigation Forum index » Databases » Berkeley DB
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Zenwalk an alternative to Slackware? Matthias Roeske Slackware 12 Sun Jul 16, 2006 8:11 pm
No new posts queue. Jeff Fisher Postfix 2 Fri Jul 14, 2006 9:43 pm
No new posts Messages sitting in /var/qmail/queue/mess/ (ALRM doesn't ... Miroslav Pendev Qmail 1 Fri Jul 14, 2006 1:12 am
No new posts Alternative sources of help Sobiech, Steffen Apache 0 Tue Jul 11, 2006 8:42 am
No new posts queue select Vittorio Zuccalà MySQL 2 Mon Jul 10, 2006 1:25 pm

Credit Counseling | Payday Loans | Advertising | Credit Counseling | Mortgage Calculator
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1011s ][ Queries: 20 (0.0340s) ][ GZIP on - Debug on ]