#1 2020-04-02 16:22:48

AOG
Member
Registered: 2014-02-24
Posts: 490

DDD with Blobs

Hi Ab,

For a rather big project, I have switched towards using DDD.
This project also wants to store documents, spreadsheets and photos into the [DDD] database.
However, DDD does not allow for TSQLRawBlob to be stored.

Cause (inside mORMotDDD):

soInsert: ndx := fBatch.Add(fCurrentORMInstance,true,fFactory.fAggregateID<>nil);

I would like to propose to add an option to allow for this:

soInsert: ndx := fBatch.Add(fCurrentORMInstance,true,fFactory.fAggregateID<>nil,ALL_FIELDS);

AFAIK, at this moment, TSQLRawBlob cannot be reached or handled by DDD.
I guess it cannot do harm to enable all fields for DDD.
Its the choice of the user (and me) to use TSQLRawBlob , for good reasons I hope ... ;-)

Offline

#2 2020-04-03 10:02:22

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: DDD with Blobs

Please check https://synopse.info/fossil/info/55e1a121b6

Note that inserting BLOBs into the Batch won't be very efficient, since data will be Base-64 serialized in the Batch JSON.
We don't usually use this DDD command set for Blob processing, but access directly the database using efficient BLOB methods.

Offline

#3 2020-04-03 12:06:17

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,534
Website

Re: DDD with Blobs

From my practice storing documents in BLOB can cause some troubles. I wrote article about my experience with storing files (original content is in Russian, hope google translate without mistakes)

Offline

#4 2020-04-03 12:08:53

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: DDD with Blobs

Thanks for this quick fix !
FYI, I will not use batch-transfer for Blobs. The document database is a separate database, synchronized by using RemoteDataCreate.
However, the same business logic is used to access both databases. That is the reason this was a needed feature in this business case.

Offline

#5 2020-04-03 12:10:54

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: DDD with Blobs

@mpv
I agree. That is why the data is being split between the two databases with separate servers.
I have no other choice but to store documents inside the separate database. It must be transportable and local.

Offline

Board footer

Powered by FluxBB