# Dgraph-io/badger is constantly growing (setting data with ttl)

**URL:** <https://discuss.dgraph.io/t/dgraph-io-badger-is-constantly-growing-setting-data-with-ttl/4227>\
**Category:** Badger\
**Created:** [March 22, 2019, 9:28am UTC](https://discuss.dgraph.io/t/dgraph-io-badger-is-constantly-growing-setting-data-with-ttl/4227 "2019-03-22T09:28:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vadv](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/vadv/32/1590_2.png) [@vadv](https://discuss.dgraph.io/u/vadv)\
**Post date:** [March 22, 2019, 9:28am UTC](https://discuss.dgraph.io/t/dgraph-io-badger-is-constantly-growing-setting-data-with-ttl/4227/1 "2019-03-22T09:28:53Z")

</div>

Good day to all!  
I started using [GitHub - dgraph-io/badger: Fast key-value DB in Go.](https://github.com/dgraph-io/badger) thanks to the developers for the product!  
But I have a problem with a growing place.  
I insert the data with ttl, but it feels like the place is not being released and is constantly growing.

```auto
err = s.DB.Update(func(txn *badger.Txn) error {
            return txn.SetWithTTL([]byte(key), data, time.Duration(ttl)*time.Second)
    })

```

maybe I’m doing something wrong?  
version of badger: v0.0.0-20190307201039-6b97bacb380b

---

<div class="post-metadata">

**Author:** ![mrjn](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/mrjn/32/775_2.png) [@mrjn](https://discuss.dgraph.io/u/mrjn)\
**Post date:** [March 23, 2019, 12:15am UTC](https://discuss.dgraph.io/t/dgraph-io-badger-is-constantly-growing-setting-data-with-ttl/4227/2 "2019-03-23T00:15:36Z")

</div>

Badger only appends the data to value log. Then later when LSM tree compactions run, they’d discard keys. If you’re running value log GC, then the GC would allow value logs to be deleted.

Badger does not modify data in place because that doesn’t play well with file system consistency and tools like rsync.
