objectbox / objectbox/objectbox-java

Option to shrink unused space

オープン
#552 コメント 22 件 リアクション 10 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

enhancement
主要言語
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!

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、ObjectBox インスタンスを開くときに関係する datastore builder とデータベースのライフサイクル API、および現在未使用領域がどのように再利用されているかを確認します。issue で求められている成果は、他のエンティティを保持したまま物理データベースファイルを安全に縮小するオプションの操作です。コメントの議論で、想定される動作と制約を確認してください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
databases, mobile-dev
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。