-
Notifications
You must be signed in to change notification settings - Fork 253
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
[Feature] Alice didn't use database and store all data in RAM #156
Comments
SQL not needed i think, a classic NOSQL system is far enough ;) ObjectBox / Hive / Isaar are good for that I believe. Using SQL can have some side effect on Android devices because Android SQL only accept 1 READ or WRITE at a time. While iOS accept multiple. |
Agreed, however, I'd stay away from Hive / Isar as they've not been updated in a while. |
Also, I wouldn't categorize this as a |
Hmm, I believe that alice/packages/alice/lib/alice.dart Line 42 in 14f7c83
|
Damn didn't see that ! Ty a lot. Message to the maintainer : If you don't plan to implement DB, feel free to close this issue, this parameters is enough for dev / debug env i believe. |
@EArminjon implementing an optional ObjectBox data store should be doable, however, it will force the user to make additional steps like code generation, etc. Because of that, it should be made into a separate package. @jhomlala to do this we'll probably have to change final BehaviorSubject<List<AliceHttpCall>> callsSubject = BehaviorSubject.seeded([]); into a final Box<AliceHttpCall> callsBox = store.box<AliceHttpCall>();
final Stream<List<AliceHttpCall>> callsStream =
callsBox
.query()
.order<DateTime>(AliceHttpCall_.createdTime)
.watch(triggerImmediately: true)
.map((Query<AliceHttpCall> query) => query.find()); and use another default I'll try and make a PR in the following days/weeks if we agree that that's the best course of action. |
That's okay but I would like to see persistence as another "plug in" package (like alice_dio etc.). This could be optional for applications which requires this storage. I don't want to force usage of ObjectBox/Hive/other db for all applications even if they don't need that. Also we need to make sure that our DB will be cleared between sessions - we don't need to see previous sessions. Also DB |
Well it's a valid point to use DB since there can be a lot calls with a lot of data so that's fine. |
@jhomlala yea, I was planning on a "plug-in" approach, regardless, there will have to be some minor changes done to the core package to accommodate for that. |
Describe the bug
All requests are put in RAM instead of local database which increase and retain high memory usage for ever.
I've some download task (which contain some huge JSON ) and that stuck my app at 500mo or more in memory usage. Sometimes that lead to crash or freeze...
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Alice should load in ram only relevant data. Else, all data should be put in a local database (You can avoid SQL and use NOSQL)
Screenshots
If applicable, add screenshots to help explain your problem.
Flutter doctor
Please add flutter doctor output here.
Alice version
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: