Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
05-25-2022 08:31 AM
I don't know if this thread would be of interest but let me try:
I have the following concept (maybe nodes?):
The same Subbrand (name) could be owned by different brands, and these subbrands are different.
So we have a Classical Visa
and a Classical Mastercard
as two distinc nodes.
I tried with this model, but I'm unsure: I connected the card to the subbrand, and the relationship has a boolean attribute telling if it is a credit or debit card. All the card info are in the card node: The central unnamed one in the picture.
Do you have other idea on how to model these stuffs? Do you like to to discuss?
05-25-2022 10:16 AM
Maybe a couple comments, nothing critical, but just thoughts:
Do you have specific querying needs?
05-25-2022 10:30 AM
Hi Gary, thank you for your invaluable support!
The error node will have tons of relationships, but we just need it to filter/remove all legacy cards with errors, so we'll never search a card through an error.
About point 2: it looks as a interesting improvement. Just one if was looking for.
In general, our goal is to find a card thru a card hash, which is unique for each card in the world.
We maybe don't need (at the moment) to look for debit or credit cards, but I'll change as you suggested.
Another approach could have been to put brand, subbrand and type into the card as properties and add indexes .... a little bit brutal. What do you think of this latter approach?
05-25-2022 01:16 PM
Hi!
Just a couple of thoughts.
So a card mush have a hash. This is an indexed property that will allow you to anchor queries on a specific card.
Brand and Credit/Debit conditions can easily be Labels or indexed properties. It depends on the type of queries you are planning to do. If you ever want to traverse based on that property, maybe it's better handled as label. Of course you can do a VISA node but not sure if it brings anything good to your model. e.g. Adding a Visa card, so connecting it to the VISA node, will lock every other creation of a VISA card till this one is not finally commited.
Bennu
05-26-2022 02:05 AM
Hi Bennu, thank you for your suggestions.
Yes, you are right: a Brand node doesn't add anything relevant. It can be an indexed property and I should navigate if needed. But this bring us to remove the SubBrand too, for the same reasons.
And, finally, it bring us to my final question: maybe should be better to move brutally
everything as a property resulting in a simpler model.
What do you think?
05-26-2022 04:23 AM
For sure moving everything as property while make your model simpler, but less 'graphy' At that point you may ask yourself if your use case can get any benefit from a graphDB engine. Are you eventually planning to add transactions to this model? Maybe the owners of the cards (so, someone may have different cards)
Bennu
05-26-2022 04:31 AM
Hi @bennu.neo
We need a graph engine.
The question is that we have a lot of node types, relationships, transactions, payments, hardware device to control. Maybe an estimate of less than thousand of node types, and tens of millions of nodes and relationships.
Yes, definitely we need a graph DB.
But this doesn't mean that everything must be expressed with relationship, if we don't need to navigate them.
In this particular case, maybe, there could be a low adjunct value to model Brand and SubBrand as separate nodes.
But this doesn't cancel all the other considerations above.
05-26-2022 09:37 AM
Here is my model:
(Country)->(Bank)->(Brand)->(SubBrand)
05-26-2022 09:39 AM
Well, this is true, but where do you attach a CreditCard? (the violet anonymous central node in the graph above)
And the brand/SubBrand are not related to a bank, but to the CreditCard
05-26-2022 09:41 AM
(Country)->(Bank)->(CreditCard)->(Brand)->(SubBrand)
05-26-2022 09:43 AM
No, because I've not a VISA, but a GOLD<-VISA and another one has a GOLD<-MASTERCARD (two different kind of gold
)
05-26-2022 09:53 AM
The Brand and SubBrands depend on the Bank that is issuing the card.
(Country)->(Bank)->(Brand)->(SubBrand)
One can search for the Bank that offers the required credit card in a given country.
Brand indicates VISA/MASTRCARD and SubBrand contains the available options for each brand for a given Bank.
05-26-2022 10:00 AM
Well, but for us is true the reverse: we receive a card payment and we know that the payment is done with a Card which has a Brand, a SubBrand and is emitted by a Bank in a Country
And we have to check the card validity AND store the info for future complaints
05-26-2022 06:47 PM
It seems like there is little use for the relationships. It seems storing all these attributes as properties of the card allows you to retrieve this info for audit purposes, resolving disputes, and purging cards with errors. Add indexes on the appropriate properties.
All the sessions of the conference are now available online