objectbox / objectbox/objectbox-java
Option to shrink unused space
还没有人认领这个 Issue。
- 主要语言
- Java
- 星标
- 4.6k
- 派生
- 311
- PR 合并指标
- 30 天内没有已合并 PR
描述
Did not find any info on that, so decided to ask here - is there (or planned) an option to shrink (e.g. compact the database)?
We're using objectbox for quite a long time for a production app one entity there is used to collect various loggable information for further sending it to a server. Successfully sent entities gets removed from the database, however, the physical db file still grows constantly. (which is understandable)
I understand we can always delete the file before creating the ObjectBox instance in order to reduce the unused space, however there are other entities there so we'll need save and recreate them somehow in the new (emptied) datastore. Thus, kind of an option to the builder like .shrinkOnOpen() would be nice to have, so app may check the database size during the initialization process and shrink it when necessary.
Thanks!
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先查看 ObjectBox 实例打开时涉及的 datastore builder 和数据库生命周期 API,以及当前如何回收未使用的空间。issue 要求的结果是一项可选操作,在保留其他实体的同时安全地缩小物理数据库文件;请在评论讨论中确认预期行为和约束条件。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java
- 领域
- databases, mobile-dev
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100