Using TickTockDB (open source Time Series DataBase) on RPI 2 model B or RPI 3 and Node-red

I stumbled on Ticktockdb awhile ago and decided to try it as a replacement for Influx. After some starts and stops, I got it to install on a Rpi 2 Model B and it is running with no problems that I see.

I have three sensors sending data (Temperature, Pressure and Humidity) via MQTT so I built a flow that gets the data, formats it and sends it to the ticktockdb. I also build a dashboard that graphs the data based on selectable criteria.

Here are the instructions for installing ticktockdb:
TICKTOCK on PI 2 Model B.pdf (62.4 KB)

and here is the flow for accessing it:
ticktockdb-v01.json (34.4 KB)

And here are a couple graphs



I've been running this for a couple weeks and have seen no change in the SD card usage or processor.

8 Likes

It looks like a good option for low power devices, (according to the developers at least :wink: )

1 Like

I also installed on a pi4 with no issues.

1 Like

Very interesting. It looks like this TickTock database is faster than Victoria Metrics, and uses less resources too.

A database running on Pi2 is impressive. I see the potential of this database for IOT applications.

2 Likes

hi, TickTockDB(TT) co-author here. @zenofmud Thanks a lot for your efforts in Node-red.

For those interested in TSDB, here are some of our design goals of TickTockDB:

  1. Lightweight (runnable on SoC, e.g., RaspberryPI or OrangePI, ARM or X86, 32 or 64 bit OS);
  2. High perf,(10x influx, 80x opentsdb, benchmarks here );
  3. Simple maintenance (1 process only, easy to move/backup data around, docker ready);
  4. Compatible with opentsdb APIs and influx line protocol

You're welcome to try TT. Don't hesitate to contact us if you had any problems.

Yi

5 Likes

Just wanted to add on here that i asked some questions re docker deployment on their github and they were onto it almost immediately - great support

Craig

2 Likes

Unfortunately does not run on my Rasp3 as a new glib version is required:

