So let me try and gather your requirements:
...use a Pi a IoT device...
That implies a web server or web client or perhaps some other network connectivity.
..read sensor info..
That implies to me interfacing with devices via serial ports, I2C, SPI, general GPIO bit banging etc.
...and store it in a DB..
Again this is generally a network connection to a DB. Even if it is on the same machine.
I know a bit of HTML...
That hints that you want a web page interface and hence a web server someplace.
JS and node.js makes it very easy to create a web server in a few lines of code. That same program can easily be made to juggle with database connections and sensor monitoring and whatever you have.
Here is node.js:
You will need the Express module to make the web server part easier:
You can push real-time sensor data to your web pages with websockets. This is made very easy with the socket.io module:
For your database you may well be using mysql:
There are other database client modules available.
For GPIO, PWM etc there is pigpio:
For interfacing with serial ports there is node serialport:
As for performance, JS is a couple of times slower than C but 10's of times faster than Python.
JS has the same rapid "edit and run" development cycle as Python.
JS has the advantage of being a long time, internationally standardized language not just a random hack like Python.
Memory in C++ is a leaky abstraction .