On Sat, Feb 7, 2009 at 11:14 AM, Guri <sgurmin...@gmail.com> wrote:

>
> Hi,
>            Its been now approx. 6 months I am working with Django and
> I must say all issues that came my way were solved either by this or
> that post, blog, tutorial. Support of Django is marvelous.
>          This time I am stuck with a design issue rather Django.
>
> * I have a Users Master table and they have their profiles and stuff.
> Thing I am trying to implement is "User can follow many other users
> (something similar to people following on Twitter)".
>
> I can think of two approaches:
>
> 1. Add a new table with two fields( following user, followed user).
>
> 2. Add a field in User master table of type String and length say
> 200.
> Storing the user IDs of followed users separated by space.
>
> Which will be a better approach with scaling up in mind?
>
> I am using Django with MySql.
>
> Thanks In Advance
> Guri
>
> >
>
Using the second table is a far better architecture, since there are many
types of queries that you couldn't properly do on a string field, such as
how would you ask if user 1 was following user 10?

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to