Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

storing a list of user numbers

y2kbgy2kbg New
edited December 2006 in Vanilla 1.0 Help
would it be best to have a serialized php array or comma delimited list to store a list of vanilla usernumbers in a mysql database?

Comments

  • Options
    If you're doing it for the friends list thing, personally I'd be tempted to just use a 1:1 relational table.
  • Options
    hmm i was think ohh it being a list of "favorites" for each individual and not a mutal freindsship because then i wouldnt have to deal with freind "requests and acceptences"

    now that i have thought it could work that way and it would be easier the way you are saying
    but
    If 1000 person had 100 friends would it not be faster to have an array and 1000 entrys than 1:1 and 100,000 entry idk. would it be a noticeable difference because i would love to go the route that you speak of.
  • Options
    If 1000 person had 100 friends would it not be faster to have an array and 1000 entrys than 1:1 and 100,000 entry idk. would it be a noticeable difference because i would love to go the route that you speak of.

    That's where database indexing comes in ;)
  • Options
    wait, so which one wold be faster, or does that means it depends on the server?
  • Options
    I've really no idea Vincent. Simplicity has always been my method over efficiency because I generally dont write large-scale apps. I suppose arrays would take more processing and 1:1's would use more DB resources...hmmm
  • Options
    Its OK haha i have already decided to use your simple method rather than the efficient(or maybe not) route.
  • Options
    guys, to set this out straight, if you use the user id of both users in a 1 : 1 and then index both to their parent users, it's a whole lot quicker than arrays BUT ONLY IF THEY ARE INDEXED

    sorry for the caps but that is the key to this, if they aren't indexed it's not worth doing if you have a large scale application. If you have a properly indexed database, size doesn't matter because they are very fast when indexed. The only difference now is cpu speed and how many people are accessing the database at one instance.
  • Options
    y2kbgy2kbg New
    edited December 2006
    its 500 - 1000 considered is that "large scale" but not many people should be on at the same time, at least for now anyway running 12 gz bt its not just me on that server lol. How do you know if it is indexed and how well it is indexed? Do i have to index?
  • Options
    ...then index both to their parent users...
  • Options
    ohh i ,is typed i meant to ask if it was large scale. do i have to index them or is that done by the server or what?
  • Options
    you have to set up the indexing of the database when you make the database, then all you do is insert the id numbers in and the database does it for you
This discussion has been closed.