Hi

I'm trying to figure out how to design a graph database where I have

1. Users
2. Groups
3. Items
4. "credit_line" -relation between Users. A balance of credit.
5. "credit_line" -relation between Users and Groups.
6. "memberOf"-relation from Users to Groups.
7. "have" -relation between User and Item.
8. "display" -relation between Item,User and User/Group. (A triple) (a Item
belonging to a User is displayed as available for only a specific
group/user, or multiple groups/users. This is unclear how it should be
represented in neo4j, does it need a node?)
9. "owesItemTo" -relation between User, Item, User/Group. (A triple, Do I
need a node?)

The credit line will have limits. [Credit given by node A and Credit given
by node B] These limits defines the credit line.

My thoughts are therefore to place the balance accounting as a property on
the edges in the database.

Node:User  -- Edge with Property: Credit line, value -- Node:User
Node:User  -- Edge with Property: Credit line, value -- Node:Group

But I feel that this approach is kind of weak. I really don't know how to
represent the credit line. (Maybe it needs a node... Because if I use two
directed edges they need to be synchronised all the time. If A owes value to
B, B owes -value to A)

How would you have designed this?

It is to be used as a multi user database.
I will therefore use a lot of transactions in the application, editing
balances between users and groups, in long chains as atomic actions. (This
has to be quick so that the same node and edges can be used by the next
transaction.)

I have thought about traversal algorithms that may be executed in advance to
find a path. And then try to use the pre-discovered path in a quick
transaction, or roll back if the path no longer has enough credit available
in all the chain.

To understand how my credit line should be used you can take a look att
ripplepay.com. But I'm designing a barter system with items.
-- 
//Benjamin Gustafsson
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to