using kdb as web server and application server?

Hello:
   I’m excited about using kdb as a web server and application server. 

When a http request comes, we just read information from the database, and return json/html. 

Does anybody tried this idea? how about scalability ? will each http request create a thread ? or just all handled in the main thread?

How about concurrency? 

Regards.

Hi Hao

There are two ways to do it.

http requests come through the .z.ph message handler.  This is a synchronous call, and always handled in the main thread.

Web socket requests come through the .z.ws message handler.  These are asynchronous.  I believe they are always handled on the main thread (I’ve never tried if it works in multithreaded input mode -p -N).  However, because theses are async, you have more options w.r.t. scaling - the server can service the queries when it chooses, and could offload them to back end processes (act as a gateway).

Regards,

Danny Greening
AquaQ Analytics