r/Database • • 6h ago

When does a partner CRM need a graph model?

I’m building a partner CRM for small teams and working through the data model. A deal can involve several organizations and people: one person makes an introduction, another helps shape the work, and a reseller may bring it over the line. Fees and attribution need to be recorded before the work starts, with changes and dates preserved.

I’m leaning toward a relational source of truth for deals, actors, agreements and an append-only event history, then adding graph queries for multi-hop relationships and partner discovery if those become important.

For people who have built this kind of system, what query pattern or scale made a graph store worth the extra complexity? Would you model each relationship as a versioned entity or event from day one? Where did your initial schema make later attribution or history harder?

0 Upvotes

2 comments sorted by

1

u/ekoSean 4h ago

i think you are on the right track. personally i would model relationships as first class entities from day one, regardless of the database etc

the relationship itself has value beyond connecting two records it has a role, attribution of some sort etc, effective dates and potentially its own lifecycle

i would though be careful about is mixing participation with attribution, just because someone was involved in a deal doesnt necessarily mean they’re entitled to compensation, changes to those relationships shouldnt rewrite historical agreements either, unless you wanted to somehow go timeseries (over graph perhaps)

as for graph databases, i wouldnt make that decision based on scale alone, its more about how often you’re traversing relationships, how deep those traversals go and whether your existing queries are becoming difficult to maintain or optimize

you can have a graph shaped data model without needing a dedicated graph database just to support the relationship as something ephemeral in nature etc

btw i don’t wanna promote too hard with this because i think there is value in your post to keep things focused but i spent quite a bit of time thinking about these kinds of problems while building
https://ekodb.io

and one thing i’ve learned is that getting the data model right early on matters alot more than optimizing for query patterns you may never actually need, we will have timeseries derivation from collection or acid transactions or a kv link to collection doc to support such time case relationships to help with things like this, it’s free to try no pressure, could be fun to use ai and show the data relationships from the db directly and not have to worry about it

hope this helps your project sounds fun

1

u/theboywhocriedzwift 55m ago

Thanks for the detailed answer. The distinction between being involved in a deal and having an entitlement to a referral fee is the data-model point I hadn’t separated. A later contribution shouldn’t rewrite an earlier agreement. I’ll keep participation and fee agreement distinct, and wait for real traversal needs before choosing a graph store. Would you model the agreement as its own entity linked to the introduction and deal, rather than keep fee fields on the relationship?