#1 2014-10-24 18:18:54

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

MVC/MVVM Web Applications with mORMot!

We almost finished implementing a long-standing feature request, introducing MVC / MVVM for Web Applications (like RubyOnRails) in mORMot.
This is a huge step forward, opening new perspectives not only to our framework, but for the Delphi community.

The mORMot point of view is unique, and quite powerful, since it is integrated with other parts of our framework, as its ORM/ODM or interface-based services.
Of course, this is a work in progress, so you are welcome to put your feedback, patches or new features!

This is the forum thread for http://blog.synopse.info?post/2014/10/2 … App-mORMot

See http://blog.synopse.info/public/mORMot/mORMotMVC.pdf for the mORMot MVC Draft Documentation!

Offline

#2 2014-10-25 16:45:38

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

Re: MVC/MVVM Web Applications with mORMot!

Sample "30 - MVC Server" will now handle tags (categories) for articles.

Tags are stored as a dynamic array of integers within TArticle.Tags, without any pivot table.
They are displayed as text, in alphabetic order.

Performance of the BLOG engine is awesome: if you create 200,000 fake blog articles and 400,000 comments (written in less than 20 seconds in the SQLite3 DB - just define FAKEDATA_ARTICLESCOUNT=200000 in MVCViewModel.pas and erase the previous .db), the web application works as fast as the light, including tag search, and simple paging. The DB contains more than 340 MB of text...
WordPress administrators would start to cry, I suppose... smile

See http://synopse.info/fossil/info/70f7a1a823

Offline

#3 2014-10-25 19:38:07

miab3
Member
From: Poland
Registered: 2014-10-01
Posts: 188

Re: MVC/MVVM Web Applications with mORMot!

@ab,

R 1.18.407
What happened to the Category table in MVCServer.db?

Michal

Add:
It is okay.
It SynDBExplorer remembered the old structure.
(What is not OK).

Michal

Last edited by miab3 (2014-10-25 20:15:42)

Offline

#4 2014-10-25 21:56:11

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

Re: MVC/MVVM Web Applications with mORMot!

The TSQLCategory has been replaced by a TSQLTag table, and the tags are stored as dynamic array within TSQLArticle.Tags.
Welcome to the "data sharding" world.
I'm convinced we can write a whole BLOG server without any JOINed query.
smile

Offline

#5 2014-10-27 09:06:14

miab3
Member
From: Poland
Registered: 2014-10-01
Posts: 188

Re: MVC/MVVM Web Applications with mORMot!

@ab

There is something wrong with the dates(years) in the Archives list.
R 1.18.410

Michal

Last edited by miab3 (2014-10-27 09:08:13)

Offline

#6 2014-10-27 10:33:20

lele9
Member
Registered: 2011-10-28
Posts: 170

Re: MVC/MVVM Web Applications with mORMot!

great work ab!
do you think is possible the same structure for desktop application?

Offline

#7 2014-10-27 11:30:39

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

Re: MVC/MVVM Web Applications with mORMot!

miab3 wrote:

There is something wrong with the dates(years) in the Archives list.

In fact, with 200,000 articles in the DB, the computed dates are huge, in the fake data.
But they are correct. Just try with 200 articles.

lele9 wrote:

do you think is possible the same structure for desktop application?

Yes, it is possible, and even planned.

As I wrote above, still need to write some automated mapping for writing Views as VCL/FMX, and share the same TMVCApplication insteand.
For instance, we may expect UI component names to match the controller  (e.g. TEdit/TLabel following parameters names, TButton following methods names).
Then write only some small events in RAD, only if needed.

Offline

#8 2014-10-27 17:08:50

miab3
Member
From: Poland
Registered: 2014-10-01
Posts: 188

Re: MVC/MVVM Web Applications with mORMot!

@ab

I recall my request.
Can you show how to effectively use external database by ZEOS in this example?

Michal

Offline

#9 2014-10-27 18:52:25

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

Re: MVC/MVVM Web Applications with mORMot!

