Storage solution to run IoT analytics
Someone suggested that as my data is structured, I do not need NoSQL. I moved to RDBMS (Postgres). It performed better than the earlier solutions but it is getting to its knees after a few million rows.


How is getting to it's knees? You can easily index a few billion rows, with a BRIN index. Merge your start and end times into a tsrange, and cluster on the pkid and range.

CREATE TABLE foo (
  id int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
  startts tsrange
);
CREATE INDEX ON foo USING brin (id,startts);


I would consider frequently clustering on id until your workload won't permit that, but at a few million rows you've got a LONG way before you have a real scale problem.