Redash
Open source reporting app.
Few days ago I stumbled upon very nice application called redash. At first glance it looked slighly like Kibana, but after few clicks I new I need to try it out.
It’s amazing application that gives you power to visualize your datasets and share them with others via dashboards. What’s most interesting is those datasets can be stored in multiple places in multiple types of storages — I can query Postgres, MySQL, BigQuery and many more with SQL or call ElasticSearch, Kibana or Mongo with JSON DSL. List of supported DBs is long.
It’s an open source project.
Setup
To get started I prepare docker-compose script based on example file provided by redash:
I added additional database to store my dataset and configured volumes. Based on latest changes in redash GitHub I may need to update it to support seperate worker.
I run following script to create databases and setup admin user:
Like I mentioned before, redash supports many types of sources, one of them is PostgreSQL. I need to fill short form and I’m almost ready to query, I need a dataset.
Uploading sample dataset with csvkit
To give download now sample CSV dataset: http://samplecsvs.s3.amazonaws.com/SalesJan2009.csv
All I need to do is change header values to lowercase (explained below).
cat SalesJan2009.csv | sed ‘1s/.*/\L&/’ > sales.csv
csvsql –db "postgresql://import:f1d0f8c1s2k1@localhost:5432/imports" –insert sales.csv
Dashboard
I prepare few reports about sales of products, add simple chart.
After few minutes I have the dashboard ready.
Issues
I’ve noticed few issues.
- A lot changed in a last few days, setting up repository latest version requires building it from sources.
- “latest” version in docker is not latest, newer versions stored in docker are broken — they don’t work properly, so I don’t recommend changing docker-compose to pull other versions.
- There is somewhere issues with lowercase which I need to investigate. Postgresql allows to create tables with capital letters which I need to query by typing names in apostrophes. Somehow it doesn’t work in redash.