Data logging to a database

I'm saving vibration data from a sensor now to an SD Card as CSV file using an esp8266 Nodemcu at a massive high sample per second along with timestamp from an RTC. The sensor is connected to A0 of the Nodemcu. Now my project requires it to be send to a database or cloud directly at a minimum of 40k sample per second. Is it possible. I do not have to use Nodemcu. I had it when I started the project. I'm open to buy any device or software. Thank you

Do you have a database that is able to process 40k transactions per second?

Don't you think it may make sense to pre-process the data on the Nodemcu?

You should tell us much more about your project. What is the data used for? What database are you using? How are the values expected to be saved?
If the cloud should be used: Do you have enough capacity on your internet connection?

Sorry. I'm new to arduino world. Currently I do not have any. It can be a database on a local PC. I use MSSQL for other purposde. The vibration sensor will be mounted on a CNC spindle which rotates at around 1500 RPM. The data collected will be used for spindle Maintenace prediction. If the vibration gets abnormal, then will trigger and alarm. I tried Influx database to batch write but it will only process 100 sample per sec or maybe I'm doing something wrong.

For spindle maintenance do you need continuous data? Unless you change spindles every hour I would imagine capturing your 40k samples could be collected every .... hour?

I would think you would also want an immediate indication of the spindle exceeding some known threshold.

I'm assuming your sample rate is based on reading the signal from your vibration sensor. Could you calculate the peak, average & RMS of this data and sent these to the database?

Sorry, but it seems you're also new to the IT world.

Given your DB is extremely effective by saving only 10 bytes for one value pair (time/sensor_value) that results in about 35GB per day, over 1 TB a month. I'm not experienced in the CNC world but I don't think such a maintenance prediction would be economical because storage space isn't the only thing you need, you also must buy lot's of CPU time to go through all that data to make your prediction.

I guess it's much cheaper to do the prediction on the Nodemcu even if it's slightly less precise. But as I wrote, no clue about CNC spindles and when they wear out and how that shows up in vibration values.