Summary

There are a number of techniques to make your database applications more portable and easier to maintain, especially regarding database queries. Separate your connection details from the scripts that make the connections, and make sure they are stored in only one place so that you can easily change the details. Make sure future changes in the database table structure do not affect your scripts if the change is unrelated. Specify field names in your SELECT and INSERT queries.

Certain environments (particularly web applications) may benefit from persistent connections. Use these to reduce the connection overhead when using frequent connections from the same place.

MySQL is usually more efficient at performing a task than a programming language. MySQL is optimized for speed, and makes use of indexes, caches, and memory to access information quickly. For example, using an application language instead of MySQL to sort data, though possible, is not efficient. In general, use MySQL whenever possible.

When developing applications, careful planning is important. Gather and formalize all the requirements from the users before determining the technology requirements, designing a model, and coding the application.

When coding, be sure to avoid the common pitfalls so that your code is flexible, portable, and easily maintainable. Then, before you implement the application, be prepared to test it extensively, which should be just as important as coding the application.



Mastering MySQL 4
Mastering MySQL 4
ISBN: 0782141625
EAN: 2147483647
Year: 2003
Pages: 230
Authors: Ian Gilfillan

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net