Need suggestion on data model

49 views
Skip to first unread message

gokulakanna balakrishnan

unread,
May 29, 2012, 12:24:39 PM5/29/12
to Neo4j
Hi All,

In my application there are message sent from one user to another
user in the system. Users are maintained user node.
And each message are held in message node. I want to track the
messages sent and reply togather.
I am creating relationship following way. Please suggest me my data
model is correct or not.



USER_MESSAGE SENT_AND_REPLAY
User----------------MessageS(Bi-direction relationship)----------------
>ConversationMessage



Please suggest me my data model is correct or not.


Thanks & Regards,
Gokul

Chris Albertson

unread,
May 29, 2012, 12:46:01 PM5/29/12
to ne...@googlegroups.com
Maybe more simple is to have the users be nodes the the messages are the edges that pint to sender to receiver.  I think this is more natural.  Thisnk of it as saying that "users are related by the =messages they sand to each other."
--

Chris Albertson
Redondo Beach, California

gokulakanna balakrishnan

unread,
May 29, 2012, 1:51:46 PM5/29/12
to ne...@googlegroups.com
Hi,
outgoing
User A sent message to user B UserA-------->Message

incoming
User B will receive the message. UserB<------Message(attaching)

outgoing
User B replied to User A : UserB------>Message

If user B replied to A is message. New message object will be
created. how to maintain sequence between those messages(conversation
between A and B) in neo4j.

Thanks & Regards,
Gokul

gokulakanna balakrishnan

unread,
May 29, 2012, 2:55:29 PM5/29/12
to ne...@googlegroups.com
Hi All,

Currently I am working on this model. Please help me create data
model for this kind of scenario.

Thanks & Regards,
Gokul

Michael Hunger

unread,
May 29, 2012, 7:19:31 PM5/29/12
to ne...@googlegroups.com
The simplest would be to use a timestamp and use that ordering.

Michael

Chris Albertson

unread,
May 29, 2012, 9:02:50 PM5/29/12
to ne...@googlegroups.com


On Tue, May 29, 2012 at 4:19 PM, Michael Hunger <michael...@neotechnology.com> wrote:
.

>   If user B replied to A is message. New message object will be
> created. how to maintain sequence between those messages

Look at the email headers.  You will find that most of them already have a line that starts "In-Reply-To:" and then has a message ID.  

What you really should do is use this existing email headers.   The chain of "in-reply-to" pointers will do what you want

Likewise if filing measles there are other headers, like sender to "to"  that would make idea links

 

Duane Nickull

unread,
May 30, 2012, 1:58:51 AM5/30/12
to ne...@googlegroups.com
There are a few things that may affect this.  Are the messages
asynchronous or synchronous?  Are there reliable messaging mechanisms
built into the exchange?  For example,
A-[sends_message]->B get through
A-[sends_message]->B but it gets lost in cyberspace.
B-[sends_message]->A and it gets through // replying to message one
A-[sends_message]->B which is a resend of the first message because if
never received an ack.

...
More to this than meets the eye sometimes.

I worked within OASIS on WS-RX.  YOu might want to read up on this:



THere are some scenarios modelled there that may be of interest.

Duane Nickull
***********************************
Consulting and Contracting; Proven Results!
i.  Neo4J, Java, LiveCycle ES, Flex, AIR, CQ5 & Mobile
t.  @duanechaos
"Don't fear the Graph!  Embrace Neo4J"


Reply all
Reply to author
Forward
0 new messages