-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
List Persistance #6
Comments
@tycebrown Before you start on the code for this one, we need a good plan for how you will handle data persistence. Do some research and report back on any libraries or approaches you think will work well for this app. |
@tycebrown I am curious. Have you done any research for this? |
Not much. I looked at a few options (pretty much Hive and shared_preferences), but not too in-depth. |
Alright Mr. Emig, I did some research on the different forms of persistent storage. TL;DR: I think it would be best/easiest to use one of the following databases: Isar, Hive, and ObjectBox. They all seem about equal. A database seems like a better choice to me than a file, since our data is somewhat structured, but I'm open. There are two major types of databases I found: SQL (relational) and NoSQL (non-relational). From my research:
From these, it seems that non-relational data is preferable. It is faster, and it doesn't seem we would need complex relationships. I imagine the most complex relationship between different lists would be their categories. Among non-relational databases, there were three main competitors I found: Isar, ObjectBox, and Hive. The benchmarks I found were all wildly inconsistent. Hive is simpler and uses a cache, giving near-instant reads. Isar seems more complex, but is still very fast. In Isar and ObjectBox, relational links can be made between objects. Both provide functions to make complex queries on the data and prioritize consistency over availability. I am leaning toward Hive just because it looks simpler and easier, but, since Dart objects are large, according to this issue here, the cache might hit RAM limits relatively fast. I'm not sure how much this would be a problem, since closing a box will clear its cache. |
@tycebrown Thanks for the detailed write up! Hive sounds like a good option, but the first thing that caught my eye in it's README file was:
This seems to tell me that even the authors of Hive don't recommend using it, but prefer Isar. I would say use either Isar or Hive. Extra note: in the future, include links in your post to make it easier to find the Github repos for the projects you referenced. For example: Hive, Isar, and ObjectBox. |
Currently, if the user closes the app, they lose their list. When they open the app again, they are presented with an empty list.
Implement some form of data persistence, so that the data is saved to the device. When the user opens the app, all their items should still exist.
Be sure to think ahead in your approach. In the future, we will want users to have the ability to create multiple lists. Be sure that your data persistence approach will easily support storing multiple lists
The text was updated successfully, but these errors were encountered: