#1 2013-02-06 10:51:49

Leander007
Member
From: Slovenia
Registered: 2011-04-29
Posts: 113

mORMot and AnyDAC

Embarcadero bought AnyDAC.
Maybe would be fine to have a "wrapper" to this "DB universal layer" in future too.
I hope that AnyDAC would be available to Delphi Pro users too (Marco Cantu words about that:"we are trying to be a little more flexible in terms SKUs and versions"), to be really useful.
I only don't know what will happen with FPC/Lazarus support (Delphi does not compile for Linux yet)?!


"Uncertainty in science: There no doubt exist natural laws, but once this fine reason of ours was corrupted, it corrupted everything.", Blaise Pascal

Offline

#2 2013-02-06 16:49:16

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

Re: mORMot and AnyDAC

I'm currently incorporating a NexusDB direct access layer within mORMot SynDB units.
It will rely on the official DB.pas layer, and is mostly about using standard VCL DB components (with some NexusDB special cases).

I will make it work as expected for NexusDB, then certainly extract an "abstracted" version, able to server as SynDB layer for any VCL DB component.
This is already in the official mORMot roadmap.

Therefore, DBExpress or AnyDAC components would be able to integrated with mORMot directly.
I suspect that the TDataSet layer will make it slower than the orginal SynDB architecture, and won't make it compatible with all editions of Delphi (mORMot SynDB works with Delphi "Starter"!), but it could be very handy.

Offline

#3 2013-02-06 18:50:08

Junior/RO
Member
Registered: 2011-05-13
Posts: 210

Re: mORMot and AnyDAC

ab wrote:

I'm currently incorporating a NexusDB direct access layer within mORMot SynDB units.
It will rely on the official DB.pas layer, and is mostly about using standard VCL DB components (with some NexusDB special cases).

I will make it work as expected for NexusDB, then certainly extract an "abstracted" version, able to server as SynDB layer for any VCL DB component.

Good news! I have hundreds of applications deployed using DBISAM, without ODBC, and this apps need to switch to multi-tiers, then, when you release the code for the NexusDB, I believe I can adapt it for DBISAM.

Offline

#4 2013-02-07 20:48:26

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

Re: mORMot and AnyDAC

That's it.

I've introduced SynDBDataset.pas unit, implementing DB.pas TDataset-based direct access classes (i.e. abstract TQuery-like) with mORMot SynDB classes (and therefore external tables for the framework ORM).
See http://synopse.info/fossil/info/793552e1a0

The NexusDB new driver is based on it.
See http://synopse.info/fossil/info/bf8ebe2e0f

Performance is not bad - we tried to minimize the memory copies.

NexusDB embedded engine tested with latest V3.1100 Free edition gives the following benchmark:

NexusDB wrote:

{
    "Engine": "NexusDB",
    "CreateTableTime": "43.42ms",
    "NumberOfElements": 5000,
    "InsertTime": "1.03s",
    "InsertRate": 4809,
    "InsertBatchTime": "729.51ms",
    "InsertBatchRate": 6853,
    "InsertTransactionTime": "862.67ms",
    "InsertTransactionRate": 5795,
    "InsertBatchTransactionTime": "564.22ms",
    "InsertBatchTransactionRate": 8861,
    "ReadOneByOneTime": "3.62s",
    "ReadOneByOneRate": 1379,
    "ReadAllVirtualTime": "35.42ms",
    "ReadAllVirtualRate": 141147,
    "ReadAllDirectTime": "23.62ms",
    "ReadAllDirectRate": 211640,
    "ClientCloseTime": "65us"
}

In fact, this is very close to the JET/MSAccess engine, accessed locally via OleDB.