Now sample "30 MVC Server" work with an external PostgreSQL server
- either with Zeos/ZDBC or FireDAC libraries.
See http://synopse.info/fossil/info/5569b56688

I discovered that when using Zeos/ZDBC, memory use increases a lot, eating hunderths of MB.
There is no memory leak reported at FastMM4 level in the application, and with FireDAC, it uses small amount of RAM (around 60 MB).

Note that our direct SQLite3 database gives the better performance, use a much lower amount of memory, and consume less disk space for its storage.
Even with 200,000 articles and 400,000 comments in the DB.
External DB is just for demo purpose, here.

Offline

#10 2014-10-27 18:59:03

miab3
Member
From: Poland
Registered: 2014-10-01
Posts: 188

Re: MVC/MVVM Web Applications with mORMot!

@ab

Thanks.

Michal

Offline

#11 2014-10-27 19:25:10

EgonHugeist
Member
From: Germany
Registered: 2013-02-15
Posts: 190

Re: MVC/MVVM Web Applications with mORMot!

Arnaud,

does this sample use LOB's in any kind?

Offline

#12 2014-10-27 19:30:56

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

Re: MVC/MVVM Web Applications with mORMot!

@Egon
The "content" text fields (e.g. for blog articles) have no maximum size set - so they are defined as "TEXT".
So I hope they are not handled as CLOB...
If ZDBC handles TEXT fields as LOB, and has problems with it, this is a big issue.

In fact, TEXT is the recommended way of creating a table with some text in PostgreSQL. See http://www.postgresql.org/docs/9.3/stat … acter.html
We should be able to handle "TEXT" columns as fast as possible, even with small content.

Offline

#13 2014-10-27 20:09:50

EgonHugeist
Member
From: Germany
Registered: 2013-02-15
Posts: 190

Re: MVC/MVVM Web Applications with mORMot!

Of course, they are threaded as CLOB, everything else would be wrong. Btw. your could also use VARCHAR with no length.

Hundrets MB of mem... hard to say. NOTE: Zeos internals do cache a loads of of Informations, instead of calling the Server again. Espezially for the slow PostgreSQL-server. This migth be one of Zeos performance advantages against FireDac. But this consumes Memory, of course.
Digging in.. the TZPGResultSet doesn't have a spezial GetUTF8String override yet. Currently i'm working on another refactoring: DO NOT DETERMINE all Columns-Information for !Reopened! reseultsets twice, just reset positions and handles instead. Slightly i've to many locale WC's. But having a look to the miising GetUTF8String override will be next.

May i ask if this example also uses ColumnsToJSON proc?

Last edited by EgonHugeist (2014-10-27 20:10:23)

Offline

#14 2014-10-27 20:53:34

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

Re: MVC/MVVM Web Applications with mORMot!

Yes it uses json as returned by the db...

But in this case firedac is much better.

We can try with char with a max size, and check if it works better...

Offline

#15 2014-10-27 21:07:54

EgonHugeist
Member
From: Germany
Registered: 2013-02-15
Posts: 190

Re: MVC/MVVM Web Applications with mORMot!

No never use CHAR fields IMHO. Better would be VARCHAR(x) fields in all cases. Else you would run either into trailing spaces issues or (this is what Zeos is doing) got a newly performance drop, because we do dec() length of string as long trailing spaces are used!

Instead of, i quickly commited a PGResultSet GetUTF8String override. Patch done R3435 \testing-7.2 (SVN).
This simply suppresse creating LOB buffers and directly return a UTF8String. Hope the Memory usage will decrease a bit?

Offline

#16 2014-10-27 22:08:40

miab3
Member
From: Poland
Registered: 2014-10-01
Posts: 188

Re: MVC/MVVM Web Applications with mORMot!

@ab

In the version of PostgreSQL(R 1.18.416; ZEOS 7.2.0-beta R 3434(and R 3435)) can not login(Synopse/synopse).
I get an error:


Error Page

Low-level #400 Error occurred with the following message:

