Trello to Snowflake

This page provides you with instructions on how to extract data from Trello and load it into Snowflake. (If this manual process sounds onerous, check out Stitch, which can do all the heavy lifting for you in just a few clicks.)

About Snowflake

Snowflake is a data warehouse solution that is entirely cloud based. It's a managed service. If you don't want to deal with hardware, software, or upkeep for a data warehouse you're going to love Snowflake. It runs on the wicked fast Amazon Web Services architecture using EC2 and S3 instances. Snowflake is designed to be flexible and easy to work with where other relational databases are not. One example of this is the query execution. Snowflake creates virtual warehouses where query processing takes place. These virtual warehouses run on separate compute clusters, so querying one of these virtual warehouses doesn't slow down the others. If you have ever had to wait for a query to complete, you know the value of speed and efficiency for query processing.

Getting data out of Trello

Ok, lets claim your data from Trello. Step one is extracting it from Trello's servers.  You can do this using the Trello API. Full API documentation is available online here.

The Trello API is actually quite simple in the grand scheme of APIs, and it endpoints that can provide information on boards, lists, cards, and actions. Go ahead and use the information in the docs to get all of the datasets you need.

Sample Trello data

The Trello API returns JSON-formatted data. Below is an example of the kind of response you might see when querying for the details of a List.


[{
    "id": "4efe314cc72846af4e00008a",
    "data": {
        "list": {
            "id": "4eea4ffc91e31d174600004a",
            "name": "To Do Soon"
        },
        "board": {
            "id": "4eea4ffc91e31d1746000046",
            "name": "Example Board"
        },
        "old": {
            "name": "To Do Later"
        }
    },
    "date": "2011-12-30T21:46:52.874Z",
    "idMemberCreator": "4ee7deffe582acdec80000ac",
    "type": "updateList",
    "memberCreator": {
        "id": "4ee7deffe582acdec80000ac",
        "avatarHash": null,
        "fullName": "Joe Tester",
        "initials": "JT",
        "username": "joetester"
    }
}, {
    "id": "4efe3147c72846af4e00006d",
    "data": {
        "list": {
            "id": "4eea4ffc91e31d174600004a",
            "name": "To Do Later"
        },
        "board": {
            "id": "4eea4ffc91e31d1746000046",
            "name": "Example Board"
        },
        "old": {
            "name": "To Do Eventually"
        }
    },
    "date": "2011-12-30T21:46:47.843Z",
    "idMemberCreator": "4ee7deffe582acdec80000ac",
    "type": "updateList",
    "memberCreator": {
        "id": "4ee7deffe582acdec80000ac",
        "avatarHash": null,
        "fullName": "Joe Tester",
        "initials": "JT",
        "username": "joetester"
    }
}]

Preparing Trello data

This part can get tricky: you need to parse JSON in the API response and map each endpoint to a corresponding table in the destination database. Get a solid handle on the datatypes for each endpoint. The Stitch Trello Docs can give you a sense of what datatypes will come through the API.

Preparing data for Snowflake

Depending on the structure that you data is in, you may need to prepare it for loading. Take a look at the supported data types for Snowflake and make sure that the data you've got will map neatly to them. If you have a lot of data, you should compress it. Gzip, bzip2, Brotli, Zstandard v0.8 and deflate/raw deflate compression types are all supported.

One important thing to note here is that you don't need to define a schema in advance when loading JSON data into Snowflake. Onward to loading!

Loading data into Snowflake

There is a good reference for this step in the Data Loading Overview section of the Snowflake documentation. If there isn’t much data that you’re trying to load, then you might be able to use the data loading wizard in the Snowflake web UI. Chances are, the limitations on that tool will make it a non-starter as a reliable ETL solution. There two main steps to getting data into Snowflake:

  • Use the PUT command to stage files
  • Use the COPY INTO table command to load prepared data into the awaiting table from the prior step.

For the COPY step, you’ll have the option of copying from your local drive, or from Amazon S3. One of Snowflakes’ slick features lets you to make a virtual warehouse that will power the insertion process.

Keeping Trello data up to date

Hooray! You've written a script to move Trello data into your data warehouse. Wouldn't it be great if that was all there was to it? Consider what's going to happen in the event that new data is created, and it needs to make its way into your data warehouse?

One scenario, depending on the design of your script, would be to load the entire dataset all over again. This is as good as guaranteed to be slow and painful. Delays can be costly if you've got deadlines to meet.

The best thing you can do is build your script so it has the ability to make out fresh and updated information. Then you can incrementally update the destination. This can be settled by using primary keys in your logic. Some good examples would be modified_at, updated_at, or some other auto-incrementing field. After that, you need to figure out a way to get your script running continuously, even when you're on vacation! A cron job or continuous loop are both options here.

Easier and faster alternatives

If all this sounds a bit overwhelming, don’t be alarmed. If you have all the skills necessary to go through this process, chances are building and maintaining a script like this isn’t a very high-leverage use of your time.

Thankfully, products like Stitch were built to solve this problem automatically. With just a few clicks, Stitch starts extracting your Trello data via the API, structuring it in a way that is optimized for analysis, and inserting that data into your Snowflake data warehouse.