-
Notifications
You must be signed in to change notification settings - Fork 50
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
I would like a s3 datastore for this #135
Comments
Hey thanks for posting. It would be very nice to have an s3 backend for this. So we are definitely open to pulling in a repo into this org. Then general idea you proposed looks about right, but there might be an easier solution. Using https://github.com/loune/s3leveldown together with https://github.com/ipfs/js-datastore-level could accomplish what you want without needing to reimplement anything. If you look at the options for js-datastore-level, it accepts any leveldown compatible backend as |
Ok, I'll check that out. My understanding from looking in the code though was that level was for the browser while the fs was for the server, is that not so? |
No, in node, both level and fs are used, (level for the storage of key - value pairs that ipfs needs for operation, like pinsets etc, and fs is used for storing the actual blocks of data on disks). In the browser indexeddb is used to store all of this, but abstracted away through level. |
Got it, thanks. I'll check it out when I get home.
…On Fri, May 26, 2017 at 10:43 AM, Friedel Ziegelmayer < ***@***.***> wrote:
No, in node, both level and fs are used, (level for the storage of key -
value pairs that ipfs needs for operation, like pinsets etc, and fs is used
for storing the actual blocks of data on disks). In the browser indexeddb
is used to store all of this, but abstracted away through level.
The interfaces that datastore-level and datastore-fs provide are identical
though, so you can switch in whatever you want. So you can use
datastore-level for all storage with the s3 backend
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#135 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAq3trNIafPRElrxBtNfStiJ2QtbQODks5r9vMTgaJpZM4Nl-Zt>
.
|
It seems like the It seems like just implementing Also, if both
Also based on your description there I'm wondering if it wouldn't make more sense to use s3 for blocks and Dynamo for the key value pairs instead? How does that sound? |
@justinmchase just merged your PR #136, thanks for that.
It depends, DynamoDB is a powerhouse and our level usage is simply to store ephemeral stuff like DHT records and something more persistent such as the pinset root hash. I would argue that storing all of these in S3 would be advantageous, but putting a LRU cache in front of the datastore one would give you the most bang for the buck, otherwise you will be doing tons of tiny reads and writes. |
Before releasing, I double checked and test js-ipfs against js-ipfs-repo master and I started getting errors when using the daemon through the HTTP-API On tests:
On regular spawn daemon
#136 doesn't look like it was the cause of the problem, it might be a dependency that got updated and it is causing this. Investigating why this happens now. |
I didn't try that, I'll give it a shot locally and let you know what happens. |
I get the same but interestingly it seems to work fine that way with a newly initialized repo. Something in my PR caused the file names to change? |
got a fix: #137 |
Thanks @justinmchase ! :) |
@diasdavid I don't believe that fix will be enough, please revert these changes for now, also this should have been a minor version bump as this is a very breaking change in the options interface #138 |
Hi @dignifiedquire, sorry about this. What steps should I take to test it fully? I agree with the version bump comment also. |
@justinmchase yeah, just unpublished it. I had a false positive for no breaking changes as explained here: #138 (comment) |
Any update on the S3 Datastore, @justinmchase ? |
Oh yeah I fixed my fork. Should I open a new PR? |
yes please :) Do note that the S3 DataStore should not be a default, but just something that is pluggable |
Hi @justinmchase! Now that all the ipfs-repo has been refactored (thank you for the CR btw!), do you think you can look back into that s3 datastore? |
I've been working on it, one issue I'm encountering is that the Key class in I'm trying to work with it as is without any sweeping changes but right now my thinking would be, if there were to be sweeping changes, that the key should be changed to accept uri's instead of make assumptions about file paths. For example all current systems would be changed to be Each of the repos needs to be fixed up also to remove hard coded paths (e.g. Here is my repo so far: I cloned the Thoughts welcome. |
I have an initial implementation of this ready for feedback. All methods from the Spec are functioning. Right now it's expecting an S3 instance to be passed to it via the storageBackendOptions. The other thought was to have it take the options and create the instance internally. The thought behind having that as a passed in value was to keep the S3 instance creation decoupled from the store. Update: The repo has been moved to the ipfs org: https://github.com/ipfs/js-datastore-s3 |
I just fixed a bug and added an examples folder. It currently only contains the ipfs 101 example with a repo fully backed by s3 (not that it makes sense to do each layer on s3). I've run this against my own s3 bucket as well. |
@jacobheun where is that example? |
@jacobheun I'm thinking of having an example in js-ipfs repo https://github.com/ipfs/js-ipfs/tree/master/examples that shows users how to plug different repo configurations to js-ipfs |
@diasdavid I think that would be very helpful for people who are interested in playing around more in depth with custom repo configuration |
@jacobheun would you mind tackling that example? |
@diasdavid I can do that. I think I will get the locker config/option #161 working and then add that into an example in js-ipfs. |
@diasdavid opened a new PR for the example ipfs/js-ipfs#1303 |
I would like to use the js-ipfs library on my backend but I would like to swap out the repo location from filesystem to s3.
I've been digging through the code and I saw some examples of how to maybe use a different repo than the filesytem but none of them seemed to be relevant anymore. Based on digging around in the current code it looks like I would need to create a module that implemented the same interface as the
ipfs/js-datastore-fs
module but worked with s3 api's instead.Then if I did that I could bind it together like this:
My first question is, does that sound right? I didn't see anything in the js-datastore-fs code that couldn't probably be implemented 1:1 in s3.
Second question has to do with api stability and your likliness to accept patches to this project? Also, would you be interested in pulling in the repo for datastore-s3 into the ipfs org? I'm a little worried about creating this module and then have the js-ipfs-repo change its api without also updating the related datastores. What would be the right way for me to proceed with this?
The text was updated successfully, but these errors were encountered: