Skip to content

Add Room db as cache #14

Description

@worker8

After having comments and login, there will be data consistency issue. For example, upvoting in Comment View doesn't update the view in Home Feed View. By introducing Room, and by using Rx subscribing to the same Room item, the view will be updated automatically. Otherwise, we need to use some sort of EventBus which can be abused if not used properly.

Besides, Room can also serve as an offline cache. This is by no means a full blown offline support, it will simply show the last known data when offline. But mainly Room should be used as the cache to keep data consistency across the app.

Reddit data model comes with a unique id, that can be used as the primary key.

Migration strategy should be set to drop everything to prevent crash during schema change, since this is only for caching, we don't need to perform migration.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions