#1 2015-09-15 18:45:58

swierzbicki
Member
Registered: 2014-11-19
Posts: 28

Is this possible with mORMot ?

Hello Arnaud,

I have Wince (Lazarus) / Android (Delphi 10) scanners. Scanned data are stored into a local SQLite database. A background thread is running and looking for "Validated" records. Theses records once validated are  sent to an remote PostgreSQL server.
This is well working but I really want to rewrite this using mormot framework.

Does mORMot have such features ? I mean, am I able to "synchronize" both databases the way I'm doing right now ?

Thank you.

Regards,

Stéphane

Last edited by swierzbicki (2015-09-15 18:54:14)

Offline

#2 2015-09-16 06:59:27

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

Re: Is this possible with mORMot ?

I think you can do that with mORMot, but I maybe a queue like this http://zeromq.org/ fits your needs more?


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

Offline

#3 2015-09-16 18:24:37

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

Re: Is this possible with mORMot ?

@edwinsn I do not see why a message queue may change anything.

The background thread could easily write the validated records to PostgreSQL.

In mORMot terms, the easiest is to have two TSQLRestServerDB instances:
- One local for the scanning and validation process, in which you call Add/Update as expected by your business logic;
- One pointing to the external PostgreSQL, in which you call Add when the record is finished.

Each TSQLRestServerDB would have its own TSQLModel.
You may even be able to share the same TSQLRecord class between the two, without any issue.

We usually do such things, especially in a cloud of mORMot servers.
Each mORMot server does its own process with its own local Sqlite3 database in its own node.
Then all data is gathered to a remote MongoDB centralized storage.
It works very well.

Offline

#4 2015-09-17 11:11:02

swierzbicki
Member
Registered: 2014-11-19
Posts: 28

Re: Is this possible with mORMot ?

Thank you both of you for your comments.
I'll surely take arnaud's path

Offline

Board footer

Powered by FluxBB