Re: How can I achieve efficiency and speed for high traffic dating web site



"PD"
I am currently making a dating website.

I want to have some information on how to structure the database and
the php files so that I can achieve speed and efficiency.

Can some one please give me suggestions and point me to references
where I can get this information.

Well, I think I can give you some sound advice here since
we have implemented a couple of those in PHP/MySQL. Of the advice
I saw so far, definitely get the book on optimization. Just some
quickies:

1. When you layout your tables go for FIXED field sizes,
not varchars, for all the basic user info. You may waste a little
space, but you make MySQL's indexing job MUCH easier!

2. If you have stuff like essays, message contents, that
have to be large text -- put those in tables by themselves and index
in.

3. The Query cache is your friend, but to make good use of
it you've got to limit writes to the table. Think of keeping stuff
like 'last active time' in another table.

4. Just about FORGET treating each person as some type
of OBJECT so that everytime you want to put up info on a person
you have to do an individual query. If you are showing search results
on 50 people, go get all the information at once that you will need
on each of them.

5. Sessions data is your friend. Keep as much as you can
there of the stuff you will need on every page, call it a cache.
If you design it in, not too hard to have the cache updated when
you write to the real database.

6. Somethings like enforcing number of saved message
limites, etc... can be a real pain to verify on EVERY query.
Setup a cron job to run even once a day to run off-hours to
check and remove extra stuff (they can 'temporarily' be over
a limit).

Hope this helps!

--
John
___________________________________________________________________
John Murtari Software Workshop Inc.
jmurtari@following domain 315.635-1968(x-211) "TheBook.Com" (TM)
http://thebook.com/
.



Relevant Pages

  • Re: [Info-Ingres] Insert performance (was "Sun buys MySQL")
    ... In Java I used to trap front-end queries en-route to the database ... As well as the query text, ... cache a limited number of queries and would cull the least recently used ...
    (comp.databases.ingres)
  • Re: application scope store
    ... It's called the operating system file system cache and it does a far better job than anything you could ever do. ... I mean something as simple as $_SESSION (not a database to query). ...
    (comp.lang.php)
  • Re: Business Entity Hierarchy OO question
    ... create a query that will pull the exact data you need. ... The more you cache, the less you have to go to the database (over ... loads most of the tables upon first reference (because they're small, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: question about displaying the results of a search
    ... Francisco wrote: ... It depends on how complex the query is. ... That still has a problem if the query is _complex_ because the database ... use the cache. ...
    (comp.lang.php)
  • lame server messages in named.log
    ... Mar 30 05:42:30.526 security: info: client 202.52.250.176#1052: ... query (cache) denied ...
    (RedHat)