# Best Database for a Nuby?

**URL:** <https://www.ruby-forum.com/t/best-database-for-a-nuby/146134>\
**Category:** Rails\
**Created:** [August 18, 2008, 11:34am UTC](https://www.ruby-forum.com/t/best-database-for-a-nuby/146134 "2008-08-18T11:34:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kylemathews](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/51bf81/32.png) [@kylemathews](https://www.ruby-forum.com/u/kylemathews)\
**Post date:** [August 18, 2008, 11:34am UTC](https://www.ruby-forum.com/t/best-database-for-a-nuby/146134/1 "2008-08-18T11:34:02Z")

</div>

I have no prior experience with a database, and am trying to figure out  
which one to go with.

I was going to go with MySQL (rather than Postgres, which seems to be  
considered superior) because it had more documentation and my app is  
very basic, but I read that it only allows for 1 index per table, which  
worried me – although I don’t know if it’s actually something to be  
worried about.

So all in all, are Postgre’s advantages worth it even if my knowledge is  
very limited and my app very basic? Thank you for any help.

---

<div class="post-metadata">

**Author:** ![kylemathews](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/51bf81/32.png) [@kylemathews](https://www.ruby-forum.com/u/kylemathews)\
**Post date:** [August 18, 2008, 11:48am UTC](https://www.ruby-forum.com/t/best-database-for-a-nuby/146134/2 "2008-08-18T11:48:53Z")

</div>

On 18 Aug 2008, at 10:34, Kyle M. wrote:

> worried about.  
> That’s absolute bollocks. what you might have read and misinterpreted  
> is than when a given query is executed, no more than one index will be  
> used per table.

For example if you had an address book app and you had one index on  
say state and one index on occupation and you execute a query against  
that table then mysql will use either the index on state or the index  
on occupation (or neither if neither one helps) but never both indexes  
(although you can create an index on both columns)

> So all in all, are Postgre’s advantages worth it even if my  
> knowledge is  
> very limited and my app very basic? Thank you for any help.

Use what you’re most comfortable with.

Fred

---

<div class="post-metadata">

**Author:** ![kylemathews](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/51bf81/32.png) [@kylemathews](https://www.ruby-forum.com/u/kylemathews)\
**Post date:** [August 18, 2008, 1:03pm UTC](https://www.ruby-forum.com/t/best-database-for-a-nuby/146134/3 "2008-08-18T13:03:34Z")

</div>

On Mon, Aug 18, 2008 at 7:34 PM, Kyle M.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have no prior experience with a database, and am trying to figure out  
> which one to go with.

Use the default in Rails 2.1 which is SqlLite.

SQL Lite is a good database that works out of one file in your apps  
home directory. The advantage is you don’t have to set up a server or  
permissions or anything like that. It just works.

This will give you the least headaches.

Mikel

–

> **[Mikel Lindsaar](https://lindsaar.net/)**
>
> Internet Home for Mikel Lindsaar

Rails, RSpec and Life blog…

---

<div class="post-metadata">

**Author:** ![kylemathews](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/51bf81/32.png) [@kylemathews](https://www.ruby-forum.com/u/kylemathews)\
**Post date:** [August 18, 2008, 2:57pm UTC](https://www.ruby-forum.com/t/best-database-for-a-nuby/146134/4 "2008-08-18T14:57:30Z")

</div>

Frederick C. wrote:

> On 18 Aug 2008, at 10:34, Kyle M. wrote:
> 
> > worried about.  
> > That’s absolute bollocks. what you might have read and misinterpreted  
> > is than when a given query is executed, no more than one index will be  
> > used per table.
> 
> For example if you had an address book app and you had one index on  
> say state and one index on occupation and you execute a query against  
> that table then mysql will use either the index on state or the index  
> on occupation (or neither if neither one helps) but never both indexes  
> (although you can create an index on both columns)

Got it. Thank you.

---

<div class="post-metadata">

**Author:** ![kylemathews](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/51bf81/32.png) [@kylemathews](https://www.ruby-forum.com/u/kylemathews)\
**Post date:** [August 18, 2008, 2:55pm UTC](https://www.ruby-forum.com/t/best-database-for-a-nuby/146134/5 "2008-08-18T14:55:13Z")

</div>

Mikel L. wrote:

> On Mon, Aug 18, 2008 at 7:34 PM, Kyle M.  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > I have no prior experience with a database, and am trying to figure out  
> > which one to go with.
> 
> Use the default in Rails 2.1 which is SqlLite.
> 
> SQL Lite is a good database that works out of one file in your apps  
> home directory. The advantage is you don’t have to set up a server or  
> permissions or anything like that. It just works.
> 
> This will give you the least headaches.
> 
> Mikel
> 
> –  
> [http://lindsaar.net/](http://lindsaar.net/)  
> Rails, RSpec and Life blog…

I should have clarified – this is for production. I’ve been using  
SQLite for development. I’ve heard MySQL or Postgres are better for  
production, which brought me here.

---

<div class="post-metadata">

**Author:** ![kylemathews](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/51bf81/32.png) [@kylemathews](https://www.ruby-forum.com/u/kylemathews)\
**Post date:** [August 18, 2008, 3:57pm UTC](https://www.ruby-forum.com/t/best-database-for-a-nuby/146134/6 "2008-08-18T15:57:14Z")

</div>

Kyle,

On Aug 18, 5:34 am, Kyle M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> very limited and my app very basic? Thank you for any help.  
> Nope. We use MySQL for most of our Rails apps, mainly due to it’s  
> popularity. It’ll take a while before you get to the point where the  
> underlying database is actually your bottleneck, and even then there  
> are tradeoffs with any database system.

MySQL will be fine. If you app is really simple and doesn’t get a ton  
of traffic, I’d even recommend using SQLite. I use it a lot for  
development and even in production on some small apps.

Hope that helps,  
Brandon

* * *

Hands-on Training In a Vacation Setting  
Sessions By Collective Idea: [http://sessions.collectiveidea.com](http://sessions.collectiveidea.com)
