Forum Discussion

dtran9936's avatar
dtran9936
Frequent Visitor
1 year ago
Solved

Need advice on the Gold Layer

Hello,   I just need some guidance on the best practice on the medallion layer. Let me explain the scenario Scenario is in Incremental ELT   Bronze (Lakehouse): Load delta data base on Watermark...
  • ucarbengisu's avatar
    1 year ago

    Hello dtran9936,

    I think you should start by building a Gold View that handles deduplication first. After that, Stored Procedures should simply query this clean, pre-processed Gold View.

    By doing this, Stored Procedures stay simple and focused only on business logic, without having to deal with cleaning the data. If the deduplication rules change later, you only need to update the Gold View, not multiple Stored Procedures. This makes the system easier to maintain and more flexible.

    The "latest record" logic is contained within the Gold View, which makes it easier to test and validate separately from the business logic. Since the Gold View handles deduplication and selects the most recent records, it can be tested on its own, without involving other parts of the system. This separation makes the whole system more organized and easier to manage.

    As far as I know, this approach follows best practices for creating a clean, modular, and maintainable system. It keeps your business logic separate from data processing, which helps make the system more flexible and easier to work with over time.

  • V-yubandi-msft's avatar
    1 year ago

    Hi dtran9936 ,

    Best practice is to create a Gold View to manage deduplication first, followed by building Stored Procedures on top of this clean view. This approach has several advantages

    1. Keeps business logic and data cleaning distinct for better clarity and organization.
    2. Makes Stored Procedures more straightforward and easier to manage over time.
    3. Allows seamless updates if deduplication rules need to be modified.
    4. Facilitates testing and validation of the latest records independently.

    Thank you for your valuble input ucarbengisu .

     

    If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.