I have 100K of iot devices connecting on tcp server. I have to select specific services to be executed on each device based on the device id. Right now I am using a rest api, that I call upon when a device connects to the server,which in turn returns the list of services to be executed on the device, these services on each device are selected by users using a web portal, my problem is when all these devices connects at the same time, rest api server goes down or hangs or takes time to serve the request, my need is to get the response back in milliseconds please suggest any better solution that can server my purpose.
What I have tried:
Right Now I call a Rest API when a devices connects to the server that takes Device ID as an input parameter & returns the services list to be executed on the device.