Comments (7)
You could, for example, create a table 'file_index' which keeps a reference to a file for each user.
E.g.
CREATE TABLE file_index (
user_name string,
file string
);
If a user then deletes a file, you could only delete the reference which points to that file. The file would still be there for other users.
Could such a solution be of help?
from crate.
That is doable, but it would suck. Have to do a count(*) before every insert/delete.
from crate.
hi @ddorian
for inserts:
if you use the username and the digest of the file as primary key, there is no check required anymore on insert to prevent duplicates.
the "cleanup" of unused digests could be done asynchronously by a periodic task by selecting all used digests from your files table and comparing them to the existing digests. to prevent race conditions you could just delete files older than a day.
getting all stored digests of a blob table is currently not supported, but is already in progress and should make it into one of the next releases.
one other solution is to create an inode table with filenames like on normal filesystems, where the filename plays the same role as the username described above.
if you have other feature suggestions we would appreciate your feedback
thx, bernd
from crate.
So i can put anything i want in the 'digest' field when i write/upload a file ?
How are blobs stored? Is all the file stored in one server (not broken into pieces like riakcs) ?
from crate.
So i can put anything i want in the 'digest' field when i write/upload a file ?
i assume that you mean BLOB when you say file - so the answer is no, since the digest of a blob needs to be the hex encoded sha1 hash of the content (see also) https://crate.io/docs/current/blob.html . the digest is actually not a field it is the identifier of the blob, when a blob changes the digest changes too. note that there is currently no thing like a filesystem api on top of the crate BLOB support, but we have it on our roadmap.
How are blobs stored? Is all the file stored in one server (not broken into pieces like riakcs) ?
no blobs are not broken into pieces, they are stored as is. as of now the actual files on the filesystem can be verified via its name, since the name of the blob on the filesystem is the hash, this also makes blobs immutable.
from crate.
On Mon, May 5, 2014 at 2:52 PM, Bernd Dorn [email protected] wrote:
So i can put anything i want in the 'digest' field when i write/upload a
file ?i assume that you mean BLOB when you say file - so the answer is no, since
the digest of a blob needs to be the hex encoded sha1 hash of the content
(see also) https://crate.io/docs/current/blob.html . the digest is
actually not a field it is the identifier of the blob, when a blob changes
the digest changes too. note that there is currently no thing like a
filesystem api on top of the crate BLOB support, but we have it on our
roadmap.Why can't i store a unique-provided-by-the-client key instead of the
digest? Does the server confirm the digest?How are blobs stored? Is all the file stored in one server (not broken
into pieces like riakcs) ?no blobs are not broken into pieces, they are stored as is. as of now the
actual files on the filesystem can be verified via its name, since the name
of the blob on the filesystem is the hash, this also makes blobs immutable.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/735#issuecomment-42184206
.
from crate.
Why can't i store a unique-provided-by-the-client key instead of the
digest? Does the server confirm the digest?
yes, the server validates the digest, also it is used for routing the file to the right shard.
from crate.
Related Issues (20)
- Improve `ARRAY_LENGTH` performance for arrays within object arrays HOT 1
- Improve performance in HyperLogLogDistinctAggregation
- Invalid results when filtering with `ARRAY_LENGTH` on an array in array of objects HOT 2
- IndexOutOfBoundsException on query with ORDER BY in 3 nodes cluster HOT 3
- ShardInfo in NodeInfo MXBean is missing the schema name leading to duplicates HOT 4
- Table with dynamic column policy is silently failing first insert if it includes an empty array HOT 5
- Unexpected result when using empty `OBJECT` literal HOT 2
- Behaviour of numeric scale and casting inconsistent / unspecified HOT 2
- PostgreSQL wire protocol: type OID for text responses in prepared statements is invalid HOT 4
- PostgreSQL compatibility: SQL statement containing only comment not accepted HOT 3
- io.crate.integrationtests.LuceneQueryBuilderIntegrationTest#testNullOperators HOT 5
- Cannot add new column to a partitioned table after changing the number of shards HOT 2
- optimize lucene query generation for distinct from
- Avoid utf8->utf16 conversations (for grouping operations)
- UDFs with parameters incorrectly looked up with names all lowercase when used in GENERATED column HOT 1
- ClassCastException on selecting join field from table with objects HOT 2
- Unexpected results when using `OBJECT` nulls HOT 1
- Add CLI tool to recover a corrupted shard HOT 1
- Inconsistent type mapping when trying to insert scalar and array value for sub-column in `VALUES` statement. HOT 1
- Unexpected results when matching empty string with indexing disabled HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crate.