Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 15 total
Thread OT: Suggestion on a middleware framework for REST/JSON and EDB?
Sun, Oct 16 2016 9:23 PMPermanent Link

Mario Enríquez

Open Consult

Hi folks,

Sorry if this seems a little off topic but it is, at least, indirectly related to EDB.

I'm writing a mobile client (Android, iOS) with Delphi 10.1 that would be accessing a EDB through a REST/JSON web service.

Is this middle tier that I wondering what would be the best approach, initially I thought I'll build it with ASP.NET Web API as I already have the .NET drivers for EDB. This choice is still a possibility, but I wonder what other fellow Delphi/EDB developer are doing...

I've rule out DataSnap, in a previous project I found it to be slow and quirky, since then I no longer upgraded to the enterprise edition, so this is not a option.

The solution/framework I'm looking should be free or at least a one time payment/royalty free distribution kind of deal.

This server "middleware" would be hosted in the cloud (amazon aws most likely) and in some cases  in a customer in-house server,
hence why it should be royalty free. Wink

I've hear good reviews on Real Thin Client, what do you guys think?

Regards,
Mario
Mon, Oct 17 2016 8:50 AMPermanent Link

Raul

Team Elevate Team Elevate

On 10/16/2016 9:23 PM, Mario Enr�quez wrote:
> Is this middle tier that I wondering what would be the best approach, initially I thought I'll build it with ASP.NET Web API as I already have the .NET drivers for EDB. This choice is still a possibility, but I wonder what other fellow Delphi/EDB developer are doing...
> I've rule out DataSnap, in a previous project I found it to be slow and quirky, since then I no longer upgraded to the enterprise edition, so this is not a option.
> The solution/framework I'm looking should be free or at least a one time payment/royalty free distribution kind of deal.

In our case we currently have a home-brew solution but have been looking
at mORMot (http://synopse.info/fossil/wiki?name=SQLite3+Framework) which
is completely free as well as TMS.

mORMot has lot of docs but they are not exactly "getting started" type
so it has bit of a learning curve (so do others as well).

I know there have been reports here (mostly on EWB NGs) about RTC and
RemObjects and TMS which all are commercial.

While not directly designed for this purpose Elevate Web Builder Web
Server (EWB) provides JSON output and delphi modules and could be used
(and you also get the EWB if you ever wanted to write web front end).

I will assume longer term Tim will incorporate this into EDB server as
well (web service) but that's not there yet.

Raul
Mon, Oct 17 2016 9:39 AMPermanent Link

Mario Enríquez

Open Consult

Thank you Raul,

I also hear good things about mORMot, but frankly I was intimidated by it and the whole ORM thing.

I understand that you can pick and choose which elements of mORMot  to use (Communications, ORM, etc..), right?

Are you planning to integrate mORMot with EDB? If you decide to go the way please post your experience here in the EDB forums, it would be quite interesting.

And thank you for the tip on EWB modules, I would take a look for sure.

Regards,
Mario
Mon, Oct 17 2016 11:15 AMPermanent Link

Raul

Team Elevate Team Elevate

On 10/17/2016 9:39 AM, Mario Enr�quez wrote:

> I understand that you can pick and choose which elements of mORMot  to use (Communications, ORM, etc..), right?

I have not gotten that far into it but generally yes that's my
understanding - you can use parts of it (like rest/json only).

> Are you planning to integrate mORMot with EDB? If you decide to go the way please post your experience here in the EDB forums, it would be quite interesting.

It's a future thing at this time - investigating still. Realistically
not doing anything with it til later in 2017.

Raul
Sat, Oct 22 2016 6:49 PMPermanent Link

Peter Evans


>>I'm writing a mobile client (Android, iOS) with Delphi 10.1 that would be accessing a EDB through a REST/JSON web service.

Are you using FireMonkey on the clients?
Sat, Oct 22 2016 6:57 PMPermanent Link

Peter Evans

Assuming that you are using FireMonkey then mORMot may be a possibility for you.

If so, go to the Embarcadero Discussion Forum and look at the thread 'DataSnap changes from XE6 to Berlin'.
(I commenced this thread.)

See my replies of 25 Aug 16 for links to some source code which may be useful to you. The source code has in it comments at the points where you can access a database. In my case the database is ElevateDB.

Regards,
 Peter Evans
Sun, Oct 23 2016 6:49 PMPermanent Link

Mario Enríquez

Open Consult

Hi Peter,

I download mORMot last week and having reading and trying to find my way around. What a great and (complex) please of code.

I'll be looking for the thread that you mention at Embarcadero forums, unfortunately DataSnap is not available to me any more, I just downgrade From XE5 Enterprise to 10.1 Berlin Pro...

And yes, I using FMX mobile from Berlin 10.1 to build the app.

Regards,
Mario
Mon, Oct 24 2016 12:47 AMPermanent Link

Mario Enríquez

Open Consult

Peter,

I've downloaded the testmormotgroup1_toab2.zip file.

First, I would like thank you, the straight implementation helps greatly in getting my head around mORMot!

Secondly, you mention something about  the database access calls but I didn't find it  (just did a quick look around TestMormotServer.dpr, mind you..).

And last, and I hope you don't mind me asking this, but I wonder how the thread safe part should be implemented when accessing EDB.  My planned approach is to have several TDataModule's (one for each Interface) with its on TEDBSession and TEDBDatabase and create/destroy it in each call. But not liking the performance overhead associated with it.

What was your approach?

Regards,
Mario
Tue, Nov 1 2016 3:07 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Mario,

<< And last, and I hope you don't mind me asking this, but I wonder how the thread safe part should be implemented when accessing EDB.  My planned approach is to have several TDataModule's (one for each Interface) with its on TEDBSession and TEDBDatabase and create/destroy it in each call. But not liking the performance overhead associated with it.  >>

That's a common performance issue with app servers, and is one that even PHP struggles with in terms of session creation/destruction (there's an option to allow sessions to "persist" between calls).  It's sort of: "to cache, or not to cache, that is the question." Wink

The trade-off with caching is that you need a mechanism to reset member variables, class instances, etc. to their "default" state for each usage without incurring as much overhead as a full create/destroy cycle would have, *or* you need your code to be able to adapt to a minimally-reset environment that may have "left-overs" from a previous usage.  To complicate matters further, in some cases there are security concerns with respect to how the data modules, sessions, etc. are re-used.

Personally, I would try to go with a data module pool and simply make sure that the tables, queries, etc. on each data module are closed/re-opened for each usage, and see what kind of performance you get.  If you need the code for a thread-safe pool like this, just let me know and I'll post something.  It's not the absolute fastest/most concurrent that it could be because it uses a critical section around the stack manipulation, but it's good enough for most uses.

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Nov 2 2016 1:25 AMPermanent Link

Mario Enríquez

Open Consult

Thank you Tim,

I would really appreciated if you could share the thread safe code / pooling that you mention.

Regards,
Mane
Page 1 of 2Next Page »
Jump to Page:  1 2
Image