Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feasibility of modifying to use Amazon DynamoDB in place of filesystem #16

Closed
DallanQ opened this issue Feb 25, 2012 · 5 comments
Closed

Comments

@DallanQ
Copy link

DallanQ commented Feb 25, 2012

DynamoDB is a simple key-value store. How much work would it be for me to modify JDBM3 to use DynamoDB with key-values of <block-id, block-contents> in place of filesystem calls, so I could use JDBM3 in a multi-user environment?

DynamoDB doesn't supports transactions, but it does support conditional updates. I'm ok with disabling transaction support and caching. But I'm wondering what would happen during a b-tree leaf node split that required the parent be split as well, if the server crashed half-way through the split. Would it leave the b-tree in an unusable state, or would whatever was just added simply be lost?

I'm sure glad to see that you're doing this. I want to be able to store sorted collections in DynamoDB, and I was afraid that I was going to have to implement the b-tree logic myself. I know that DynamoDB supports sorted collections using two-part keys, but there are performance implications, so I'd rather not use them if I can avoid it.

@jankotek
Copy link
Owner

Hi,

JDBM currently have those layers (from consumer down to raw disk)

  1. collection with index (BTree, HTree)
  2. instance cache
  3. serialization
  4. primitive record key-value store (long as key, byte[] as value).
  5. disk store (ram, zip, file)

And if I understand correctly, this proposal is about JDBM using alternative implementations at level 4. I think this is very good idea and will definitely implement it.

My idea is: JDBM will export one more interface called RecordManager with methods like this:

long insert(byte[]) //insert new record, returs recid
void delete(long)  //delete record by recid
void update(long,byte[]) //update record with given recid with new data
boolean supportTransaction()
void roolback()
void commit()

User may supply alternative implementation in DBMaker. In this case JDBM will use other db as back-end, but user will still get instance cache, collections, serialization and other honey JDBM provides.

Only problem is that I am not going to write wrapper for DynamoDB (have no access to Amazon WS). Reference wrapper implementation will use LevelDB or Tokyo Cabinet. JDBM will also still support only single transaction per store.

ETA 2 weeks.

@DallanQ
Copy link
Author

DallanQ commented Feb 27, 2012

Thank you for the reply! I'll check back in a couple of weeks.

@DallanQ DallanQ closed this as completed Feb 27, 2012
@jankotek jankotek reopened this Mar 6, 2012
@jankotek
Copy link
Owner

jankotek commented Mar 6, 2012

Hi,
JDBM now has very basic support for alternative key-value stores. Checkout RecordManager interface to give you some basic understanding. But it is still not finished.

https://github.com/jankotek/JDBM3/blob/master/src/main/java/net/kotek/jdbm/RecordManager.java

@jankotek
Copy link
Owner

I decided not to implement this. Multiple key-value would complicate design too much. I reverted previous GIT commit

@DallanQ
Copy link
Author

DallanQ commented Mar 10, 2012

ok, thanks for letting me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants