Storing orders, trades data in Influxdb



My name is Anish. I just started to use influx and would like to store crypto (trade, order) data.
The data comes from a websocket as JSON, i will parse using Java and would like to write to influx.
Should i be creating:
different measurements like asks, trades, bids?
use Tags like currency_pair, trade_type?
use Fields like price, amount, tid, last_price?

Sorry, i am perplexed on how to write all the below data to influx, any pointers should be very helpful.

Thanks and Regards

Below is the data that comes as a single JSON:
“currency_pair”:“xem_jpy”,“timestamp”:“2018-03-15 13:41:24.923787”}


Hi Anish,

You ask a really great question. Schema design is really important to your InfluxDB instance as it can heavily impact the database’s query performance. I think you’re pretty on point with what you have so far, but I would also recommend reading through the InfluxDB schema design documentation to gain a better understanding of how you want to organize your data within InfluxDB. The docs discuss general guidelines - for example, it’s best practice to store meta data in tags rather than fields, as queries on tags are more performant than those on fields, and tags are always stored as strings (so if the value needs to be a non-string, it should be stored as a field value).

Hopefully this provides a better understanding of how you can design your schema for InfluxDB.

Best of luck!