Wrong logging information

Error context:

{
  "Msg": "Wrong logging information",
  "Scope": null,
  "main": {
    "pageName": "Error",
    "blog": {
      "Title": "mORMot BLOG",
      "Language": "en",
      "Description": "Sample Blog Web Application using Synopse mORMot MVC",
      "Copyright": "&copy;2014 <a href=http://synopse.info>Synopse Informatique</a>",
      "About": "Bla? Ble, bla ble, bli bla ble blu ble. Blo blu. Bla ble, blu bla blu blu bli blu blu bla, bli blo blo blo bli bli blu blo.\r\nBlo bla!"
    },
    "session": null,
    "archives":
    [
      {
        "PublishedMonth": 24368,
        "FirstID": 2001
      },
      {
        "PublishedMonth": 24367,
...

Michal

Last edited by miab3 (2014-10-27 22:22:00)

Offline

#17 2014-10-28 06:12:20

Pyjama
Member
Registered: 2014-07-07
Posts: 9

Re: MVC/MVVM Web Applications with mORMot!

You typed it correctly?

This error says, that the login information is not correct.

Maybe you've changed something? Another way would be to look up if the User exists in the database.

If there is a User, you just have to know the right password.

Last edited by Pyjama (2014-10-28 06:14:11)

Offline

#18 2014-10-28 06:38:50

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

Re: MVC/MVVM Web Applications with mORMot!

Both lowercase synopse... username and password are case sensitive!
smile

Offline

#19 2014-10-28 07:01:57

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Re: MVC/MVVM Web Applications with mORMot!

Thanks Arnaud, will find sometime to look into your MVC design!


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#20 2014-10-28 09:57:01

miab3
Member
From: Poland
Registered: 2014-10-01
Posts: 188

Re: MVC/MVVM Web Applications with mORMot!

@ab

Indeed.
But SQLite allowed to log in Synopse / synopse - why?

Michal

Offline

#21 2014-10-28 10:13:06

miab3
Member
From: Poland
Registered: 2014-10-01
Posts: 188

Re: MVC/MVVM Web Applications with mORMot!

@ab,

A bigger problem is the Firebird by ZEOS.
Not only did to login but does not display Articles.
The database is created, tags are counted.
(I replaced all the LIMIT on ROWS.)
Could you even try the Firebird, please.

Michal

Offline

#22 2014-10-28 13:15:27

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

Re: MVC/MVVM Web Applications with mORMot!

EgonHugeist wrote:

Instead of, i quickly commited a PGResultSet GetUTF8String override. Patch done R3435 \testing-7.2 (SVN).
This simply suppresse creating LOB buffers and directly return a UTF8String. Hope the Memory usage will decrease a bit?

This sadly did NOT fix the issue!
Now memory still grows, perhaps a little slower, but it quickly reached more than 1 GB.
Whereas FireDAC did use less than 20 MB AFAIR.

Use of PostgreSQL client consumes much more memory than SQLite3 itself, and more that the stored data. sad

Update:
In fact, I forced to use a single connection for every thread, and now it uses very little memory....
See http://synopse.info/fossil/info/d8240c4f1c
Sounds much more stable now.

Offline

#23 2014-10-28 13:51:04

EgonHugeist
Member
From: Germany
Registered: 2013-02-15
Posts: 190

Re: MVC/MVVM Web Applications with mORMot!

ab wrote:

This sadly did NOT fix the issue!
Now memory still grows, perhaps a little slower, but it quickly reached more than 1 GB.
Whereas FireDAC did use less than 20 MB AFAIR.

Use of PostgreSQL client consumes much more memory than SQLite3 itself, and more that the stored data. sad

I know that, but keeps temporary allocated memory much smaller on each GetUTF8String().

Note:
1. since your project works with threads and each thread has a new IZConnection the memory grows because of Cached metadata informations.
2. for PostgreSQL the is a second cache, called TableInfoCache.

supressing the MetaData-Caching:

IZConnection.SetUseMetadata(False);

Well i've commited one little patch R3436 \testing-7.2
suppressing TableInfoCache:

'NoTableInfoCache=True' 

to the PostgreSQL-ZURL.Properties. This suppresses caching table informations we added for the NativeResultSets.


All in one.. You wouldn't notice such memory consumtion if there is just one connection...

Offline

#24 2014-10-28 13:57:44

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

Re: MVC/MVVM Web Applications with mORMot!

Update:
In fact, I forced to use a single connection for every thread, and now it uses very little memory....
See http://synopse.info/fossil/info/d8240c4f1c
Sounds much more stable now.

Offline

#25 2014-10-28 14:08:17

EgonHugeist
Member
From: Germany
Registered: 2013-02-15
Posts: 190

Re: MVC/MVVM Web Applications with mORMot!

That's cool. Looks like you also have a solution for everything.
Note accordingly stable behavior: There is NO difference to see. Just the cached data each connection uses grows the memory.

Anyway, i propose you add my suggested code and some comments to the ZeosDB files, just to notify users about the possibilities...

In addition.. IIRC are you calling the Zeos-MetaData only one on CreateMissingTables, right? So from my point of view the whole caching stuff makes no sence for your framework, Arnaud.
Think about it...

Last edited by EgonHugeist (2014-10-28 14:14:26)

Offline

#26 2014-10-28 14:14:08

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

Re: MVC/MVVM Web Applications with mORMot!

miab3 wrote:

A bigger problem is the Firebird by ZEOS.
Not only did to login but does not display Articles.

I've added sample MVCServerFirebird.dpr.
Sounds fine on our side, as soon as the DB properties are properly defined.
See http://synopse.info/fossil/info/23ea40f6cd

No need to change the SQL with LIMIT/OFFSET: the ORM will do it for you!
smile

Offline

#27 2014-10-28 14:33:21

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

Re: MVC/MVVM Web Applications with mORMot!

EgonHugeist wrote:

In addition.. IIRC are you calling the Zeos-MetaData only one on CreateMissingTables, right? So from my point of view the whole caching stuff makes no sence for your framework, Arnaud.
Think about it...

So what we should we do in SynDBZeos?

Is http://synopse.info/fossil/info/ed5b4034df correct?

Offline

#28 2014-10-28 14:39:17

EgonHugeist
Member
From: Germany
Registered: 2013-02-15
Posts: 190

Re: MVC/MVVM Web Applications with mORMot!

ab wrote:

So what we should we do in SynDBZeos?

Is http://synopse.info/fossil/info/ed5b4034df correct?

Looks like good start.

To be clear:
Am i right you're calling the Zeos-MetaInformations only once an CreateMissingTables?

If so than you can simply flush the cache by calling:

IZConnection.GetMetadata.ClearCache;

if CreateMissingTables is done. What do you think? You can execute it by default from my point of view..

Offline

#29 2014-10-28 14:43:15

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

Re: MVC/MVVM Web Applications with mORMot!

Yes, metadata is used only once at startup, in CreateMissingTables.

We may clear the cache.
But is it worth it?
I suspect it has nothing to do with memory consumption during the process, right?

Offline

#30 2014-10-28 14:51:55

EgonHugeist
Member
From: Germany
Registered: 2013-02-15
Posts: 190

Re: MVC/MVVM Web Applications with mORMot!

I suspect it has nothing to do with memory consumption during the process, right?

Hard to say. The two caches MAY consume loads of mem dependend to count of (GetTables + (GetColumns, GetPrimaryKeys/GetIndexInfo) per table)) x CountOf(Connections)
In addition there is the TableInfoCache for PostreSQL only.

So if i would know how this MVC samples do work, i could give you a true answer.. I'm wondering the memory grows during the process..
Propose you test it with multithreading and flushed caches? I would like to know results...

Edit: I really see nothing else which can produce such memory consuming behavior, Arnaud.

Last edited by EgonHugeist (2014-10-28 14:55:35)

Offline

#31 2014-10-28 15:04:54

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

Re: MVC/MVVM Web Applications with mORMot!

If I clear the cache in sample MVCServerPostgreSQL.dpr:

        aServer.CreateMissingTables;
        (aExternalDB.MainConnection as TSQLDBZEOSConnection).Database.GetMetadata.ClearCache;
        aApplication := TBlogApplication.Create(aServer);

I do not see any difference in memory consumption.

So I would not had it in the main trunk, since it would somewhat difficult to implement, for no benefit.

I guess we still need to do some testing of our solution... in true multi-thread.

Offline

#32 2014-10-28 15:10:42

EgonHugeist
Member
From: Germany
Registered: 2013-02-15
Posts: 190

Re: MVC/MVVM Web Applications with mORMot!

You can safely use both:

IZConnection.GetMetadata.ClearCache;

pesits since i know Zeos.

'NoTableInfoCache=true'

Is a String property which simply has no effect for older Revisions.

During the process only the TableInfoCache can grow the memory until all informations are collected. May i ask if FireBird behaves equal?

Offline

#33 2014-10-28 15:58:15

miab3
Member
From: Poland
Registered: 2014-10-01
Posts: 188

Re: MVC/MVVM Web Applications with mORMot!

@ab, @EgonHugeist

Thanks for the example of the Firebird. It works and consumes much less memory than PostgreSQL
but now:
mORmot r1.18.428 and ZEOS 7.2 r3436
PostgreSQL also consumes much less memory than previously.

Michal

Last edited by miab3 (2014-10-28 16:10:28)

Offline

#34 2014-10-28 16:49:37

miab3
Member
From: Poland
Registered: 2014-10-01
Posts: 188

Re: MVC/MVVM Web Applications with mORMot!

@ab

Now, unfortunately, there was an error when (after) Add Comment by synopse:


Error Page

Low-level #404 Error occurred with the following message:

HTTP Error 404 - Not Found

Error context:

{
  "Msg": "HTTP Error 404 - Not Found",
  "Scope": null,
  "main": {
    "pageName": "Error",
    "blog": {
      "Title": "mORMot BLOG",
      "Language": "en",
      "Description": "Sample Blog Web Application using Synopse mORMot MVC",
      "Copyright": "&copy;2014 <a href=http://synopse.info>Synopse Informatique</a>",
      "About": "Bla? Ble, bla ble, bli bla ble blu ble. Blo blu. Bla ble, blu bla blu blu bli blu blu bla, bli blo blo blo bli bli blu blo.\r\nBlo bla!"
    },
    "session": {
      "AuthorName": "synopse",
      "AuthorID": 1,
      "AuthorRights": {
        "canComment": true,
        "canPost": true,
        "canDelete": true,
        "canAdministrate": true
      },
      "id": 2
    },
    "archives":
    [
      {
        "PublishedMonth": 25168,
        "FirstID": 10001
...


Michal

Offline

#35 2014-10-29 09:05:24

miab3
Member
From: Poland
Registered: 2014-10-01
Posts: 188

Re: MVC/MVVM Web Applications with mORMot!

@ab

r 1.18.433 (SQLite)
Still this error occurs.
After Add Comment, data to write but throws an error as above.

Michal

Offline

#36 2014-10-30 09:37:30

AntonE
Member
Registered: 2012-02-03
Posts: 74

Re: MVC/MVVM Web Applications with mORMot!

Wow I go away for a month and come back to see this... :-)
Great work, showcasing the expandable capabilities of mORMot.

I previous UI generation discussions the focus is always on displaying data, which in my opinion is the easy part.
What I'm interested in is interactive, i.e. INPUT/EDIT of data by users and especially handling concurrency, delta of changes, etc.

E.g. you might have a large TSQLRecord, say "TSQLClient" with many fields and sub-structures (using extensive sharding).
Simple Scenario:
UserA opens Client:ABC001 'view' and go on coffee break, displaying e.g. phone number as '123 456 7890'
UserB opens and edit Client:ABC001 and change phone number to '555 456 7890'
UserB comes back from break, edit 'email address' and save.
Now if I just post everything on UserA 'edit' screen, I will overwrite the phone number change made by UserB.


So in short:
1) how to handle updates and edits from views?
2) how to prevent unexpected data-loss due to concurrent user actions?

Really looking forward to see where this is going.

Best regards
AntonE

Offline

#37 2014-10-30 10:47:22

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

Re: MVC/MVVM Web Applications with mORMot!

@AntonE
1) This MVC framework is stateless, just like HTTP is.
If you update the page, you will have updated data.
You may add real-time update, via JavaScript - but this won't be part of mORMotMVC.pas yet.
You would rather use a framework like Angular.js on the client side, then let it use the RESTful API of mORMot's server.

But real-time:
- has a performance cost, especially on the server side;
- uses JavaScript, so is much less search-engines friendly than server side generated HTML: mORMotMVC.pas apps are very google/yahoo/bing friendly, whereas an Angular.

About the 2nd point, Google is starting to execute JavaScript when crawling the web - see http://googlewebmastercentral.blogspot. … etter.html
But this is a huge task, and needs a lot of tuning to ensure it will work as expected.
Dynamically created web pages, with several proper levels of cache (as mORMotMVC.pas does), is definitively a more secure solution.

2) This is IMHO to be handled on server side, e.g. at REST level - so when usingRestModel.

At TSQLRecord level, our ORM allows to "lock" a resource (i.e. a TSQLRecord by its ID), when your retrieve it.
Then it will unlock it at update.
See RestModel.Retrieve/Update/Unlock.

For transactions, you have the TSQLRestBatch class which allows atomic commits of several TSQLRecord modifications.
(and may also increase a lot the processing speed, in respect to individual modifications)

Note also that you can automagically store the history of any TSQLRecord, see http://blog.synopse.info/post/2014/06/2 … e-tracking
This would help resolving any conflicts very nicely for the end users.
You can easily display the record history...

Offline

#38 2014-10-30 15:40:06

miab3
Member
From: Poland
Registered: 2014-10-01
Posts: 188

Re: MVC/MVVM Web Applications with mORMot!

@ab,

R 1.18.438
Stlil Error after Add Comment:
Low-level #404 Error occurred with the following message:

HTTP Error 404 - Not Found

Error context:

{
  "Msg": "HTTP Error 404 - Not Found",
  "Scope": null,
  "main": {
    "pageName": "Error",
    "blog": {
      "Title": "mORMot BLOG",
      "Language": "en",
      "Description": "Sample Blog Web Application using Synopse mORMot MVC",
      "Copyright": "&copy;2014 <a href=http://synopse.info>Synopse Informatique</a>",
      "About": "Bla? Ble, bla ble, bli bla ble blu ble. Blo blu. Bla ble, blu bla blu blu bli blu blu bla, bli blo blo blo bli bli blu blo.\r\nBlo bla!"
    },
    "session": {
      "AuthorName": "synopse",
      "AuthorID": 1,
      "AuthorRights": {
        "canComment": true,
        "canPost": true,
        "canDelete": true,
        "canAdministrate": true
      },
      "id": 1
...

Michal

Offline

#39 2014-10-30 15:51:58

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

Re: MVC/MVVM Web Applications with mORMot!

@Michal
There was inted small typo in the "30 - MVC Server" blog sample which prevented from adding comments to the page.

Should be fixed by http://synopse.info/fossil/info/4e64baa9ea

Thanks for the feedback!

Offline

#40 2014-10-30 17:26:04

miab3
Member
From: Poland
Registered: 2014-10-01
Posts: 188

Re: MVC/MVVM Web Applications with mORMot!

@ab

Thanks, now it's fine.
When adding Articles and Users using html wink

Michal

Offline

#41 2014-10-30 19:15:24

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

Re: MVC/MVVM Web Applications with mORMot!

It is left as an exercise....
B-)

Offline

#42 2014-10-30 19:57:05

miab3
Member
From: Poland
Registered: 2014-10-01
Posts: 188

Re: MVC/MVVM Web Applications with mORMot!

@ab

So I was just thinking myself. big_smile
For now, we exercise improving performance and reducing memory usage for ZEOS.

Michal

Last edited by miab3 (2014-10-30 20:24:10)

Offline

#43 2014-10-30 20:40:21

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

Re: MVC/MVVM Web Applications with mORMot!

Note that this sample is tuned for a sqlite db or a MongoDB nosql instance.
External db would be less efficient for instance about the tags dynamic array, which flies on internal sqlite but would be slower with external db, since it uses a blob field.

Offline

#44 2014-10-30 21:24:45

miab3
Member
From: Poland
Registered: 2014-10-01
Posts: 188

Re: MVC/MVVM Web Applications with mORMot!

@ab

I know that.
But improving ZEOS useful even for other applications.
Besides, sometimes you have to use other than a local SQLite data. smile

Michal

Offline

#45 2014-10-31 00:06:10

moctes
Member
From: Mexico
Registered: 2013-05-11
Posts: 129

Re: MVC/MVVM Web Applications with mORMot!

ab wrote:

Note that this sample is tuned for a sqlite db or a MongoDB nosql instance.
External db would be less efficient for instance about the tags dynamic array, which flies on internal sqlite but would be slower with external db, since it uses a blob field.

I don't want to bother you with this because I know mORMot is muilti-db and you must limit yourself to the lowest common denominator and I am ATM more interested on PostgreSQL support and maybe other people don't care about it, but I have to say it, have you seen the soon to be released 9.4 version and his JSON/JSONB support? 

http://opensourceconnections.com/blog/2 … xtensions/
http://blogs.enterprisedb.com/2014/09/2 … r-reality/

I don't know what level of support for this feature will be on Zeos ( hello EgonHugeist smile ), FireDAC or UNIDAC (I still don't explore this on my own) but it could be worth to take a look at it and perhaps in the future we can have some of these niceties on our little mORMot ?

Offline

#46 2014-10-31 06:23:12

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

Re: MVC/MVVM Web Applications with mORMot!

We are following PostgreSQL progress on a regular basis.
So we prepared this integration.

The new JSONB format, and its powerful query pattern, would indeed help storing documents, i.e. TSQLRecord published fields stored as JSON, i.e. variant/TDocVariant, record or even dynamic array (once we add http://synopse.info/fossil/tktview?name=27353dad25 feature request).

AFAIR JSONB parameters are just set or retrieved as JSON text, so data access library (e.g. ZDBC) is not to be changed.

Offline

#47 2014-10-31 16:11:22

moctes
Member
From: Mexico
Registered: 2013-05-11
Posts: 129

Re: MVC/MVVM Web Applications with mORMot!

Great! seems like you are always one step forward

Offline

#48 2014-11-27 12:22:04

miab3
Member
From: Poland
Registered: 2014-10-01
Posts: 188

Re: MVC/MVVM Web Applications with mORMot!

@ab,

All the time I have a problem with the 30 - MVC Server for Oracle and ZEOS (FireDAC).
Do not rename the reserved names and  do not INSERT.
Oracle-ZEOS test passes:
http://zeoslib.sourceforge.net/viewtopi … 628#p35628

Michal

Offline

#49 2016-03-22 12:26:27

esmondb
Member
From: London
Registered: 2010-07-20
Posts: 299

Re: MVC/MVVM Web Applications with mORMot!

Is it possible to use TMVCApplication with method based services instead of interface based services?

Offline

#50 2016-03-22 12:50:21

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

Re: MVC/MVVM Web Applications with mORMot!

@esmondb
There is no interface based service here.
In fact there is no service.
The controller is using an interface.
But it is a controller, not a service.

Under the hood, routing is done using something similar to method based services.

Offline

Board footer

Powered by FluxBB