Hacker News new | ask | show | jobs
by allenu 1814 days ago
I've built my own flashcard app and I ended up just syncing a journal of all your actions on a device (creating/edit cardings, evaluating them) and having all your other devices play those back to get to the "shared state". I store data using SQLite as well. It works pretty well for me.

You're definitely right about students being unwilling to buy software. They're already cash-strapped, so they're very unlikely to pay for an app, let alone a monthly subscription.

1 comments

Hah - you're describing "event sourcing" and it's the technique I'm using: https://flpvsk.com/blog/2019-07-20-offline-first-apps-event-...

Unfortunately event sourcing means distributed systems... and I'm learning this on the fly on nights & weekends. Martin Kleppmann's "Designing Data Intensive Applications" has put the fear of god in me.

Yup, I'm doing event sourcing.

For my approach, I really just have each device append to its own journal file. I use iCloud's file storage, so I don't even have a service that I run. Each peer device just uploads the latest version of its journal to a shared folder and downloads its peers' journals and plays back the delta as needed.

I intentionally chose this architecture since I didn't want to run my own sync service. It keeps the sync system free, but iCloud can be slow. Unfortunately for me, if iCloud is slow, the app gets blamed for it.

Nice. Just checking, did you not go with firebase/couchdb/pouchdb due to pricing?
Yes. Anything that required me to pay would mean I'd have to charge a subscription from users, which I didn't want to do.