From: Brian Candler Date: 2009-05-19T23:04:05+09:00 Subject: Re: Berkeley DB or Store equivalent? Mk 27 wrote: > I have never used mySQL because perl's Storable or BerkeleyDB modules > always did me fine for cgi stuff. I am going to be learning rails, so I > supposed I will have to learn mySQL anyway, but I was wondering: is it > exclusively web based, or could I use it to produce database files for > use in a (non web app) ruby script? I think you're talking about two independent things. (1) Data storage for a ruby application. There are a whole bunch of options for this, SQL and non-SQL, many of which have already been mentioned. Of the non-SQL alternatives, one of the simplest (written in Ruby) is Madeleine. One for coolness and speed is CouchDB (you talk to it via HTTP). (2) Rails is a web framework, that is, a toolkit for writing web applications. Quite often these have some sort of data store on the back, but this is not mandatory. A default Rails app will be configured to use ActiveRecord to talk to a sqlite3 SQL database, but you can point it to a different SQL database, or disable ActiveRecord entirely in config/environment.rb: config.frameworks -= [:active_record] and then use whatever non-SQL persistence mechanism you like. As for whether Rails is "exclusively web based" - no, some of the components which comprise Rails are useful by themselves - in particular ActiveRecord. So you can write a non-Rails, non-web application which still uses ActiveRecord to talk to a SQL database. There are several other SQL abstraction layers available, but the advantage of ActiveRecord is that it *is* a component of Rails, which means there are lots of excellent books you can buy to make your learning process easier. Hope this makes sense! -- Posted via http://www.ruby-forum.com/.