Managing Data lake clean - what type of data should be stored on each layer

Help

Hello Everyone!

I'm working on some personal project scraping data from friend's API and would like to ask you for advice as not I'm trying to figure out what data should be stored on each layer of my Data Lake. I've come up with idea to build 3 layers of my Data Lake: Bronze, Silver and Gold. I'm trying to build Kimball style Delta Lake on top of those data, at the moment I'm using Databricks for it. In mid to long term I'm thinking about moving to Postgres to simulate Data Warehouse loading jobs and test writing scripts as python files and executing them via HD Insight instead of running it inside Databricks environment.

My main concern is if it's worth to store archive data on Staging layer or should I only maintain only one file for each normalized endpoint. For this layer, maintaining schema that creates new source directory with each job is a little pain in the ass for me personally, but I'm not sure if it's important yet.

Also I'm a little concerned about Gold layer schema - is it enough to maintain sufficient access control if it was business use or should I redesign it? If so, what layer should be used and when?

-----------------

​

My architecture concept looks like described below:

Bronze Layer:

Purpose: reads application API and stores it in distinct files. Each GET job yields new file directory named of job date. Files are saved as .json

Schema:

bronze:
|- General
    |- Application 1
        |- Endpoint 1
            |- ts_XX-XX-XX_xx:xx:xx
            |- ts_XX-XX-XX_xx:xx:xx
        |- Endpoint 2
    |- Application 2
        |- Endpoint 1
            |- Schema 1
            |- Schema 2
|- Sensitive
    |- Application 1 
...

-----------------

Silver Layer:

Purpose: normalizes data and applies correct data formats to schemas. Files saved as .parquet

Schema:

silver:
|- General
    |-Master:
        |- Application 1
            |- Endpoint 1
                |- ts_XX-XX-XX_xx:xx:xx
                |- ts_XX-XX-XX_xx:xx:xx
            |- Endpoint 2
        |- Application 2
            |- Endpoint 1
                |- Schema 1
                |- Schema 2
    |- Delta:
        |- Application 1
            |- Endpoint 1
                | file.parquet
            |- Endpoint 2
                | file.parquet
        |- Application 2
            |- Endpoint 1
                |- Schema 1
                    | file.parquet
                |- Schema 2
                    | file.parquet
|- Sensitive
    |- Application 1
...

-----------------

Gold layer:

Purpose: Provides analytics-grade datasets. Files saved as .csv as I'm reading them later using functions. Each next job moves previous result_file to Archive directory so in case of any ETL error I'm able to easily revert data to reflect previous cycle's data

Schema:

gold:
|- General
    |- Application 1
        |- Dataset 1
            |- Archive
            | result_file.csv
        |- Dataset 2
            |- Archive
            | result_file.csv
    |- Application 2
        |- Dataset 1
...

Thanks for taking your time and Happy Holidays!

Posted Dec 26, 2021, 4:17 PM UTC · edited

3014
Loading comments…