Database Notes

It is enough just to try to learn rails, but a typical person starting off with rails may well confront at least 3 learning curves: Rails itself, the Ruby language, and MySQL. MySQL it a byzantine world of ancient database technology (SQL is indeed ancient and byzantine). MySQL is quite robust and impressive, but has a stiff and weird learning curve. Ruby is great (but is certainly used in less than straightforward ways in the rails world).

There are now other good options for the database you use with rails. In fact, the default database, at least for development is SQLite. A big advantage of SQLite is that it is already installed on the typical linux system used to host rails and has negligible setup. And migrating to MySQL for a production system is no big deal.

Here is the recommended setup of a rails application with SQLite:

$ rails my_app
$ cd my_app
$ ./script/generate scaffold User login:string password:string
first_name:string last_name:string
$ rake db:migrate
$ ./script/server
The switch to MySQL is accomplished via:
rails my_app -d mysql

Feedback? Questions? Drop me a line!

Ruby on Rails notes / [email protected]