简体   繁体   中英

I collect a lot of data real time through SocketIO events. Should I validate JWT token for every SocketIO event?

So, I need to collect a lot of data, say 3 units of data every second, by a lot of people. I named the event that collects this data as 'capture'.

I am using JWT for authentication for other less data intensive events.

Now, I'm just worried that validating JWT with every data intensive 'capture' event will be too much load on the sever.

Any suggestions..? Should I validate for every 10 captures. But, then, I have to maintain state. And I'm using NodeJS and maintaining state is not a very easy thing on NodeJS. Every suggestion is welcome.

Validate a JWT with a symmetric key should not be a long-running operation. It does not require database access or additional memory, which you would need to maintain a cache

An alternative is grouping captures in client side in one request

In any case I suggest doing a load and performance test if you have doubts

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM