SQLite Forum

shared in memory db: :memory:+shared cache OR memdb VFS?
Login
Hello! I want to have in-memory db shared between multiple db connections.

There was one way before release 3.36.0 that is described in the [in-memory db docs](https://www.sqlite.org/inmemorydb.html).  That is shared cache:

> file::memory:?cache=shared

or as i understand the same

> file:memdbname?mode=memory&cache=shared


sqlite 3.36.0 release notes says:

>  The "memdb" VFS now allows the same in-memory database to be shared among multiple database connections in the same process as long as the database name begins with "/". 

So now I can use

> file:/memdbname?vfs=memdb

This way currently __is not described in the docs__ (even nothing is found on request "memdb").


Which should I use?
Can someone describe advantages and disadvantages of each variant?