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.
Hi,
Well, that is a VERY general question, so you can only expect a very general
answer. :-)
A good answer would take into account your experience/level of
databasedesign.
So, what did you do before?
Do you think in entities and relationships?
Do you know what a foreign key is?
Do you know about normalisation of databases?
Do you know about indexing?
Big complex book are written on this subject.
Design is everything.
Good designed databases will stay fast where the poorly designed ones will
break down fast when the visitors come in in numbers.
Often a poorly designed database will function just great in
developmentenvironment.
A poorly designed database will get a pain in the @ss when you try to get
information out that you didn't think of beforehand (which always happen in
the real world.)
So make sure your design is right.
If your design is right you will be able to get the information out without
too much trouble, AND (even more important maybe) you will be able to
extend the database when you add new functionality without a complete
redesign.
Good design?
That means amongst others:
1) Identify your entities you want to store AND their relationship with
other entities.
2) Design normalized (do not store the same piece of infortion in different
places)
3) Enforce the relationship between your entities by means of foreign keys.
4) Add extra indexing afterwards (unless you are experienced enough to
recognize them beforehand), if you KNOW where the the system is spending
time on tablescanning. (Typpically in SELECTs)
Remember that indexes will SLOW down the insering (and updating) of
information, where they will speed up the querying (SELECT).
So you must make an estimate on what your system will be doing most of the
time: inserting new stuff or just selecting old material.
If you provide us with more information, maybe you can get a better
(to-the-point) answer.
Or maybe buy a good book on databasedesign.
Good luck.
Regards,
Erwin Moller