Hello All,
I was wondering how exactly is the best method for creating
databases in Ruby. I mean databases in a sense of small or large
quantities of information stored.
With Thanks,
Hello All,
I was wondering how exactly is the best method for creating
databases in Ruby. I mean databases in a sense of small or large
quantities of information stored.
With Thanks,
Unless you had a really good reason to do it, this is a fairly solved
problem.
One totally engineered solution is using ActiveRecord by itself with
sqlite3
as a DB on the back. This then gives you a nice portable and bundleable
database inside any rails application.
_why had a good post about using sqlite in ruby…
Anyway, 2c
Mikel
-------- Original-Nachricht --------
Datum: Thu, 29 Nov 2007 11:48:26 +0900
Von: “Will M.” [email protected]
An: [email protected]
Betreff: Creating Databases in Ruby
[email protected]
Dear Will,
what “best” means is maybe a matter of taste or related
to some particular feature one needs …
There are many relational database management systems
… and Ruby has bindings to many of them:
http://raa.ruby-lang.org/search.rhtml?search=database
Just choose one you like
Best regards,
Axel
One or two things to remember: if you aren’t dealing with a huge
amount of data, and really just want to store it when you’re done (or
periodically), and re-load it when you come back, Marshalling your
data to a file may be a better solution.
If you have data you want transactional file backed, but doesn’t map
perfectly to relational models, you may want to try Pstore.
Relational Databases (SQL) are not the panacea of data storage,
remember your other options!
–Kyle
2007/11/29, Will M. [email protected]:
Hello All,
I was wondering how exactly is the best method for creating
databases in Ruby. I mean databases in a sense of small or large
quantities of information stored.
As the other answers demonstrate this cannot be answered at such a
high level. What kind of data do you want to store? How much of it?
What do you do with the data - is it mostly read only or modified a
lot? With answers to questions like these you will receive much
better targeted replies.
Kind regards
robert
On Nov 29, 2007 3:48 AM, Will M. [email protected] wrote:
I was wondering how exactly is the best method for creating
databases in Ruby. I mean databases in a sense of small or large
quantities of information stored.
I’ve always liked KirbyBase[1]. From its Rubyforge project page:
KirbyBase is a small, plain-text, DBMS written in Ruby. It can be
used either embedded or client/server.
It aims to be as “Ruby-ish” as possible. For example, queries are
specified using Ruby code blocks,
rather than SQL strings.
On 11/30/07, Dimitri A. [email protected] wrote:
It aims to be as "Ruby-ish" as possible. For example, queries are
specified using Ruby code blocks,
rather than SQL strings.
If you like KirbyBase’s interface, you may like Sequel too
http://code.google.com/p/ruby-sequel/
which gives you a Ruby-ish interface, but for your RDBMS of choice.
Robert,
I simply would like to store regular ruby files. An example of this
would be below:
def w
puts “Test”
end
Except I would like to include multiple ruby files. Furthermore having
the ability to bring up the files, such as possibly typing “File.”
Kyle S. wrote:
If you have data you want transactional file backed, but doesn’t map
perfectly to relational models, you may want to try Pstore.
Sorry to be a pedant, but Atomic != Transactional.
Transactions require the ability to maintain all 4 ACID semantics
even if you pull the power plug in the middle, and even if someone
else is updating an overlapping set of objects. MyISAM is not
transactional, for example.
Relational Databases (SQL) are not the panacea of data storage,
remember your other options!
A proper relational database will give you transactions, and PStore
won’t.
If that matters to you :-).
Clifford H…
Please do not top post.
On 01.12.2007 03:08, Will M. wrote:
the ability to bring up the files, such as possibly typing “File.”
What does “bring up” mean? What’s wrong with using a file system for
this? I don’t get your use case…
Kind regards
robert
On Dec 1, 4:59 pm, Will M. [email protected] wrote:
First of all, what do you mean by “top post”? Do you mean reply on an
email such as this?
Yes.
And what I mean by “bring up” is simply like the method defined below.
If I would have typed the code I used below, I would be able to see
the text “Test” if I typed “w.”With Thanks,
Will
What Robert is asking is why you don’t just use ruby’s built-in
feature for including files and store your many ruby files on the file
system. For example, with a directory like this…
foo
|
- main.rb |
- bar.rb
|
`- baz.rb
…now from main.rb you can just say ‘require “bar”’ and everything in
bar.rb gets included in main.rb.
What is it about this that is not sufficient, that a database would
solve?
Regards,
Jordan
First of all, what do you mean by “top post”? Do you mean reply on an
email such as this?
And what I mean by “bring up” is simply like the method defined below.
If I would have typed the code I used below, I would be able to see
the text “Test” if I typed “w.”
With Thanks,
Will
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs