简体   繁体   中英

How do I manage data for a Point Of Sales Android app written in react-native

I am making a react-native POS application on Android. I am storing data(items, employees, etc.) in an online MySQL database. I also need to sync orders across all POS's of a restaurant.

The implementation I have right now is fetching all the data needed when the app opens and storing it in redux, then accessing the data from redux, essentially using redux as a local database. Is this the best way to do things? Will there be performance issues if the dataset is large? Should I use a local sqlite database?

This in my opinion is not the right way of doing it. 1) If the dataset is large is going to take a long time to download all the state to redux and also is going to make the application allocate a huge amount of memory to store all the data. 2) I you have multiple users modifying the database locally how do you synch all the changes.What do you do with concurrency, two user modifying the same record, etc.

I think what you need to do is to implement a backend service that centralise all the changes, that page and allow search in the dataset.That way your ui only download the data it needs and all crud operations are in synch and manage by the server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM