Title: RE: PHP+MySQL versus Lisp: Shortest Path problemi ile ilgili

-----Original Message-----
From: Can Burak Cilingir [mailto:[EMAIL PROTECTED]]
Sent: Sat 12/17/2005 11:15 AM
To: Emre Sevinc
Cc: cs-lisp@cs.bilgi.edu.tr; cs-discuss
Subject: Re: PHP+MySQL versus Lisp: Shortest Path problemi ile ilgili

Emre Sevinc wrote:
>> -----Original Message-----
>> If you be more clear about what kind of a caching scheme you intended
>> then I can understand better. Maybe I misunderstood the deal.
>
>oh, I missed the point of generating paths to every visiting member and
>underestimated the scenario.
>
>let me rethink the caching scheme (for real-time calculation). once you
>generate the path from a to b, you don't need to regenerate it unless
>any member's connection list is updated. so:


Let me restate the consequences:

You came to the lovely, business oriented social network. You
love those paths, you want to see them everywhere.

You are not connected to me. I'm not connected to you.

You click on me. (Never was I happier for using English
instead of my native language Turkish.)

We have a common acquaintance, thus the shortest path between us
exists.

You had to calculate this.

When?

When asked.

OK, you now have this data, you've already put it in some
SQL table.

What advantage does this have? If you (or I) click on me (or you)
then fetch the result quickly from the SQL table.

But as you have seen in the above scenario, lots, lots of
things are not cached.

I'm not saying that caching is useless. It isn't.

I'm saying that new members are coming and also today I'm
clicking on people that I haven't ever clicked before. Hundreds
or thousands of people doing the same thing. Which cache? Your
server is crunching under the load of calculation.

What you say is: Once your server is crunched and cached
the results of those queries, ok, it won't crash if the
same queries are made. But of course, each time brand new
queries with different Contacts are generated.

Could I make myself clear this time?

>function shortest-path (membera memberb)
>{
>if ispathcached (membera memberb)

Probably not.

>     p = getcachedpath (membera memberb)
>     t = getcachedtime (membera memberb)

>//is cache still valid?
>for each member of p as m
>     mt = getmodificationtimeofconnlist(m)
>     if (mt > t)
>     {
>         np = regeneratecache(membera memberb)
>         return np
>     }

And you imagine connections are rock hard?
Maybe our good old acquaintance has just left the
network. I'm making the same query, you and me
but the network data has changed. So you have
to modify your cache. That means recalculating.
What an acquaintance! Anyway, again you had to
calculate. Lots of calculations, people are
clicking, think of 10.000 people network, a few
thousand online, every minute a few 10 people
are coming, partially connected and making queries
which are not cached yet.

Maybe we need a trade-off here.

Emre S.

_______________________________________________
cs-lisp mailing list
cs-lisp@cs.bilgi.edu.tr
http://church.cs.bilgi.edu.tr/lcg
http://cs.bilgi.edu.tr/mailman/listinfo/cs-lisp

Cevap