dbTalk Databases Forums  

some confusion about distributed access

comp.databases.berkeley-db comp.databases.berkeley-db


Discuss some confusion about distributed access in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Borislav
 
Posts: n/a

Default some confusion about distributed access - 11-04-2005 , 04:08 PM






Hi,

Is it possible at all to simultaneously access the same Berkeley DB
environment from different machines? Is it doable at all are there any
other constraints besides a network filesystem with a correct 'fsync'
implementation? It's still not clear to me as the documentation only
mentions mutliple threads and processes, but doesn't talk about
"multiple machines"

The Berkeley DB architecture insists on using a shared memory pool.
Does that mean that I might end up with database corruption? I have a
case where I don't care whether one node has the latest data so I can
leave with a temporary inconherence between the views that two nodes
might have on the data. And I also have a case (where I would like to
use BDB to implement a distributed lock manager) where I would like all
nodes to have the latest and greatest data, the data being some sort
of a "lock table". More precisely:

1) If temporary inconsistencies b/w compute nodes are tolerable, is a
given BDB environment accessible from different servers in a "normal
way" (meaning the same way as multiple processes can access it).

2) Can I, for example, disable all caching and memory mapping and share
a BDB environment b/w nodes, and rely on BDB's own locking to insure
data consistency (every sees the same data, single-writer/multiple
readers...).

Thanks a lot!
Boris


Reply With Quote
  #2  
Old   
Patrick Schaaf
 
Posts: n/a

Default Re: some confusion about distributed access - 11-05-2005 , 12:27 AM






"Borislav" <borislav.iordanov (AT) gmail (DOT) com> writes:

Quote:
Is it possible at all to simultaneously access the same Berkeley DB
environment from different machines?
If you mean, without explicitly saying that, 'by using a common
network filesystem and shared access to environment and backing
files', the answer is a resounding NO, as far as I know.

Look for the 'rpc' stuff in the documentation. I have not used it,
but it's the way things are supposed to be distributed.

In general, it is much less likely to get distributed software
to cooperate by concurrently modifying files, than it is to
get it to cooperate by communicating its modifications in a
way the distributed software developer itself devised. The set
of operations the software can reliably do directly to a file,
is vastly smaller than the set of operations a programmer can
invent when both sides are of her own design.

best regards
Patrick


Reply With Quote
  #3  
Old   
Borislav
 
Posts: n/a

Default Re: some confusion about distributed access - 11-07-2005 , 10:16 AM



This what I don't quite understand: why is the answer a resounding NO?
What difference does it make to BerkeleyDB if the files are on a local
or remote disk? Say I don't want to use BerkeleyDB caching AT ALL, I
don't want memory mapped files. I just needed it as a simple disk
managed database, with a well designed API. I'm never going to have
simultaneous multiple writers and I'll manage this through my own locks
etc...

Wouldn't a configuration like this (I'm using the Java wrappers):

DatabaseConfig dbConfig = new DatabaseConfig();
dbConfig.setAllowCreate(true);
dbConfig.setCacheCount(0);
dbConfig.setCacheSize(0);
dbConfig.setNoMMap(true);

cover my "use case"?

Boris


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.