Replies: 5 comments 2 replies
-
|
ArcadeDB doesn't support BLOB records like OrientDB. However, you can store binary data in record properties:
Of course, solution 1 is the most efficient. To emulate the BLOB record you could create a Blob type with only one property of binary type and use that. Example: public class BLOBTest extends TestHelper {
@Override
public void beginTest() {
database.transaction(() -> {
DocumentType type = database.getSchema().createDocumentType("Blob");
type.createProperty("binary", Type.BINARY);
});
}
@Test
public void testWriteAndRead() {
database.transaction(() -> {
final MutableDocument blob = database.newDocument("Blob");
blob.set("binary", "This is a test".getBytes());
blob.save();
});
database.transaction(() -> {
final Document blob = database.iterateType("Blob", false).next().asDocument();
Assertions.assertEquals("This is a test", new String( blob.getBinary("binary")));
});
}
}NOTE: The example above compiles only with the latest 22.10.1-SNAPSHOT because of the new About the other 2 questions: |
Beta Was this translation helpful? Give feedback.
-
|
Thank you @lvca. I am just adding SQL commands which might be useful for newcomers how to use binary data over HTTP/SQL. Create BINARY property via SQL: First take your binary data, e.g., "light work." and generate base64 representation (you can use online tools for ASCII or HEX transformation into base64 for initial manual tests). In our case, we get "bGlnaHQgd29yay4=". Then execute |
Beta Was this translation helpful? Give feedback.
-
|
@lvca i've seen in documentation that the BINARY type has a 2GB limit, but there is no limit mentioned in string. Can string store larger then that, for example 10GB, of base64 data? If yes; is it wise or should we look for an external storage coupling for those? |
Beta Was this translation helpful? Give feedback.
-
|
@lvca, I agree with the approach to save the large files directly into file system while keeping only the path in ArcadeDB, but I think there should be some unified API for this. For instance, I would like to use ArcadeDB with High Availability mode, how the files stored in the file systems should be replicated among the servers? |
Beta Was this translation helpful? Give feedback.
-
|
I think even 2GB binary is overkill for the purpose of this DB.. My two cents is if you need more then a few KB of binary data to be stored, I am assuming its something a data to be interfpreted as a file. Arcadedb can "recommend" something.. As Minio is no more for S3 store, there are a few "open source" rusty initiative have jumped in and they be friends for such case. If its modular, then any S3 (or equivalent store) can be "accoupled" |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I have few questions on ArcadeDB since I am in the decision process if I should choose OrientDB or ArcadeDB for my project.
ORecordBytes(https://orientdb.com/docs/last/java/Binary-Data.html).ORecordBytesin OrientDB?Thank you,
Michael
Beta Was this translation helpful? Give feedback.
All reactions