Hi there! I’m Luis from the Metabase Success team. A few days ago we had a webinar about using Metabase with CrateDB and I showed how to connect Metabase to CrateDB and I mentioned that you could do things programatically (everything in Metabase is an API call).
I would like to post here the repository with the demo and explain some steps so anyone can play with Metabase and CrateDB without the hassle of setting everything up: GitHub - paoliniluis/metabase-cratedb: A fully working demo of Metabase with CrateDB
So first things first:
- you can use or reuse the repository code as much as you want
- you need Docker to run that, if you don’t know what Docker is, just grab any video that explains Docker so you can get up to speed fast (P.s. It’s a way of spinning up apps in your machine without messing around with dependencies and exploding everything in the air to end up reinstalling the entire OS)
- in Metabase you can do almost everything through the API
Let’s get started:
- docker-compose.yaml: this file is to orchestrate the containers, you’ll find 6 of them:
- Metabase: the actual Metabase product
- Postgres App DB: Metabase needs a DB to save questions/dashboards/users, etc. I chose Postgres for the matter (only Postgres and MySQL are supported)
- Crate DB: the actual CrateDB database
- Crash: a container that I build from scratch that has Crash, the CLI client for CrateDB. This container is built with the instructions in crash/Dockerfile, and runs the SQL file that’s in that same folder as well. This container waits till CrateDB is up and then fires the queries.
- Maildev: an email server, so you can test the subscriptions (emails) that Metabase sends periodically
- Setup: just a container that waits for Metabase to be up, so then it can start firing API calls to Metabase to set it up and do stuff. This container grabs the script that’s on the setup folder and executes it, nothing more than that. If you want to check how to play with Metabase API check here: Working with the Metabase API
How to run all of this? simply clone the repo and do “docker compose up” on the root of the folder. You should be able to go to localhost:3000 when Metabase boots
Have fun!