React Native + AWS AppSync - maximum data storage
Asked Answered
I

2

6

I’m building an offline application which needs to store around 30,000 records.

Will AWS AppSync have any performance issues with a data set of this size?

I’ve used redux w/ redux-persist in the past, which saves the store offline, then refetchs and places in memory when the app launches. This causes fairly huge memory issues, especially when querying the data.

I’m wondering if AppSync has the ability to use Realm or SQLite for offline storage and querying.

Thanks.

Immensurable answered 17/10, 2018 at 19:40 Comment(0)
O
0

This is an old question, but for posterity: AWS Amplify's DataStore fulfills precisely this role. It works with data locally and handles syncing to and from AppSync behind the scenes. You write pretty simple, concise things like this:

// putting data
DataStore.put(new YourModel({ ... });

// getting data
const records = DataStore.query(YourModel);

// getting realtime updates
const subscription = DataStore.observe(YourModel).subscribe(msg => {
  console.log(msg.model, msg.opType, msg.element);
});

DataStore runs these queries against local storage (implementation of which varies by platform), performs sync's and established subscriptions for you behind the scenes (when online).

Refer to the docs for more complete information.

Olivine answered 5/5, 2021 at 18:51 Comment(0)
E
0

In addition to the previous answer, and to respond to your mention of sqlite, Amplify DataStore uses IndexedDB by default for local storage. This storage is persistent across browser restarts and machine restarts. Based on my research IndexedDB can store up to 50MB for a DataStore app if the user has disk space for it.

Etra answered 18/8, 2021 at 18:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.