Skip to content

Instantly share code, notes, and snippets.

@amineHY
Created October 25, 2022 20:25
Show Gist options
  • Save amineHY/756ed6a730eaf4a0de4756ab3513bee2 to your computer and use it in GitHub Desktop.
Save amineHY/756ed6a730eaf4a0de4756ab3513bee2 to your computer and use it in GitHub Desktop.
- [Data visualization using Redash](#data-visualization-using-redash)
- [What is Redash](#what-is-redash)
- [Supported Data Source:](#supported-data-source)
- [5 Simple Steps](#5-simple-steps)
- [Setup Redash on the AWS Cloud](#setup-redash-on-the-aws-cloud)
- [Create an EC2 instance](#create-an-ec2-instance)
- [Connect to AWS EC2 instance](#connect-to-aws-ec2-instance)
- [Access Redash UI](#access-redash-ui)
- [Dashboard Example](#dashboard-example)
- [Conclusion](#conclusion)
- [Setup Redash (Version 10) Locally using Docker](#setup-redash-version-10-locally-using-docker)
- [Access to Redash UI](#access-to-redash-ui)
- [Redash Initial Setup](#redash-initial-setup)
- [Adding a Data Source](#adding-a-data-source)
- [Google Sheet](#google-sheet)
- [Query data from Google Sheet](#query-data-from-google-sheet)
- [Dashboard Example](#dashboard-example-1)
- [Start and Stop Redash service](#start-and-stop-redash-service)
- [Reference](#reference)
---
![](images/2022-10-24_22-56.png)
# Data visualization using Redash
<!-- ## article 1 : Redash: Free and simple DataViz Tool -->
## What is Redash
Redash is a very powerful Data Viz tool to **connect** to any data source (PostgreSQL, MySQL, Redshift, BigQuery, MongoDB, Databricks and many others), **query**, **visualize** and **share** your data to make your company data driven - [Redash](https://redash.io/).
It is the official DataViz tool integrated inside [Databricks](https://www.databricks.com/blog/2020/06/24/welcoming-redash-to-databricks.html), the unified platform for data science, data engineer, data analyst, ML engineer
![](images/2022-10-24_23-16.png)
### Supported Data Source:
* Amazon Athena,
* Amazon CloudWatch
* Amazon Redshift
* Axibase Time Series Database
* BigQuery
* CSV Files
* CSV Files (Deprecated)
* Databricks
* DynamoDB
* Elasticsearch
* Google Analytics
* Google Sheets
* JIRA
* JSON API's
* Microsoft Azure SQL Database & Synapse
* MongoDB
* Python
### 5 Simple Steps
Using Redash is very simple, here are the 5 steps in orders to achieving a stunning result for DataViz
* Add a data source
* Write a query
* Add a visualization
* Create a Dashboard
* Invite colleagues
More details can be found [here](https://redash.io/help/user-guide/getting-started#5-Invite-Colleagues).
Redash uses technologies such as `postgres` , `Redis` and `NGIX`.
<!-- ![Untitled](images/Untitled%208.png) -->
Running Redash for the first time may require some experience, depending on where you would like to deploy it. In this article I will cover two deployment mode I went through : Locally and on the AWS cloud.
---
## Setup Redash on the AWS Cloud
### Create an EC2 instance
Head to the [setup page](https://Redash.io/help/open-source/setup#-AWS) and click on one AMI link on the left column of the table as shown in the image below
![Untitled](images/Untitled.png)
- In my case, I chose the one inside the purple rectangle ([AWS EC2 EU-West-3](https://eu-west-3.console.aws.amazon.com/ec2/home?region=eu-west-3#LaunchInstances:ami=ami-041bf9180061ce7ea))
Once on the AWS EC2 webpage, you must sign in, then, you will be walked through different configurations to setup the instance.
- An ubuntu image with Redash installed is preselected from the catalog
![](images/2022-10-24_23-32.png)
- For the **instance type**, make sure you select at least `t2.small` as show in the image below
![Untitled](images/Untitled%201.png)
- For **Network setting**, here is my configuration, of course you can create a new VPC and Security Group or just reuse existing ones.
![Untitled](images/Untitled%202.png)
*Note*: Make sure `Auto-assign public IP` is enabled
- The rest of the steps are pretty straightforward, so you should be able to follow along
- At the end you should validate the instance summary and proceed to the creation of the instance
*Note*: Do not forget to keep the key pair file you created to connect later to the instance locally from an SSH client
<!-- // TODO -->
### Connect to AWS EC2 instance
After the creation of the instance, comes the time to connect to it in order to interact with the machine and launch Redash dashboard. I chose to connect via SSH client (e.g. OpenSSH in my Ubuntu). Head over to the `connect to instance` then `SSH client` to see the steps to follow to establish a connection
![Untitled](images/Untitled%203.png)
- The details from the screenshot above are straightforward. From the terminal (Ubuntu in my case), run the following commands, and make sure the user name is `ubuntu` (and not `root`)
```bash
chmod 400 Redash_key_pair.pem
ssh -v -i "Redash_key_pair.pem" ubuntu@ec2-xx-xxx-xxx-xxx.eu-west-3.compute.amazonaws.com
```
- After login, you should get a similar log
![](images/2022-10-24_23-50.png)
<!-- // TODO -->
### Access Redash UI
- First, note the Public IP address as shown in the image below
![example](images/Untitled%204.png)
- From here, you just have to open a browser on you local machine and insert the public IP address (`Xx.xx.xxx.xxx`) of the AWS EC2 instance followed by the port 5000 (i.e, `http://Xx.xx.xxx.xxx:5000/`). If everything is correct, you should get a similar result
![Untitled](images/Untitled%205.png)
- After filling the form and clicking on `Setup` you should land on the home page 🚀
![Untitled](images/Untitled%207.png)
🥳️ **Congratulation** if you made it this far 🥳️
- Now that Redash is up and running, you just need to follow the steps highlighted by the purple rectangle in the previous image, connect a data source, create a query, create a dashboard and Voila !
## Dashboard Example
![](images/2022-10-25_22-10.png)
## Conclusion
You don't have
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment