| What is a Database ? |
What is a Database ?A database is server software that acts as a container for information. Think of it as a box for files and instructions. Most modern web applications need a database, as the old website construction method that used simple web pages is now superseded. Instead, modern websites run from databases and there are no web pages on the server.Several databases are often needed, as each application will ideally need its own. For example an ecommerce application, a blog, and web analytics will all need their own database. It's possible to run more than one application from a single database, but not ideal. Most shared web hosting accounts now have an allocation of several databases (DBs), usually from three upwards. Smaller or cheaper accounts might allow only two. On a dedicated server you can have as many as you like, since there is no limit to the number that can be created on a server, apart from the disk space the data in them occupies. Databases are 'free', there is no cost involved in creating or running them, apart from these two factors:
How a database worksInstead of having HTML-code pages on the website, the text and publishing instructions are held in a giant file that has all the information needed. A DB is a type of text file that holds data in an organised format.This is how a web page is served from a DB: A browser accesses the website and asks the server for a certain page. The server program, such as Apache or Lighttpd, first looks to see if the page has been requested recently, and is therefore in its memory, aka cache. If it is, the page is served directly from memory. If not, it asks the main webapp (eg a CMS) to supply the page. The CMS first looks to see if the page is in its own cache. If not, it starts to put the page together. It asks the database for the page publishing instructions, and any text that is on the page. The DB replies with the page configurations and the page text. The CMS grabs the text, grabs any graphics from folders (directories) on the server, compiles the page according to the instructions, and sends the page to the server program. The server program forwards the page to the browser and the website visitor then sees the page on their PC screen. The entire process within the server normally takes less than 0.25 of a second, less than a quarter of a second. However if the server is heavily loaded it may take as much as a second. What are the popular database programs ?The most popular of all is MySQL, an open-source DB application that probably represents 90% of installed server DBs. MySQL is owned by Sun Computer (who also own Java), who provide both community versions and enterprise versions with support. The next most popular is PostgreSQL, another open-source program, and then Oracle, a commercial program.How do you manage a database ?Assuming that you have a normal web hosting account, this is how you create and use a database:
Now you have a new database, with a user that has access to the DB. You will allocate the username and pass to your CMS or ecommerce application. You can inspect the DB configurations by using phpMyAdmin, a DB management interface application. This is not required for the avarage user, or even webmasters most of the time. In cPanel, click the phpMyAdmin icon. At the main start page, click on the database name in the column at left. Select the operation you require to perform from among the tabs at right. The only operation that is normally needed here is to run a DB backup, so that you can download it and keep it as a backup in case the site or DB crashes or is exploited. These incidences are rare. You can download the DB backup as a text file or a zip file. It is worthwhile doing both, if you are going to bother doing a MySQL backup. How do I delete a database ?Go to your cPanel start page and click the Databases or MySQL icon. Select the database from the list there. Select Delete, or Drop Database - this means remove and delete. Hit the button and the DB has gone. You can now create a new DB, even with the same name.Ask us if your databases are managed optimally |
