Databáze - FluxDB

https://en.wikipedia.org/wiki/InfluxDB

Použití

https://docs.influxdata.com/influxdb/v1.6/introduction/getting-started/
https://docs.influxdata.com/influxdb/v1.6/guides/writing_data/

Docker

https://hub.docker.com/_/influxdb/

Na serveru docker2 v aplikaci Mikrocount

docker2:~# docker exec -it mikrocount_influxdb_1 influx



Výpis databází

> show DATABASES
name: databases
name
----
mikrocount
_internal

Použití databáze

use microcountWalli

Výpis tabulek

> show measurements
Pokud není žádná tabulka, tak nic nevrátí

Vložení záznamu

INSERT <measurement>[,<tag-key>=<tag-value>...] <field-key>=<field-value>[,<field2-key>=<field2-value>...] [unix-nano-timestamp]

time (a timestamp)
measurement (“cpu_load”, for example

at least one key-value field (the measured value itself, e.g. “value=0.64”, or “temperature=21.2”), and zero to many key-value tags containing any metadata about the value (e.g. “host=server01”, “region=EMEA”, “dc=Frankfurt”).

measurement ... as an SQL table,
time ... the primary index
tags and fields are effectively columns in the table
tags are indexed
fields are not indexed

The difference is that, with InfluxDB, you can have millions of measurements, you don’t have to define schemas up-front, and null values aren’t stored.

> INSERT temperature,machine=unit42,type=assembly external=25,internal=37
> show measurements
name: measurements
------------------
name
temperature

Výpis obsahu

> SELECT * FROM "temperature"
name: temperature
-----------------
time                    external        internal        machine type
1548426441483846755     25              37              unit42  assembly



Žádné komentáře:

Okomentovat

Server Side Rendering - Next

The Benefits of Server Side Rendering Over Client Side Rendering