./bin/tt: /lib/arm-linux-gnueabihf/libm.so.6: version `GLIBC_2.29' not found (required by ./bin/tt)

How are you trying to install it?

Edit also what version of the OS are you using (cat /etc/os-release)

This is on:

Raspbian GNU/Linux 10 (buster)

I just tried to compile the complete package but there is an error at the end:

g++ -pthread -flto   -o bin/tt objs/admin.o objs/global.o objs/main.o objs/agg/aggregate.o objs/agg/down.o objs/agg/rate.o objs/core/page.o objs/core/memmgr.o objs/core/mmap.o objs/core/udp.o objs/core/compress.o objs/core/ts.o objs/core/http.o objs/core/part.o objs/core/tcp.o objs/core/task.o objs/core/dp.o objs/core/cp.o objs/core/tsdb.o objs/core/query.o objs/utils/leak.o objs/utils/strbuf.o objs/utils/range.o objs/utils/kv.o objs/utils/bitset.o objs/utils/timer.o objs/utils/append.o objs/utils/utils.o objs/utils/meta.o objs/utils/meter.o objs/utils/stats.o objs/utils/config.o objs/utils/logger.o objs/utils/sync.o objs/utils/tag.o objs/utils/fd.o objs/utils/hash.o objs/utils/json.o  -lz
lto1: internal compiler error: compressed stream: data error
0x76aa4767 __libc_start_main
	/build/glibc-lsttuD/glibc-2.28/csu/libc-start.c:308

I guess updating the complete OS just for the purpose of this database is too cumbersome...?

I don't understand, initially you said it would not run, now you say it will not compile.

The tar file at Github includes precompiled binaries for Raspberry OS but also the complete source code. Thus you can execute a simple make statement to get a new binary.
My hope was that the compiled binary would be satisfied with the older glibc version.

The docs say that it only needs 2.17, so I suggest you ask the authors.

The easiest way is probably to use the Docker version.

Well not unusual for Linux software that docs and source code is out of sync.. :face_with_diagonal_mouth:
Docker is too much effort to compensate a programmers quirk like this. I will look for other TS databases.

Perhaps @ylin30 can help.

I tried doing it on a Pi3 and hit the same error using buster. HOWEVER if you upgrade or flash an SD card to Bullseye, then it installs and starts up fine for me.

Ok, so might be an option for a future upgrade, maybe when switching to a new raspberry.
Meanwhile I installed influxDB without any problems :smirk:

@haegar33 Sorry for the inconsistent glibc version in doc. We're looking at the installation in buster OS now.

The Glibc_2.17 in doc was added in an old TT version a couple of years ago. Here is my env. My college's glibc is 2.29.

ylin30@rpi4:~ $ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
ylin30@rpi4:~ $ cd ticktock/
ylin30@rpi4:~/ticktock $ ./scripts/glibc-version.sh
2.31
ylin30@rpi4:~/ticktock $
1 Like

@haegar33 Hi, we created a new binary pkg for 32bit Buster OS with Glibc-2.28. We don't have a PI-3 but we did verify it in PI-0 and PI4 with Buster/Bullseye and Glibc-2.28 or higher.

We also updated the doc.

You're welcome to give a try. Honestly, TT is just a 2-persons open-src project. It not as mature as InfluxDB but much more lightweight than InfluxDB (you can read our benchmark perf tests). If InfluxDB's perf is good enough for you, your better choice will be InfluxDB.

FYI, interestingly we can't repro building failure in Buster+glibc2.28. The build went through although there are warnings as shown below.

g++ -I include -std=c++11 -Wno-unused-result -Wno-format-truncation -Wno-psabi -flto    -O3 -march=native -ffast-math -c src/utils/json.cpp -o objs/utils/json.o
g++ -pthread -flto   -o bin/tt objs/admin.o objs/global.o objs/main.o objs/agg/aggregate.o objs/agg/down.o objs/agg/rate.o objs/core/page.o objs/core/memmgr.o objs/core/mmap.o objs/core/http.o objs/core/compress.o objs/core/ts.o objs/core/udp.o objs/core/part.o objs/core/tcp.o objs/core/task.o objs/core/dp.o objs/core/cp.o objs/core/tsdb.o objs/core/query.o objs/utils/leak.o objs/utils/strbuf.o objs/utils/range.o objs/utils/kv.o objs/utils/bitset.o objs/utils/timer.o objs/utils/append.o objs/utils/utils.o objs/utils/meta.o objs/utils/meter.o objs/utils/stats.o objs/utils/config.o objs/utils/logger.o objs/utils/sync.o objs/utils/tag.o objs/utils/fd.o objs/utils/hash.o objs/utils/json.o  -lz
/tmp/cc83a9z6.s: Assembler messages:
/tmp/cc83a9z6.s:1286: This coprocessor register access is deprecated in ARMv8
....
/tmp/ccsmghSg.s:1066: This coprocessor register access is deprecated in ARMv8
/tmp/ccsmghSg.s:1068: This coprocessor register access is deprecated in ARMv8
ylin30@pi4-buster32:~/ticktock $ ./bin/tt -c conf/tt.conf &
[1] 3013
ylin30@pi4-buster32:~/ticktock $  TickTockDB v0.12.1,  Maintained by
 Yongtao You (yongtao.you@gmail.com) and Yi Lin (ylin30@gmail.com).
 This program comes with ABSOLUTELY NO WARRANTY. It is free software,
 and you are welcome to redistribute it under certain conditions.
 For details, see <https://www.gnu.org/licenses/>.
Writing to log file: /home/ylin30/ticktock/log/ticktock.log

ylin30@pi4-buster32:~/ticktock $
ylin30@pi4-buster32:~/ticktock $ ./admin/ping.sh
pong
ylin30@pi4-buster32:~/ticktock $ ldd --version
ldd (Debian GLIBC 2.28-10+rpt2+rpi1) 2.28
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
ylin30@pi4-buster32:~/ticktock $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
ylin30@pi4-buster32:~/ticktock $
2 Likes

Thats great! Thanks a lot. I am just in my learning curve for timebased databases. So far the influxDB on my Pi3 seems ok but on the long run I would prefer a lightweight solution as this Pi3 hosts several applications.
I assume when I learn influxDB I am also able to handle your database system?
I will give it another try and compare with influxDB

According to our perf benchmarks in RaspberryPI4, InfluxDB's bottleneck is IO, and then CPU. Memory looks fine.

In terms of time series concepts they are the same. TT can use Influx write-line protocol for writes which is much more concise than OpenTSDB's write protocol. We like Influx's SQL like query format but TT doesn't support this, yet. Also TT doesn't provide replication for the time being, same as open-src version of InfluxDB. InfluxDB's enterprise version does provide replication for a charge.