Caching location based data?

Sumit Datta sumitdatta at gmail.com
Thu Aug 2 12:46:14 UTC 2007


Hello John,
Well your problem looks interesting. I too believe there is another
solution, but I do not have a ready made answer. Anyways, what you are
doing is one of of using cache. This process i believe is most used.
That is caching the SQL output using a hash on the SQL itself.
I have been using memcache in hispanito.com for about 3 months now
since we had some heavy user hits. But the way I have done it is not
the usual memcache-as-a-database cache way. I use memcached along with
PHP application logic to make a need-based database engine. It sounds
complex? Not really. Any database uses a key/pair value system at the
end. Same for MySQL. What we do is use MySQL as just an archive.
Application logic is written in PHP to maintain key/pair values so
that the site runs on memcache only, and just INSERTs and UPDATEs pass
onto MySQL. We do not do an SQL SELECT and then hash it and cache it.
We create needed keys and the bits of code to gel it all together.
This of course is good when you have a relatively small manageable
number of entities. Since each entity would need its own keys and
logic stuff. But as far as I understand your entities for this app is
much less than ours (a full social networking website).

Hope this helps. If you want to get more details, I can give you
examples, but I frankly did not understand the radius calculation
part. If you give me some explanation on how you deal with it, I might
be able to help you more.
--
Thanks
=Code is Poetry=
Sumit Datta
Web Developer


More information about the memcached mailing list