# Sensor temporal data: storage best practices

**URL:** <https://discuss.dgraph.io/t/sensor-temporal-data-storage-best-practices/13067>\
**Category:** App Development\
**Tags:** graphql, dgraph\
**Created:** [March 4, 2021, 9:46pm UTC](https://discuss.dgraph.io/t/sensor-temporal-data-storage-best-practices/13067 "2021-03-04T21:46:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![maksymsur](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/maksymsur/32/6626_2.png) [@maksymsur](https://discuss.dgraph.io/u/maksymsur)\
**Post date:** [March 4, 2021, 9:46pm UTC](https://discuss.dgraph.io/t/sensor-temporal-data-storage-best-practices/13067/1 "2021-03-04T21:46:55Z")

</div>

Hi everybody!  
Considering +/- of moving lots of temporal sensor data to dgraph.  
The data structure is simple:

- sensor\_id: i
- timestamp: t
- measurement: v

Shall I reflect the same structure in the graphql schema ( `type Measurement {i, t, v}` ) or there are better ways to structure/store such kind of data for optimal dgraph performance?  
What are the best practices here?

---

<div class="post-metadata">

**Author:** ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Post date:** [March 4, 2021, 11:11pm UTC](https://discuss.dgraph.io/t/sensor-temporal-data-storage-best-practices/13067/2 "2021-03-04T23:11:42Z")

</div>

I think for your case the entity is straightforward.

```auto
type Measurement {
    sensor_id: ID!
    timestamp: DateTime
    measurement: String
}

```

You can now get your hands dirty, there is nothing complex that you need to do. Unless you have a bigger goal and more entities to relate to. And in general, all existing practices in the GraphQL community apply to Dgraph’s GraphQL.

---

<div class="post-metadata">

**Author:** ![maksymsur](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/maksymsur/32/6626_2.png) [@maksymsur](https://discuss.dgraph.io/u/maksymsur)\
**Post date:** [March 5, 2021, 8:42am UTC](https://discuss.dgraph.io/t/sensor-temporal-data-storage-best-practices/13067/3 "2021-03-05T08:42:58Z")

</div>

Thanks!
