Architecting for Privacy: Why I Chose Local-Only SQLite Storage over Firebase
Privacy became a feature rather than an afterthought, and the data would never leave the device unless the user explicitly exported it.
重點摘要
Chose Room and SQLite instead of Firebase to keep user data on-device
Handled alarms, geofencing, and reboot recovery entirely on Android
Learned that offline-first design improves privacy, trust, and code structure
Haseeb explains why he built Muffle as a fully local, offline-first Android app instead of using Firebase. Because the app needs sensitive data such as location history, calendar events, and prayer schedules, he wanted privacy to be a core feature rather than a cloud responsibility. That choice shifted the complexity onto the device, requiring Room, SQLite, WorkManager, ForegroundService, AlarmManager, and reboot recovery via BroadcastReceiver. He also describes challenges with Android background limits, Doze mode, and local prayer-time calculations. In the end, he argues that privacy-first design earns user trust and leads to cleaner, more modular code.
以隐私为核心的架构选择:我为何放弃 Firebase,改用本地 SQLite 存储
隐私不再是事后补救,而是功能本身;除非用户明确导出,数据不会离开设备。
重點摘要
改用 Room 和 SQLite,避免将敏感数据上传云端
依靠 WorkManager、AlarmManager 和 GeofencingClient 完成本地自动化
从离线优先架构中体会到隐私、信任与代码可维护性的价值
Haseeb 讲述了他为 Muffle 选择完全离线、仅本地存储的 Android 架构,而不是使用 Firebase。由于应用要处理位置历史、日历事件和祈祷时间等敏感信息,他认为隐私必须成为设计核心,而不是云服务的附带责任。为此,复杂度转移到设备端,必须依赖 Room、SQLite、WorkManager、ForegroundService、AlarmManager,并用 BroadcastReceiver 在开机后重新注册任务和地理围栏。他也分享了背景执行限制、Doze 模式以及本地计算祈祷时间的挑战,最终认为隐私优先不仅更能赢得用户信任,也能促使代码更清晰、更模块化。
以隱私為核心的架構選擇:我為何放棄 Firebase,改用本機 SQLite
隱私不再是事後補救,而是功能本身;除非使用者明確匯出,資料不會離開裝置。
重點摘要
改用 Room 與 SQLite,避免將敏感資料上傳雲端
以 WorkManager、AlarmManager、GeofencingClient 實作全本機運作
從離線優先架構中學到隱私、信任與程式可維護性的價值
Haseeb 分享他為 Muffle 採取全離線、只在本機儲存的 Android 架構,而不是使用 Firebase。由於 App 需要處理位置紀錄、行事曆與祈禱時間等敏感資料,他認為隱私應是設計核心,而非雲端服務需額外承擔的責任。這也把複雜度轉回裝置端,必須依賴 Room、SQLite、WorkManager、ForegroundService、AlarmManager,並透過 BroadcastReceiver 在開機後重建排程與地理圍欄。他同時提到背景執行限制、Doze 模式與本地祈禱時間計算的挑戰,最後認為隱私優先的設計更能贏得使用者信任,也讓程式碼更乾淨模組化。