Running in memory only

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Running in memory only

benjamin.filippi
Hi,

I would like to know if it is possible to have an instance of sqlite
running in RAM only? My aim is to build a small but fast memory SQL
storage.

Thanks.

Benjamin Filippi
Capital Fund Management
6 boulevard Haussmann 75009 Paris
Tel: +33 1 49 49 59 30
Fax: +33 1 47 70 17 40
[hidden email]
http://www.cfm.fr
Reply | Threaded
Open this post in threaded view
|

Re: Running in memory only

David Pitcher
Salut Benjamin,

Simplest way to make that happen is to use a ram disk, google for 'RamDisk'
and the platform you are using. Then you can use the existing sqlite
binary/library but all I/O occurs in memory.

When you want to persist, you just copy it to a hard disk...

D.

Reply | Threaded
Open this post in threaded view
|

Re: Running in memory only

Ben Clewett
Benjamin,

This works well on Linux using file system /dev/shm.  This should be
installed as default and works indistinguishably from normal file
system.  SQLite writes about 200 times faster than normal file system.

Remember that like all ram disks, this is wiped without warning on
shut-down.  So consider it only for duplicate data.  I also find having
an 'rc' script to re-create tables on startup is a great help.

David Pitcher wrote:

> Salut Benjamin,
>
> Simplest way to make that happen is to use a ram disk, google for
> 'RamDisk' and the platform you are using. Then you can use the existing
> sqlite binary/library but all I/O occurs in memory.
>
> When you want to persist, you just copy it to a hard disk...
>
> D.
>

Reply | Threaded
Open this post in threaded view
|

Re: Running in memory only

benjamin.filippi
Thanks guys I will investigate those features.

Benjamin Filippi
Capital Fund Management
6 boulevard Haussmann 75009 Paris
Tel: +33 1 49 49 59 30
Fax: +33 1 47 70 17 40
[hidden email]
http://www.cfm.fr




Ben Clewett <[hidden email]>
08/31/2005 10:41 AM
Please respond to sqlite-users
 
        To:     [hidden email]
        cc:
        Subject:        Re: [sqlite] Running in memory only


Benjamin,

This works well on Linux using file system /dev/shm.  This should be
installed as default and works indistinguishably from normal file
system.  SQLite writes about 200 times faster than normal file system.

Remember that like all ram disks, this is wiped without warning on
shut-down.  So consider it only for duplicate data.  I also find having
an 'rc' script to re-create tables on startup is a great help.

David Pitcher wrote:

> Salut Benjamin,
>
> Simplest way to make that happen is to use a ram disk, google for
> 'RamDisk' and the platform you are using. Then you can use the existing
> sqlite binary/library but all I/O occurs in memory.
>
> When you want to persist, you just copy it to a hard disk...
>
> D.
>


Reply | Threaded
Open this post in threaded view
|

Re: Running in memory only

Joel Lucsy
In reply to this post by benjamin.filippi
On 8/31/05, [hidden email] <[hidden email]> wrote:
> I would like to know if it is possible to have an instance of sqlite
> running in RAM only? My aim is to build a small but fast memory SQL
> storage.

How about using the database called ":memory:". Unless this has been
removed when I wasn't looking, this would probably be the "easiest"
way.

--
Joel Lucsy
"The dinosaurs became extinct because they didn't have a space
program." -- Larry Niven