freenight
freenight

Reputation: 1089

database knowledge in ruby on rails

I have learned the language itself as well as html/css/javascript. But with no database knowledge and (a bit)network knowledge. When I read the Pragmatic book on ROR, I found it confusing at the very beginning where they creates a project and setting up databases and models. Should I learn some database(and network knowledge)knowledge first in order to fully understanding the code and to fully grasp rails? If so, points out some book suited for these subject. Thanks in advance. sorry for my bad english..

Upvotes: 1

Views: 290

Answers (5)

Aurélien Bottazini
Aurélien Bottazini

Reputation: 3309

What is really important is to understand the concept of MVC (model view controller)

I recommend you reading this getting started guide

RailsGuides in general are really helpful and more condensed than the book. You might prefer it

Rails Guides
(source: rubyonrails.org)

Upvotes: 1

Jim McKerchar
Jim McKerchar

Reputation: 156

I'd agree that a basic (at least) understanding of SQL is essential when doing any sort of database work. I found the "Sams Teach Yourself SQL in 24 Hours" book helpful when i first started dipping into database work. It covers pretty much everything you need to get you started.

My advice would be to pick a DB (MySQL, Sqlite, MsSQL etc.), learn some of the basics for that particular DB (i found it useful to know how to create new users and set permissions), learn some generic SQL and really get to know what ActiveRecord can and can't do.

Hope this helps a little.

Upvotes: 1

Telemachus
Telemachus

Reputation: 19705

You almost certainly will need some general understanding of SQL to work with RoR (and as others have said, probably for programming itself).

I'm a fan of the book Simple SQL. It covers SQL generically, as much as it can. That is, it goes over the basics of SQL itself rather than the details of one or the other SQL implementation. Also, the majority of the examples are web related which should fit you well.

Upvotes: 2

JRL
JRL

Reputation: 77995

Unless you're doing network specific stuff, all you need to know concerning networking is a basic understanding of how the HTTP protocol works.

Models have nothing to do with databases per se, they're just regular classes in your language, that happen to map to a database table in Object Relational Mapping (ORM) type frameworks such as Rails. You can view them as the gateway to your database.

The database you'll be using is most likely a relational database. You don't need to know much about the theory, but you can get a very basic overview on wikipedia.

Probably the thing you'd need the most is a basic understanding of SQL, although the point of an ORM is to abstract that SQL away. You'll see glimpse of it when you look at the log file where you see the actual database queries. And when you get to more complicated, specific stuff, you might need some SQL.

In any case, you'll need general knowledge about databases and SQL in pretty much any type of development.

Upvotes: 7

Ben Crouse
Ben Crouse

Reputation: 8348

The short answer is YES. Even though ActiveRecord abstracts away much of the dirty work with the database, it is still important to understand what is going on. It will be useful, sometimes vital, when debugging, deploying, and/or maintaining.

Upvotes: 7

Related Questions