Frage

What are your suggests?

Is it better to place TRTCHttpServer to main form or to datamodule with other server components? In demos apps there are both implemetnation. Component will be set up with multithreaded property TRUE. As far as I know if it is separated in main form datamodule is created with every thread when client connected. Is it true?

Also, If I want to make a pool algorithm for DB connection (TZConnection) where should be put? In datamodule with other server components and DBAware components or in separate datamodule? Pool algorithm would be threaded like this:

DB Connection pool The server should have db connection pool and be multithreaded. It could be achieved by RTC components. It would serves as the 2nd tier of 3 tier architecture. The 3rd tier is MySQL connected via ZeosLib.

Thanks for answers.

PS: I have searched for any other suggestions but I could not make it clear. Please help.

War es hilfreich?

Lösung

I guess you have several questions in one...

  1. AFAIK RTC uses a thread pool, for better scalability and less resource use. So you can not assume you have one thread per client.

  2. It is always preferred to place your logic in a datamodule, and NEVER in a main form: do not mix UI and server - for instance, it could make sense to host your server in a service, on production.

  3. If you are using ZeosLib, the connection pool you are talking about has nothing to do with the ZDBC connection pool.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top