Domain design advice wanted

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Domain design advice wanted

micke_
Hi

I've got a site written in Grails to which I want to add a feature similar to the facebook timeline.

A quick note about the domain model:
- User, normal spring security user
- Area , logical area a user belongs to (currently corresponds to geographical area) tree structure
- Friends, collection of users a user is connected to
- BlogMessage, simple blog message (more like status update) from a user
- Document , a document uploaded by a user
- AreaNews , a news message posted to an area (and its child areas) readable by all though.
- UserMessage, special type of message sent to one or more users. Typically to all users in an Area
- ConversationMessage, a message in a conversation between two or more users (friends only)
- News, a news item unrelated to users or areas

The stuff which I want to appear on a users "timeline" (not sure what to call it yet) are:
- BlogMessages from friends
- New Documents added, show info that a new document has been uploaded from a user in 'your' area
- UserMessage, the UserMessage
- News, short text of global news items
- and more

And additionally I want users to be able to add comments to these items.

I'm currently struggling a bit with how to implement this in a way which is scalable especially  since I want to pull in information from many different Domain classes based on different criterias ( some is associated to the user, some to his/hers area and some to his/her friends).

I could simply query each Domain class for its data and merge it into the list to render, but this has issues with pagination etc. and would be quite chatty with the DB (running on small EC2 instance so not loads of memory).

It would be awesome if I could somehow have an abstract EventItem representation or similar which was easy to query and render.
But not sure how that would be implemented in a way which is good from a DB query and page rendering point of view.

And then we've got the comments bit as well.

Basically lots of things to consider and I imagine an impossible question to answer, but would love to hear suggestions and/or information about how similar tasks were solved.

Cheers,
 Micke
Reply | Threaded
Open this post in threaded view
|

Re: Domain design advice wanted

Mike Powers
Hi Micke,
  I don't have any specific advice regarding your question, but you may find the following presentation useful. The slides covers the approach used by Etsy to build a user activity feed. I found the slides very interesting:


This stackoverflow question also seems like it may also have some good information:



Good Luck!
-Mike


On Sun, Nov 25, 2012 at 8:53 AM, Mikael Andersson <[hidden email]> wrote:
Hi

I've got a site written in Grails to which I want to add a feature similar to the facebook timeline.

A quick note about the domain model:
- User, normal spring security user
- Area , logical area a user belongs to (currently corresponds to geographical area) tree structure
- Friends, collection of users a user is connected to
- BlogMessage, simple blog message (more like status update) from a user
- Document , a document uploaded by a user
- AreaNews , a news message posted to an area (and its child areas) readable by all though.
- UserMessage, special type of message sent to one or more users. Typically to all users in an Area
- ConversationMessage, a message in a conversation between two or more users (friends only)
- News, a news item unrelated to users or areas

The stuff which I want to appear on a users "timeline" (not sure what to call it yet) are:
- BlogMessages from friends
- New Documents added, show info that a new document has been uploaded from a user in 'your' area
- UserMessage, the UserMessage
- News, short text of global news items
- and more

And additionally I want users to be able to add comments to these items.

I'm currently struggling a bit with how to implement this in a way which is scalable especially  since I want to pull in information from many different Domain classes based on different criterias ( some is associated to the user, some to his/hers area and some to his/her friends).

I could simply query each Domain class for its data and merge it into the list to render, but this has issues with pagination etc. and would be quite chatty with the DB (running on small EC2 instance so not loads of memory).

It would be awesome if I could somehow have an abstract EventItem representation or similar which was easy to query and render.
But not sure how that would be implemented in a way which is good from a DB query and page rendering point of view.

And then we've got the comments bit as well.

Basically lots of things to consider and I imagine an impossible question to answer, but would love to hear suggestions and/or information about how similar tasks were solved.

Cheers,
 Micke

Reply | Threaded
Open this post in threaded view
|

Re: Domain design advice wanted

micke_
Great links, hopefully they will enlighten me somewhat!

Many thanks,
 Micke


On 26 November 2012 04:30, Mike Powers <[hidden email]> wrote:
Hi Micke,
  I don't have any specific advice regarding your question, but you may find the following presentation useful. The slides covers the approach used by Etsy to build a user activity feed. I found the slides very interesting:


This stackoverflow question also seems like it may also have some good information:



Good Luck!
-Mike


On Sun, Nov 25, 2012 at 8:53 AM, Mikael Andersson <[hidden email]> wrote:
Hi

I've got a site written in Grails to which I want to add a feature similar to the facebook timeline.

A quick note about the domain model:
- User, normal spring security user
- Area , logical area a user belongs to (currently corresponds to geographical area) tree structure
- Friends, collection of users a user is connected to
- BlogMessage, simple blog message (more like status update) from a user
- Document , a document uploaded by a user
- AreaNews , a news message posted to an area (and its child areas) readable by all though.
- UserMessage, special type of message sent to one or more users. Typically to all users in an Area
- ConversationMessage, a message in a conversation between two or more users (friends only)
- News, a news item unrelated to users or areas

The stuff which I want to appear on a users "timeline" (not sure what to call it yet) are:
- BlogMessages from friends
- New Documents added, show info that a new document has been uploaded from a user in 'your' area
- UserMessage, the UserMessage
- News, short text of global news items
- and more

And additionally I want users to be able to add comments to these items.

I'm currently struggling a bit with how to implement this in a way which is scalable especially  since I want to pull in information from many different Domain classes based on different criterias ( some is associated to the user, some to his/hers area and some to his/her friends).

I could simply query each Domain class for its data and merge it into the list to render, but this has issues with pagination etc. and would be quite chatty with the DB (running on small EC2 instance so not loads of memory).

It would be awesome if I could somehow have an abstract EventItem representation or similar which was easy to query and render.
But not sure how that would be implemented in a way which is good from a DB query and page rendering point of view.

And then we've got the comments bit as well.

Basically lots of things to consider and I imagine an impossible question to answer, but would love to hear suggestions and/or information about how similar tasks were solved.

Cheers,
 Micke