Home

2025

2024

Worklog

LETSGO Game

🧬

Repository Design Pattern

Date
June 12, 2025
Hours
6
Tags

I knew there was a bunch of things I should be doing.

But naaah we went deep down and dirty on building out a fully modular data layer for the polygenic risk calculator.

It started off as a light refactor, but eventually led all the way down the rabbit hole implementing the Repository Design Pattern.

This is a pattern that allows you to have a single entry point for multiple databases.

So now the GWAS data just calls a smooth Query() call, routing to DuckDB.

And the Reference Stats calls the same method, but get routed to BQ.

This means that domain logic now has a straightforward way of doing database operations without having any knowledge of how that data is actually called.

And this is exactly the level of isolation we want domain logic to have. It's concerned with the query and its results. It is not concerned with how that query is retrieved.

So yeah. Massive amount of work, but it was pissing me off that it wasn't fully working, which made me put in the extra hours to get it working.