chart?chtt=Insertion+speed+%28rows%2Fsecond%29&chxl=1:|Batch+Trans|Trans|Batch|Direct&chxt=x,y&chbh=a&chs=600x300&cht=bhg&chco=3D7930,3D8930,309F30,6070F0,5070E0,40C355,65D055,80C1A2,F05050,F0A280&chxr=0,0,435881&chds=0,435881,0,435881,0,435881,0,435881,0,435881&chd=t:542,553,91952,103863|928,804,89763,117882|84006,104166,98753,125059|292722,429848,292860,435881|293754,431853,291766,353257|554,566,97140,125871|839,433,104576,130801|95073,118343,106874,140142|459,60990,1052,54923|506,512,1215,1182|4272,4437,4926,5059|4809,6853,5795,8861&chdl=SQLite3+%28file+full%29|SQLite3+%28file+off%29|SQLite3+%28mem%29|TObjectList+%28static%29|TObjectList+%28virtual%29|SQLite3+%28ext+file+full%29|SQLite3+%28ext+file+off%29|SQLite3+%28ext+mem%29|Oracle|ODBC+Oracle|Jet|NexusDB]
chart?chtt=Insertion+speed+%28rows%2Fsecond%29&chxl=1:|NexusDB|Jet|ODBC+Oracle|Oracle|SQLite3+%28ext+mem%29|SQLite3+%28ext+file+off%29|SQLite3+%28ext+file+full%29|TObjectList+%28virtual%29|TObjectList+%28static%29|SQLite3+%28mem%29|SQLite3+%28file+off%29|SQLite3+%28file+full%29&chxt=x,y&chbh=a&chs=600x300&cht=bhg&chco=3D7930,3D8930,309F30,6070F0,5070E0,40C355,65D055,80C1A2,F05050,F0A280&chxr=0,0,435881&chds=0,435881,0,435881,0,435881,0,435881,0,435881,0,435881,0,435881,0,435881,0,435881,0,435881,0,435881,0,435881&chd=t:542,928,84006,292722,293754,554,839,95073,459,506,4272,4809|553,804,104166,429848,431853,566,433,118343,60990,512,4437,6853|91952,89763,98753,292860,291766,97140,104576,106874,1052,1215,4926,5795|103863,117882,125059,435881,353257,125871,130801,140142,54923,1182,5059,8861&chdl=Direct|Batch|Trans|Batch+Trans

chart?chtt=Read+speed+%28rows%2Fsecond%29&chxl=1:|All+Direct|All+Virtual|By+one&chxt=x,y&chbh=a&chs=600x300&cht=bhg&chco=3D7930,3D8930,309F30,6070F0,5070E0,40C355,65D055,80C1A2,F05050,F0A280&chxr=0,0,738552&chds=0,738552,0,738552,0,738552&chd=t:21754,318228,367457|27089,437905,436376|122225,444800,452529|295229,738552,727802|281848,231846,686436|131741,241908,448671|124350,236094,437062|128955,235427,434782|1238,72941,83508|1170,36003,37921|2719,126246,181990|1379,141147,211640&chdl=SQLite3+%28file+full%29|SQLite3+%28file+off%29|SQLite3+%28mem%29|TObjectList+%28static%29|TObjectList+%28virtual%29|SQLite3+%28ext+file+full%29|SQLite3+%28ext+file+off%29|SQLite3+%28ext+mem%29|Oracle|ODBC+Oracle|Jet|NexusDB
chart?chtt=Read+speed+%28rows%2Fsecond%29&chxl=1:|NexusDB|Jet|ODBC+Oracle|Oracle|SQLite3+%28ext+mem%29|SQLite3+%28ext+file+off%29|SQLite3+%28ext+file+full%29|TObjectList+%28virtual%29|TObjectList+%28static%29|SQLite3+%28mem%29|SQLite3+%28file+off%29|SQLite3+%28file+full%29&chxt=x,y&chbh=a&chs=600x300&cht=bhg&chco=3D7930,3D8930,309F30,6070F0,5070E0,40C355,65D055,80C1A2,F05050,F0A280&chxr=0,0,738552&chds=0,738552,0,738552,0,738552,0,738552,0,738552,0,738552,0,738552,0,738552,0,738552,0,738552,0,738552,0,738552&chd=t:21754,27089,122225,295229,281848,131741,124350,128955,1238,1170,2719,1379|318228,437905,444800,738552,231846,241908,236094,235427,72941,36003,126246,141147|367457,436376,452529,727802,686436,448671,437062,434782,83508,37921,181990,211640&chdl=By+one|All+Virtual|All+Direct

But the SQLite3 engine is still much faster at reading, and BATCH insert.
Due to its truly ACID nature, inserts of one row is still slower for SQLite3, but it is by design/safety.

Our internal TObjectList in-memory engine (with on purpose disk persistence) still gives amazing results.

I will publish some blog article soon.

Offline

#5 2013-02-08 21:13:43

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

Re: mORMot and AnyDAC

A dedicated "SynDBDataset" sub-folder has been created in the repository, to contain all SynDBDataset-based database provider.
See http://synopse.info/fossil/dir?name=SynDBDataset

The SynDBNexusDB.pas unit has been moved within this sub-folder, and a SynDBBDE.pas unit has been added.
BDE performance is not so good, indeed. When working with Oracle, it is pretty slow, especially when retrieving data.
You can take a look at it, and discover how easy it is to add any DB.pas based datasource to our SynDB* classes, therefore to mORMot's client-server ORM.

Any help about introducing new TDataset providers units is welcome!
You can just start from SynDBBDE.pas unit, and create your own wrapper.
Could be easy enough to work with.

I've for instance just added SynDBUniDAC.pas unit, for direct interface of DevArt UniDAC database acccess library with SynDB classes and mORMot Client-Server ORM feature.
(not fully tested, but you have got the idea)

Feedback, any code contribution and/or testing are welcome!

Offline

Board footer

Powered by FluxBB