Skip to content

S3 Local Storage

Tony Montes edited this page Nov 6, 2023 · 1 revision

Local Storage Strategies

Storage then network

Storage then network In the sequence of operations that occur when accessing the feed and calendar view in the application, a data storage and transfer process from the server to the user's device is followed.

Firstly, upon opening the application, the initial feed is loaded. This feed is stored locally in the SharedPreferences on the user's device, ensuring that the user can access the information even in the absence of an online connection. However, this local version may not necessarily reflect the most up-to-date information available on the server. Subsequently, the application checks for new data available on the server. If new data is detected, the application updates the local storage with this refreshed information. Simultaneously, the application renders and displays the new elements obtained from the server to keep the user informed about the most recent changes.

This same approach for handling the feed is applied to the calendar view, which displays events to which the user is subscribed, including both past and future events. The application ensures that events the user has attended and those they plan to attend in the future are stored in the local storage (SharedPreferences). Every time the user accesses the application and requests an update, the application performs a round-trip operation with the server to fetch and reflect any changes in the events. While this process is underway, the application presents information to the user to keep them engaged and provide a seamless experience, even during the data synchronization.

Cache, falling back to network

Classes Hive - Página 2

When the user accesses the profile view in the application, a data storage and transfer process occurs between the server and the user's device.

Initially, upon opening the profile, the application loads the user's information from the local cache stored in the device's SharedPreferences. This ensures that the user can access their profile details, such as name, email, and participation number, even when an internet connection is unavailable. However, the locally stored information may not reflect the most recent updates made on the server.

Subsequently, the application checks for any new updates or changes to the user's profile on the server. If there are any updates, the application refreshes the locally stored information to reflect the latest data. At the same time, it displays the updated profile details to the user, ensuring they are aware of the most recent changes.

This approach allows the user to access their profile information seamlessly, even when offline, while also ensuring that the displayed data is updated according to any recent modifications made on the server. For this reason, we employ the mentioned strategy, as the profile information is not expected to change frequently over time.

Clone this wiki locally