#1 2014-02-11 19:01:21

_db_
Member
From: Vancouver, BC, Canada
Registered: 2014-02-11
Posts: 4

Why MORMOT and not Apache Server?

Hi,
I am currently working on a bar-code scanning application written in Windows Mobile 5.0 (.NETCF 3.5) as a client and an Apache Shared Object module written in Delphi as a server component.
We use Apache server to host this Apache module to talk to our database.  Each operation on handheld side can read or update database immediately over the wireless network and there might be many devices talking to database at any time.

What would be pros and cons of using MORMOT instead of Apache Server?  Please elaborate why and if possible.
Much appreciated,
d

Offline

#2 2014-02-11 21:26:12

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

Re: Why MORMOT and not Apache Server?

I'm no expert in Apache, but I suspect that the thread usage with a Delphi Apache module, you are very likely to run one request at once.
It uses the WebBroker component, which is known to have serious performance issues.
To solve DataSnap stability problems, you need not only to avoid the Indy server, but by-pass WebBroker...
See http://robertocschneiders.wordpress.com … lity-tests

mORMot web server is just a very thin layer over the kernel-mode HTTP.sys web server.
See http://msdn.microsoft.com/en-us/library … p/aa364667
It is heavily multi-threaded, and consume very little resources.
This kernel-mode HTTP.sys web server is a first class citizen on Windows. It is IOCP driven, and run in kernel mode, so even if Apache can be very good at serving static content on Windows, it is not so optimized for serving dynamic content.

The whole mORMot stack has been developed with both performance and easiness in mind.
For instance, mORMot's interface-based services are very easy to work with, and consuming such services via JSON over a REST protocol is pretty easy, and standard (everyone is talking about REST and JSON since years).
WCF implements REST / JSON, and there are lighter alternatives if needed.
With REST and JSON, you can easily add web/AJAX or Android / iOS clients to your server.
See http://blog.synopse.info/post/2012/03/0 … d-services

In mORMot, the database layer is very optimized, and able to generate JSON content directly from the database buffers, without any costly translation.
See http://blog.synopse.info/post/2013/11/0 … ing-MS-SQL
And you have an ORM at hand, with RESTful remote access, for any further development.

Then mORMot is much more than this.
For instance, you have full stubbing/mocking features at hand - to follow SOLID principles, and use test-driven patterns.
And also logging, cache, security, authentication...
See http://synopse.info/fossil/wiki?name=SQLite3+Framework

But the learning curve with mORMot can be higher than working with Delphi RAD components.
Just pure code... like any serious project in C# or Java. smile
It may be a huge change of mind to switch from a RAD approach to the mORMot design.
But it is IMHO definitively worth it... ROI is there!

Offline

#3 2014-02-25 19:07:05

_db_
Member
From: Vancouver, BC, Canada
Registered: 2014-02-11
Posts: 4

Re: Why MORMOT and not Apache Server?

Hi ab,
Thank you so much for your reply. 

I have another question if you dont mind.  Would you mind recommending me (as a complete novice) where to start?
I am reading the documentation and it is lots of info.  I am going to read it but would you mind giving me keywords to look in documentation to implement marmot and replace use of Apache in my application that I described above.

Much appreciated.
_db_

Last edited by _db_ (2014-02-26 17:13:35)

Offline

Board footer

Powered by FluxBB