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

Implement GridFS #265

Open
ramazanpolat opened this issue May 29, 2019 · 4 comments
Open

Implement GridFS #265

ramazanpolat opened this issue May 29, 2019 · 4 comments

Comments

@ramazanpolat
Copy link

Since ArangoDB competes with MongoDB, that would be nice to have something like GridFS implemented in driver.

In GridFS documentation, GridFS is defined as:

GridFS is a specification for storing and retrieving files that exceed the BSON-document size limit of 16 MB

I know ArangoDB doesn't have 16 MB limit but GridFS is not just for exceeding document size limits. It is used to store files in chunks. This will have some benefits for some use cases. For example putting profile picture to ArangoDB collection will make developers life much more easier. In past, I've used to store TBs of data in MongoDB that is accessed occasionally and it saved me lots of time to look for a distributed file system. I'd like to see ArangoDB drivers also implement GridFS. In fact, I may try to implement it if this gets accepted.

@dothebart
Copy link
Contributor

probably related to arangodb/arangodb#107

@rashtao
Copy link
Collaborator

rashtao commented Dec 20, 2019

I think this is not driver related: if the db will support in the future binary fields/objects the driver will support them as well.

Currently you can achieve something similar from the driver encoding/decoding binary data to/from base64 encoded strings, so saving strings in the db.
Although in this case the stored data would be bigger than its binary representation, network transfers would be proportionally slower and the client would have to consume cpu for encoding/decoding.
Also pay attention to these limitations: arangodb/arangodb#10754

@ramazanpolat
Copy link
Author

ramazanpolat commented Dec 26, 2019

I think this is not driver related: if the db will support in the future binary fields/objects the driver will support them as well.

In case of MongoDB, GridFS is just a driver implementation of splitting files into chunks and inserting into a collection. MongoDB itself doesn't have any specific part for GridFS, it is all about the driver which does the job.

Currently you can achieve something similar from the driver encoding/decoding binary data to/from base64 encoded strings, so saving strings in the db.

This is actually what GridFS does.

Although in this case the stored data would be bigger than its binary representation, network transfers would be proportionally slower and the client would have to consume cpu for encoding/decoding.

Yes, you are right. The file will be bigger. But this is a trade-off which in some cases users will favor using it, especially for small sized files like profile pictures. Same trade-off also applies for GridFS.

Also pay attention to these limitations: arangodb/arangodb#10754

There are similar limitaions in MongoDB and this is why they come up with GridFS specification in first place.

@rashtao
Copy link
Collaborator

rashtao commented Jan 6, 2020

Thanks for clarifying, in general I like the idea. I would proceed defining a specification which will be then implemented by all the drivers.

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

3 participants