Offline database in Ruby?

Now I’m not talking about those type of databases that keeps datas of a
given website. I’m talking about something similar to it but that can
work offline. Still confused? Here is what I’m talking about.

Let’s say we have a login screen

Source code : http://pastebin.com/iMvgxkMk

Can I do something like that?

The variable will empty itself and start over after the program is
closed so can I do something so the program can save and retrieve data
from a file anytime?

Let’s revise, all I’m asking for is
Program creates a new file.
Program can add/remove/retrieve data from the file.

Just like a database for a website.

Thanks.

I believe an SQLite DB would serve your purpose. Its file based at the
same
times one can use it as a Database.

http://www.sqlite.org/

On Sat, Feb 1, 2014 at 6:58 PM, cynic limbu [email protected]
wrote:

Now I’m not talking about those type of databases that keeps datas of a
given website. I’m talking about something similar to it but that can
work offline. Still confused? Here is what I’m talking about.

Basically any database can be used without a web application. At least
I wouldn’t be aware of any that could not.

Let’s revise, all I’m asking for is
Program creates a new file.
Program can add/remove/retrieve data from the file.

Without knowing more about your requirements in terms of types of
data, data volume, access patterns, # of concurrent users etc. it’s
hard to recommend something. You could use

  • ASCII files
  • Marhsalled data
  • PStore
  • JSON formatted file
  • key value store
  • relational database
    • of which SQLite is one variant

Just like a database for a website.

Please do not associate “database” with “website”. A database is just
that, a persistent (most are but there are also databases for
transient usage) storage for data.

Kind regards

robert

On 02/01/2014 11:53 AM, Robert K. wrote:

On Sat, Feb 1, 2014 at 6:58 PM, cynic limbu [email protected] wrote:

  • PStore
  • JSON formatted file
  • key value store
  • relational database
    • of which SQLite is one variant

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs