# Data loss on unexpected shut down before the end of shard group duration?

**URL:** https://community.influxdata.com/t/data-loss-on-unexpected-shut-down-before-the-end-of-shard-group-duration/30683
**Category:** InfluxDB 2
**Tags:** backup
**Created:** [July 12, 2023, 10:25am UTC](https://community.influxdata.com/t/data-loss-on-unexpected-shut-down-before-the-end-of-shard-group-duration/30683 "2023-07-12T10:25:28Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![breadum](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/breadum/32/13879_2.png) [@breadum](https://community.influxdata.com/u/breadum)
#### Post date: [July 12, 2023, 10:25am UTC](https://community.influxdata.com/t/data-loss-on-unexpected-shut-down-before-the-end-of-shard-group-duration/30683/1 "2023-07-12T10:25:28Z")

</div>

Hello,

Let’s say, bucket retention period is permanent and shard group duration is 7 days.

If a server received 7GB of data today and at night power was off all of sudden.

Since it’s before 7 days of shard group duration, data is supposed to be on RAM.

1. Then data on the RAM is likely to be lost?

2. What if a server has 2GB of RAM?  
Since every data cannot be on RAM, it’s partially written to disk and the rest is lost then?

3. What if server reboots by schedule instead of unexpected shut down?  
Assume that additional process for stopping influxd has not been taken care of.  
(i.e. just $ sudo reboot now)

It confuses me that Influxdb has the characteristics of in-memory databases.  
Thank you in advance.

---

<div class="post-metadata">

### Author: ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)
#### Post date: [July 12, 2023, 6:36pm UTC](https://community.influxdata.com/t/data-loss-on-unexpected-shut-down-before-the-end-of-shard-group-duration/30683/2 "2023-07-12T18:36:09Z")

</div>

Hello @breadum,  
Welcome!  
What version are you using?  
It depends on whether you are using TSI or TSM as well.

1. I don’t believe it will be lost. That data is on disk and ram for hot storage to support faster querying.
2. If a server has little RAM you can limit the data gathered  
[Ram is shooting up because of high data pump to influxdb](https://community.influxdata.com/t/ram-is-shooting-up-because-of-high-data-pump-to-influxdb/16495)
3. I think again you’ll be fine.

I hope this helps.

---

<div class="post-metadata">

### Author: ![breadum](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/breadum/32/13879_2.png) [@breadum](https://community.influxdata.com/u/breadum)
#### Post date: [July 13, 2023, 12:14pm UTC](https://community.influxdata.com/t/data-loss-on-unexpected-shut-down-before-the-end-of-shard-group-duration/30683/3 "2023-07-13T12:14:39Z")

</div>

@Anaisdg  
Glad to hear that, thanks for your reply.  
Influxdb v2.4 is currently installed on the server.

If I limit RAM usage by influxdb and set shard period to zero,  
would it show better performance on special cases  
such as intensive data receive from other db? (on back-up purpose)
