#1 2017-10-18 08:52:06

Mark
Member
Registered: 2013-11-30
Posts: 19

newbie question about application architecture and implementation

Dear AB,

I know Mormot before and also play the examples it is a great tools for Delphi developer,
Thanks your efforts, delphi developer still has place to survival under web trends.

However, I get confuse in Mormot.

Our company develops a program in traditional Client/Server mode.

Now, my boss ask to change to web-based program,
I think the client interface use HTML+CSS+Jquery
and the database server use MariaDB,
how about application server apply Mormot?

diagram:    <DBServer> -- <Mormot: SOA/ ORM ? > -- <Web UI>

As I know SOA with interface(client/server), need delphi client, it is not suit the above case.
ORM only to map DB tables/fields to entity.

My request is Mormot need:
1.)  contains functions (web UI request -> logic process with DB data -> return simple result array)
2.) process SQL (web UI request -> update/insert/delete SQL to DB server)
3.) I never success to connect MariaDB until now, Mormot support MariaDB ? any example  ?

Win10
Delphi XE7
MariaDB 10.0.2 or above

Please any suggestion to build the system base on Mormot.

Regards
Mark

Last edited by Mark (2017-10-18 08:56:52)

Offline

#2 2017-10-18 13:34:39

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

Re: newbie question about application architecture and implementation

Take a look at the MVC Web part of the framework.
It can generates HTML + CSS content very easily.
But the page is rendered on the server side.

If you want to write an AJAX website, rendered on the client side, consider using the interface based services.
You can access to them using plain JSON and HTTP/HTTPS.

Offline

#3 2017-10-19 06:13:35

Mark
Member
Registered: 2013-11-30
Posts: 19

Re: newbie question about application architecture and implementation

Thanks AB point me the right way.

How about MariaDB connection, I get cannot find any example, or fail when modify the mssql example.
any hints to me, thanks your help

Offline

#4 2017-10-19 06:55:53

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

Re: newbie question about application architecture and implementation

I guess you should try with SynZeos.pas as connector (with latest ZDBC library), or ODBC.
And select MySQL kind of database.

Offline

#5 2017-10-19 07:28:18

Mark
Member
Registered: 2013-11-30
Posts: 19

Re: newbie question about application architecture and implementation

Hi, AB
Do you plan to support direct with MariaDB in mORMot ?
because MariaDB is a Nova in RDBMS in the coming future.
many cloud provider also provide this RDBMS.

So, It is good for system development in mORMot.

In your exmple, I have tested well with MSSQL2008R2 Express connections, but it is limited by MS other than paid license fee. not as good as MariaDB(Open& cross platform that means run in Linux).


Thanks.

Last edited by Mark (2017-10-19 08:12:37)

Offline

#6 2017-10-19 11:18:22

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

Re: newbie question about application architecture and implementation

I am no MariaDB expert, but for what our ORM expect, using the MySQL connector and dialect is the same.
Any feedback is welcome!

Offline

#7 2017-11-02 09:19:02

Mark
Member
Registered: 2013-11-30
Posts: 19

Re: newbie question about application architecture and implementation

Thank AB,
  I download "libmariadb.dll" and use Zeos, success to connect and retrieve JSON via browser
  Also use unidac to connect, it is success!

  I have a question, I have existing mariaDB tables which contains 1 or multiple keys fields,
  But mORMot model create "ID" automatically, how to suit my existing tables key-fields (I don't want to change my exisitng table structure because    many users using these.

  Thanks for your help

Mark

Last edited by Mark (2017-11-02 09:19:28)

Offline

#8 2017-11-02 12:36:03

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

Re: newbie question about application architecture and implementation

As documented, the TSQLRecord.ID field is used everywhere by the ORM to identify the item. The ID may not be computed by the ORM (calling Add with ForceID=true), but the ID should be an Int64.

You may have to use direct SQL statements, if you have existing not integer single primary key.
Or add an ID field, which will be used by the ORM internally.

Offline

#9 2017-11-03 03:09:56

Mark
Member
Registered: 2013-11-30
Posts: 19

Re: newbie question about application architecture and implementation

Thanks AB,

I also have a confuse about SOA,
SOA as micro service to handle simple function (may be 1 function of logic),
In the real case, there are hundreds of functions within a business system,
that means hundreds of SOA created within a system ?
If yes, it is the pain-point to handle these hundreds of SOAs' admin (eg. start/ end services, ...)


Mark

Offline

#10 2017-11-03 21:29:37

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

Re: newbie question about application architecture and implementation

No, of course, unless you want to make "server-less cloud" development, which is IMHO an anti-pattern: you run a function.... so you end up with pure procedural code. wink

MicroService is about single responsibility, not single function.
Just like with the Single Responsibility principle in SOLID.

Offline

#11 2017-11-07 04:53:12

Mark
Member
Registered: 2013-11-30
Posts: 19

Re: newbie question about application architecture and implementation

Thanks AB

  I start to familiar with mORMot, thanks your right direction!

  To understand your materials with solid example will be more efficiently
  because sometimes not fully understand your good theory & idea explaination (may be my low IQ),
  but understand quickly when view related examples and think back again.

Last edited by Mark (2017-11-07 04:59:37)

Offline

#12 2017-11-07 10:33:18

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

Re: newbie question about application architecture and implementation

Ensure you look at the supplied samples, especially the latest one, numbered 35, which covers the typical steps of writing clean DDD code using mORMot.

Offline

Board footer

Powered by FluxBB