Local recorder DB with purge + remote recorder DB without purge for full history?

Hi!
Running on a Pi4 with HA OS and default DB (without purge at the moment).
Can I set up to two recorders:

  1. local on the Pi (128 GB SD card) with e.g. 14 days purge, and
  2. on a LAN connected MariaDB server without purging, to keep my entire history.

Both will be written to with the same data. Preferable the 2) will be updated with data from 1) if the DB server or LAN goes down temporarily (e.g. during booting of the server).
Any inputs welcome (HA is becoming a serious important element of my house setup!)

Recorder/MariaDB are less suited for this, the InfluxDB integration would be the better choice for this. This is designed for large time based datasets, can live anywhere in you network and has its own settings for (not) purging. Grafana is the most use tool to generate graphs from it.

But why have two databases where one will just be a subset of the other?

My Pi cant hold the big database. HA (on the Pi) will show resent data (f.ex 14 days worth), the other can be used with e.g Grafana and for other historical uses (e.g. energy uses, car charging, event logging etc). Basiscally dont want to loose recorded data (Harddisks are cheap, SD cards limited).

Also looking for a resilient solution. I can keep my Pi running with UPS and battery operated Zigbee connections, the second server might have to be booted (once in a while) and the network connection is another error element.