Board logo

subject: Data Definition - Database Design with MySQL [print this page]


Data Definition - Database Design with MySQL

In today's enterprise web environments, developers often work with existing databases to optimize application performance after building a site. Designing entirely new databases with a focus on scaling performance, however, can deliver better long-term results. Whether you are involved in creating new databases or are focused on reworking an existing application, database design has a large impact upon overall performance of your web application.

Understanding how variable choices impact database design

There are a variety of important considerations in developing a new database, including the data flow, schema, and variable types. For demonstration purposes, let's assume we are developing a collaboration platform where users interact in a work environment. In such scenario, there usually are several database schemas to work with, including user registration and activities, notifications posted based on progress updates, client categories to handle different work projects, and files uploaded to capture recent workflow.

At a base level, the user table for your schema should capture a structure common to many sites. The table will have a unique key id, an integer value that will increment with each subsequent user. The rest of the fields will include the user name (VARCHAR), password (encrypted VARCHAR), email address (VARCHAR), time of last login (TIMESTAMP), and the user's IP address (VARCHAR(20)) for security reasons.

The content of the work projects will include client pages that display the individual workroom posts. The categories will be keyed with an integer ID and should capture the client name with limited characters, a client overview (TEXT), and dates for project start and completion (TIMESTAMP). The client pages will capture individual working updates. The link between each update and the client account is established using a foreign key that maps the update ID to the ID of the client account. Each working update will include a title and an update date (TIMESTAMP). Optimizing your choice of variable formats will help limit memory usage and load times as your database scales. You can further optimize your database by utilizing sub-tables for different variable types as your application evolves.

Building database schemas designed to scale

Designing your application to scale properly will ensure that subsequent projects can become client areas within each category, while additional project notifications can become sub-posts. By utilizing common MySQL work tools, such as MySQL Workbench, you can create the tables and refer back to your mapping diagrams for testing purposes. Each subsequent database design change should be fully tested before being deployed to production servers.

Having a properly designed schema will ensure the users, clients, and updates fit effectively into a complete and optimized web application. An appropriate data model will ensure the controller and view can function effectively towards the overall user experience. Careful attention to database design requirements will not only improve site response times but will scale appropriately to a growing user base across the web, desktop, and mobile platforms.




welcome to loan (http://www.yloan.com/) Powered by Discuz! 5.5.0