# New to Ruby: Databases?

**URL:** <https://www.ruby-forum.com/t/new-to-ruby-databases/91067>\
**Category:** Rails\
**Created:** [April 4, 2007, 9:22am UTC](https://www.ruby-forum.com/t/new-to-ruby-databases/91067 "2007-04-04T09:22:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonathan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/aeb1de/32.png) [@jonathan](https://www.ruby-forum.com/u/jonathan)\
**Post date:** [April 4, 2007, 9:22am UTC](https://www.ruby-forum.com/t/new-to-ruby-databases/91067/1 "2007-04-04T09:22:12Z")

</div>

I have no programming experience prior to learning Ruby, and I have  
learned from reading Chris P.'s Learn to Program and referencing to  
[http://www.ruby-doc.org/docs/ProgrammingRuby/](http://www.ruby-doc.org/docs/ProgrammingRuby/)

I am developing two websites [http://bluebottleimages.rubidot.com/](http://bluebottleimages.rubidot.com/) and  
[http://partysushi.com/](http://partysushi.com/) using eruby and rhtml templates.

I have a vague idea of what a database is.  
what is a database for? and what is the advantage over using basic IO to  
read/write .txt files or something? Do I have to learn Rails to use a  
database? and how can I learn to create/use them?

---

<div class="post-metadata">

**Author:** ![jonathan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/aeb1de/32.png) [@jonathan](https://www.ruby-forum.com/u/jonathan)\
**Post date:** [April 4, 2007, 8:47pm UTC](https://www.ruby-forum.com/t/new-to-ruby-databases/91067/2 "2007-04-04T20:47:47Z")

</div>

Jonathan D. wrote:

> I have no programming experience prior to learning Ruby, and I have  
> learned from reading Chris P.'s Learn to Program and referencing to  
> [Programming Ruby: The Pragmatic Programmer's Guide](http://www.ruby-doc.org/docs/ProgrammingRuby/)
> 
> I am developing two websites [http://bluebottleimages.rubidot.com/](http://bluebottleimages.rubidot.com/) and  
> [http://partysushi.com/](http://partysushi.com/) using eruby and rhtml templates.
> 
> I have a vague idea of what a database is.  
> what is a database for? and what is the advantage over using basic IO to  
> read/write .txt files or something? Do I have to learn Rails to use a  
> database? and how can I learn to create/use them?

Databases store and retrieve sets of records. Take a look at the menu  
page for your partysushi page. Each roll has a title, a picture and a  
description. In the language of databases the menu would be a table.  
Each roll would be a row. each row has 3 fields: picture, title, and  
description. With Rails you can easily do 4 different types of  
operations on these rows:

Create: (The cheif invents a new roll and wants it on the menu ASAP)  
Read: (No more messy IO.Readlines to deal with)  
Update: (Change the picture on the Spedo roll to include the Cheif in  
his swimsuit)  
Destroy: (Get rid of the Lemon Curry roll no one likes it)

Note: the acronym CRUD is used to refer to all these.

Rails will help you to make you site more dynamic and is IMHO easier to  
learn then the Rails IO classes.

Check out one of the Getting Started Guides.

John M.

---

<div class="post-metadata">

**Author:** ![jonathan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/aeb1de/32.png) [@jonathan](https://www.ruby-forum.com/u/jonathan)\
**Post date:** [April 12, 2007, 8:34am UTC](https://www.ruby-forum.com/t/new-to-ruby-databases/91067/3 "2007-04-12T08:34:50Z")

</div>

Sorry for the late reply. I just wanted to say thanks for the help and  
really good explaination 🙂

haha… CRUD  
there’s gotta be some secret society dedicated to making horrible  
acronyms for science and technology. 😉
