I think Apple solves this pretty well in iOS… there’s pretty simple iCloud API’s apps can use to store basic data (also structured data with CKDatabase/etc) which automatically just use the user’s iCloud account storage and implicitly are synced across devices. Apps don’t have to implement any cloud storage or consensus/etc, they just use the platform API’s and everything just works. I’d be shocked if android/play store didn’t have a similar thing.
Huh, on Android or iOS? On Android the backup settings page offer a backup to Google Drive, it also says "Your messages will also back up to your phone's internal storage."...
On my phone the on-device backup can be found in /storage/emulated/0/Android/media/com.whatsapp/WhatsApp/Databases, and I remember reinstalling WhatsApp, logging in with my phone number, and it found the backup and restored the messages.