Sector spell design: how to organize the dbt lineage #4625
Replies: 11 comments 1 reply
-
This PR is an example of using Option B: #4519 |
Beta Was this translation helpful? Give feedback.
-
cc: @aalan3 @jeff-dude @couralex6 @Hosuke |
Beta Was this translation helpful? Give feedback.
-
Based on the description above, I think currently I am using the Option A approach in this PR: #4533 But I can change the implementation/approach based on the conclusion in this issue. Also now here is the Option B approach demo: #4607 |
Beta Was this translation helpful? Give feedback.
-
thanks @0xRobin for putting together the options, nice to see some reflection on the redesign after taking a step back during migration and then revisiting. my main concern when redesigning spells -- with sector spells such as dex/nft trades being best examples -- is reducing downstream lineage dependencies for prod orchestration. one of our main tasks this quarter is to reduce downstream dependencies from with that said, my concern with option B, if i'm following exmple PR properly, is that we still materialize each project spell with metadata included from erc20 tokens. the goal moving forward should always be:
|
Beta Was this translation helpful? Give feedback.
-
i didn't find this too complicated, but of course, i'm biased as an every day user of spellbook. outside opinion would be appreciated |
Beta Was this translation helpful? Give feedback.
-
after further discussion, we'll go with option A above, but slightly modified. the tl;dr:
this is where
here is more detailed dex lineage example:
i'm comfortable with either approach, as the goal is to try to avoid having all of these intermediate spells queried anyway, while pushing for usage on the sector-level spell itself instead. |
Beta Was this translation helpful? Give feedback.
-
@0xRobin @aalan3 please do share opinion on this, whether we choose one route or both, then we can close this issue as resolved and feel confident moving forward on sector redesigns. |
Beta Was this translation helpful? Give feedback.
-
Since the goal is to not expose and query them, I tried to clean them up and remove them as much as possible. There's no need to have |
Beta Was this translation helpful? Give feedback.
-
#4519 shows of the new structure. |
Beta Was this translation helpful? Give feedback.
-
yep, i like this perspective. i'm comfortable with:
that keeps the changes minimal on the new nft lineage, and gives us a framework for dex. of course, nft is a bit different with events/trades/mints/etc, but for simplicity, we'll keep examples as above. each sector will have minor differences at the sector level, but in general, this flow will be consistent. PRs to follow! |
Beta Was this translation helpful? Give feedback.
-
i've converted the original issue into a discussion. i think we can centralize the conversation here and continue to link examples as we go. not 100% sure this is the best path, but giving it a go. |
Beta Was this translation helpful? Give feedback.
-
I'm going to expand the current
nft.trades
base_trades
models design from ethereum to the other chains.While we're also applying the same macro design to the
dex.trades
sector spells, I think it's a good time to reflect on the current design and to make a judgement call on the preferred order of operations. There are 2 main possibilities, both with pros and cons.The elements:
(ex:
models/_sector/nft/trades/ethereum/platforms/blur_ethereum_base_trades.sql
)(ex:
macros/models/_sector/nft/enrich_trades.sql
)(ex:
models/_sector/nft/trades/nft_ethereum_trades_beta.sql
)(ex:
models/_sector/nft/trades/nft_events.sql
)The 2 options
A: base -> chain-union -> enrich -> sector-union (current)
This is what we currently do in the
nft.trades
lineage, where the chain-union and enrich step happens withinnft_ethereum_trades_beta.sql
pro's:
con's:
B: base -> enrich -> chain-union -> sector-union
Here we would design the enrichment macro to only do the enrichment, the macro should be applied within the platform model after collecting the base columns from the platform contract tables.
pro's:
con's:
Beta Was this translation helpful? Give feedback.
All reactions