RPi is a notorious SD card killer, so having a database on a SD card is risky business - you could attach an external USB harddrive, and thus being a bit more on the safe side.
I know. I used the Sheevaplug for years as remote backup solution, and it had the same problem.
Anyway, there are mitigations, depends on how critical the data is. In my case it was mainly nightly off-site backup of the SVN repo, but it was redundant since the offsite went to two such locations (my boss and my home).
The actual backup went to an USB stick, which mitigated the SD card problems. (but added a problem of guaranteedly mounting the USB stick on reboot/powerfailure). Even the place where updates placed the downloaded archives was rerouted to the USB stick.
Any problems -> replace USB stick, but not complicated configuration/installation necessary.
---
On the RPI it was a very low mutation database, so also a nightly backup to an usb stick was ok and the clients kept a log anyway, so in the case of potential critical dataloss, I could manually apply the (relative few) mutations from the logs.
A while I also used the NFS of a NAS as such backup medium.
RPI4 should be able toattach sata SSDs via USB3. (haven't tried yet, still on RPI3)
And yes there is a trail of corrupted SD cards here in my office.
100% OT - if you are making embedded solutions with RPi, I can warmly recommend using Alpine Linux instead of Trashbian.
My experiences with musl libc are bad. But it probably depends if you run own built stuff, or just prepackaged.