#1 2017-08-16 01:07:50

linbren
Member
Registered: 2017-08-11
Posts: 42

does mORMot application work together on three or more servers ?

does mORMot application work together on three or more servers ?
in many case , the service were required more than 1,000,000 times within one second, therefore one server cannot be handle the requires .
any solution for this ? sessions handle need be considered.
could I found the samples somewhere ?

Last edited by linbren (2017-08-16 03:52:46)


Windows 7 64bit. Delphi XE10.2 Professional.

Offline

#2 2017-08-16 01:16:39

linbren
Member
Registered: 2017-08-11
Posts: 42

Re: does mORMot application work together on three or more servers ?

what we mean is : does mORMot support distributed deployment ?


Windows 7 64bit. Delphi XE10.2 Professional.

Offline

#3 2017-08-16 06:38:57

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

Re: does mORMot application work together on three or more servers ?

Of course.
Just put a load balancer (e.g. ngxinx or haproxy) in front of the mORMot servers.

To maintain the session consistency, you my for instance, use IP hashing for routing, so that the same requests would go on the same mORMot server.

Offline

#4 2017-08-16 07:32:12

linbren
Member
Registered: 2017-08-11
Posts: 42

Re: does mORMot application work together on three or more servers ?

understand.

IP routing were limited , e.g.  communication required between sessions , session A on server one , session B on server two ,  they does not know each other .

or more simply question : how many clients on our distributed system ?

we got a project which using java framework -- spring , sessions were maintain in Redis , it work pretty good .


Windows 7 64bit. Delphi XE10.2 Professional.

Offline

#5 2017-08-16 13:25:32

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

Re: does mORMot application work together on three or more servers ?

The idea with IP-hashed balancing is that the same client will point to the same server, so you could keep the session information on this server.

An alternative may be to store the session information on the client side, in a cookie: this is what our MVC framework does via TMVCSessionWithCookies (with optimized binary serialization, built-in expiration, then on-the-fly encryption and digital signature).
This is my preferred way: the more stateless a server is, the better!

You may also maintain the session information in a dedicated mORMot server, running a "sessions" MicroService, which may give you an higher level of abstraction than a Redis key/value store.

Offline

#6 2017-08-16 13:59:36

eraldo
Member
From: Brasil
Registered: 2010-07-22
Posts: 69
Website

Re: does mORMot application work together on three or more servers ?

Dear ab,

Could you provide an example of your preferred technique?

Offline

#7 2017-08-16 14:07:51

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

Re: does mORMot application work together on three or more servers ?

For a web application, the sample 30 uses TMVCSessionWithCookies for client-side session storage.

Offline

Board footer

Powered by FluxBB