dbTalk Databases Forums  

Read Only Remote DB (Replication?)

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


Discuss Read Only Remote DB (Replication?) in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
spattija@gmail.com
 
Posts: n/a

Default Read Only Remote DB (Replication?) - 03-11-2007 , 07:11 PM






Hi,

I'm *really* new to bdb so I apologize in advance for the question.

I have a db on a remote machine. Once initializated and filled up,
this db is not modified anymore.
I'd want to "connect" to this remote db from another machine, in a
read only mode.
My questions are:

1) Is replication the simplest/most correct way to achieve this? I
want to focus on the point that, once created, the db is accessed
*always* in read only.

2) When replication starts, is its content update driven by client's
db->get()s ? In my specific aplication, I have on thread which asks
for some data, the desired behaviour whould be to tell the client db
to start fetching the data from the master db. If the data is already
in the local copy of the db, then I use it, otherwise that get()
should fail as I expect (and desire, since for this specific case I
can't block until the data is ready).

3) If the db update is ::get() driven, does bdb have some kind of
prefetch based on locality or have I to implement my own policy?

Think to my application as a google-earth-like application. I have the
data in a remote repository, then on demand a client asks for some of
them and, if not already present, falls back to a lower resolution
representation of the data.

Thank you in advance!


Reply With Quote
  #2  
Old   
ashok
 
Posts: n/a

Default Re: Read Only Remote DB (Replication?) - 03-13-2007 , 05:13 AM






On Mar 11, 8:11 pm, spatt... (AT) gmail (DOT) com wrote:
Quote:
Hi,

I'm *really* new to bdb so I apologize in advance for the question.

I have a db on a remote machine. Once initializated and filled up,
this db is not modified anymore.
I'd want to "connect" to this remote db from another machine, in a
read only mode.
My questions are:

1) Is replication the simplest/most correct way to achieve this? I
want to focus on the point that, once created, the db is accessed
*always* in read only.

2) When replication starts, is its content update driven by client's
db->get()s ? In my specific aplication, I have on thread which asks
for some data, the desired behaviour whould be to tell the client db
to start fetching the data from the master db. If the data is already
in the local copy of the db, then I use it, otherwise that get()
should fail as I expect (and desire, since for this specific case I
can't block until the data is ready).

3) If the db update is ::get() driven, does bdb have some kind of
prefetch based on locality or have I to implement my own policy?

Think to my application as a google-earth-like application. I have the
data in a remote repository, then on demand a client asks for some of
them and, if not already present, falls back to a lower resolution
representation of the data.

Thank you in advance!
Replication maintains one or more identical copies of the database.
So if the database was created on a remote machine,
do you want to have a local read-only replica on the machine where
you're accessing it?

If not, then replication is not a solution.

Can the disk/storage on the remote machine be accessed from the local
machine?



Reply With Quote
  #3  
Old   
Don Anderson
 
Posts: n/a

Default Re: Read Only Remote DB (Replication?) - 03-23-2007 , 09:27 AM



On Mar 13, 7:13 am, "ashok" <ashokjo... (AT) gmail (DOT) com> wrote:
Quote:
On Mar 11, 8:11 pm, spatt... (AT) gmail (DOT) com wrote:

Hi,

I'm *really* new to bdb so I apologize in advance for the question.

I have a db on a remote machine. Once initializated and filled up,
this db is not modified anymore.
I'd want to "connect" to this remote db from another machine, in a
read only mode.
My questions are:

1) Is replication the simplest/most correct way to achieve this? I
want to focus on the point that, once created, the db is accessed
*always* in read only.

2) When replication starts, is its content update driven by client's
db->get()s ? In my specific aplication, I have on thread which asks
for some data, the desired behaviour whould be to tell the client db
to start fetching the data from the master db. If the data is already
in the local copy of the db, then I use it, otherwise that get()
should fail as I expect (and desire, since for this specific case I
can't block until the data is ready).

3) If the db update is ::get() driven, does bdb have some kind of
prefetch based on locality or have I to implement my own policy?

Think to my application as a google-earth-like application. I have the
data in a remote repository, then on demand a client asks for some of
them and, if not already present, falls back to a lower resolution
representation of the data.

Thank you in advance!

Replication maintains one or more identical copies of the database.
So if the database was created on a remote machine,
do you want to have a local read-only replica on the machine where
you're accessing it?

If not, then replication is not a solution.

Can the disk/storage on the remote machine be accessed from the local
machine?
I hope I can expand on what Ashok has told you.
If you are 100% readonly, then the easiest solution is to use
BDB without replication or transactions. Create your
database, make sure you sync it before closing, copy it to
to machine *where you are using it*. There is no need to
access a remote machine from your application -- actually that
is a harder problem. Rather, use BDB directly within your
application to access the database. Open it readonly to enforce
the fact that you won't change it.

Now if what you need is a database that is readonly from all clients
and changes slowly (or even quickly), then replication is totally
appropriate -
essentially all the changes to the master database get propogated to
all the clients. In that case, you need replication and transactions.
There are many other variations.

Hope that makes sense.

- Don



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.