XDataServer performance | limitation

Hello Wagner;

I have used the XDataServer and created a service which could / would extract data and send in JSON back to client. (subjected of "Post, Update and Delete methods" post).

What I like to know is:

  • Beside of the network availability and server (host) capabilities or database performance - is there any limitation that we have to be aware for number of requests service could manage?
  • Is the XDataServer component itself is built based on multi-threaded architect?
  • Could we define any limitation in program? Example - lile manage not more than 10 requests per minute
  • When using the Firedac components for accessing the Database (again subjected for that case), do we need any database connection pool?

Thanks in advance for looking into this.

From the top of my head, no.

Yes, client requests are processed in parallel.

You could do that yourself, using middleware mechanism. But that would be reinventing the wheel. I would recommend you use a reverse/edge proxy that does that for you, like Traefik.

It would be recommended, yes.

Thanks Wagner;

How could we define "database connection pool" when using the Firedac connection? I know we have Xdata connection Pool for Aurlies - but as you may recall, we are using the FD and MS-SQL database.

You can use the XData connection pool to do that work for you and retrieve the underlying TFDConnection it created: See "Referencing Original Component".

  MyConnection: IDBConnection;
  FDConnection: TFDConnection;
  FDConnection := (MyConnection as IDBConnectionAdapter).AdaptedConnection as TFDConnection;

Thanks Wagner for getting back to me on this, I've a bit difficulty to implement this.

Would you please bring that to the context of the sample app "firedac-sql" (with CUSTOMERS table) ? Assume we are using MS-SQL (v.s. SQL Light) and FireDac connection is named like "afDB: TFDConnection;".

The intention of that specific demo is to show how to use XData without touching Aurelius, which scares some beginner users. So it shows how to leverage your existing FireDAC knowledge or any specific knowledge you have and use XData right away.

FireDAC already provides its own optimizations, and pooled connections. You can simply use its mechanism: http://docwiki.embarcadero.com/RADStudio/Sydney/en/Multithreading_(FireDAC)#Connection_Pooling