Archive for the ‘Database’ Category

Document Formats

Thursday, April 3rd, 2008

Documents

In FLOSS circles, March 26 is celebrated as the Document Freedom Day.

Document Freedom Day (DFD) is a global day for document liberation. It will be a day of grassroots effort to educate the public about the importance of Free Document Formats and Open Standards in general.

This is when I realized that people actually use the office packages daily. I almost never use it. According to me there are three options to store text data.

  • Plain Text
  • HTML
  • Database

Plain Text

The simplest format there is. If there is something I should remember, I just put it in a text file and save it to the desktop. I used to use it a lot earlier - but I don’t use it much nowadays due to searchability issues. There are quite a few advantages in using the text format

HTML

If I need any formatting in the text, I create the document in HTML. It is easier for me to create the formatting using HTML code that using WYSIWYG Word Processors(like MS Word). I write all my blog posts in HTML - perhaps the only occasion where I need formatting.

Database

My favorite method to store text data is in a database. I am a web developer - so I always have a Web Server and Database server running on my system - so this system is perfect for me.

Interface

Remove that scared look on your face - I don’t use phpMyAdmin or any Database Administration tools as the interface to save/view the data. I use my own custom scripts or WordPress.

The best example of this is txt. Txt is my code snippets/commands repository. You can view the full story in the Saving Code Snippets post.

That’s an online example - I also have a personal wordpress blog running in my local server. I use it to record events, purchases, store receipts etc.

Advantages

Tagging
Tagging is heaven-sent to make information more findable - any del.icio.us user should know that. I used to install Ultimate Tag Warrior to get this feature - but WordPress now supports tags natively.
Searching
Searching for data within a database is much more easier, faster and provides more relevent results than searching for the data in a collection of file. Even if you are using a file indexing software like Google Desktop Search or Beagle/Recoll(for linux users), I find database searching more easier. Another advantage of using database to search is that you can create complex queries if you know SQL.

Disadvantages

Not for everyone
Let’s face it - installing and maintaining a web/database server is a tad in the geek zone. An average Joe will find it just a little bit out of their league.
Overhead
Running a web server and a database server is a bit demanding on the RAM.
Backing up a little more complicated - but easier
Backing up the data in a Database is not as straight forward as backing up files - but its actually easier if you know how.

Online

One extra method to store the data - online. This data is stored in a database - but you don’t have the disadvantages associated with using a database. More and more people are turning to this method now. I did not include it in the initial list because its not a data format - its more of a data storing method.

3 Simple Steps to create a Web Installer

Friday, July 6th, 2007

Creating a web installer is not hard - as a matter of fact - it is downright easy. You just have to know a few things. Get the database details, create the database, save the details. That’s it!

Getting Database Details

Nexty Installer Screenshot

A simple four field form will suffice. The important thing to remember is that the data must be saved as session variables - as we are using a multi-page form.

As soon as you get the DB details, try to connect to the database and confirm that the DB details is correct. If the connection attempt fails, take the user back to the DB details form. Else go to step two.

Insert Initial Data

This part is easy - just run a bunch of SQL statements to create the necessary table structure and insert the initial data.

Save the Details

This should be the last step of the installation. Just take all the data from the session variables and write it to a file, say ‘configuration.php’. Write the data as PHP code - so all you have to do to retrieve the data is include the file.

The code for the installer in the next post.

Subscribe to Feed