I would like to use hive in my Flutter app to save locally conversations and messages of the conversations for the current user.
That being said, i especially would like to retrieve all of the messages for a specific conversation.
Should I create boxes as the conversation_id as name to store messages ?
If i am correct, this would create 1 file per box, so is it correct to have possibly hundreds of files for this ? Does it sound reasonable ?
What would be the best way in this situation ?
So far i only have two boxes Messages and Conversations but as we can't "query", if i want to load messages for a specific conversation, i need to load ALL messages of ALL conversations and then filter in dart, which can eventually lead to Ouf Of Memory crash issue.
I have tested it with 100k messages to get the OOM, but i am seeing this on the long-run of course as a user will not have 100K messages before a very long time, but anyway it would improve performances.
Thanks in advance