I plan to make a meditation journal app which stores all the user's data offline on the user's device, but also offers an option to sync this data to the cloud.
Firebase isn't really a good solution for this as it generally expects that the device will sync to the cloud as its primary source of data.
What is the best database solution which works 100% offline, but which can also be easily synced to the cloud to share the data across multiple devices? To narrow it down further, the cheapest option would also be preferred.
You can use Sqlite link for offline and SqlServer for online, when the user is offline use Sqlite and online SqlServer, just synchronize it when is online, but you need a good way to manage structured data in both sides or cases, see the link.