while be interesting to use clickhouse for recording.
clickhouse is made for storing this type of information, especialy because is column db and compress all the data by column (be abel to store more long time data history), and also had specific column dictionary and delta optimisation. the fact that are column db make possible to manipulate big history without index.
i think is not very complicated to do, recorder are based on SQLAlchemy, and is existing a support for clickhouse in SQLAlchemy:
after eventualy we need clickhouse add ons to colocalize the data on the same box as ha.