currently working on an ETL for a multi tenant app...
# ask-community
g
currently working on an ETL for a multi tenant application. Each tenant has an underlying accounting system that we need to map into our data model. So Tenant 1 and Tenant 2 could share accounting system 1 and Tenant 3 could be accounting system 2. Within each accounting system the ETL will be the same but the destinations of the assests will be different. Right now I have a couple functions that I pass in a tenant name and create all the assets for the given tenant so the psuedo code is something like
Copy code
def create_bronze_assets(tenant: str): 
    @asset(...)
    def some_asset()
    return [some_asset]

# in __init__.py that has the new defs = Definitions line
tenant_one = create_accounting_system_assets('tenant_one')
tenant_two = create_accouting_system_assets('tenant_two')
tenant_three = create_other_accounting_system_assets('tenant_three')
defs = Defintions(...)
Depending on the tenant we would materialize each set of assets once a day. I'm looking at making the assets partitioned by day for that. Then I got looking into multi dimensional partitions and possible thinking about using the tenant name as the first key of the partition and the date as the second. Any thoughts on this idea or better ways to handle this multi tenancy?
🌈 1