Details
-
Task
-
Resolution: Won't Fix
-
Major
-
Mobile 2.1
Description
First comment:
-
-
- Using Walrus
-
[Walrus](https://github.com/couchbaselabs/walrus), which is built into Sync Gateway, is a simple, limited, in-memory database that you can use in place of Couchbase Server for unit testing during development.
Use the following command to start a Sync Gateway that connects to a single Walrus database called `sync_gateway` and listens on the default ports:
```bash
sync_gateway -url walrus:
```
To use a different database name, use the `-bucket` option. For example:
```bash
sync_gateway -url walrus: -bucket mydb
```
By default, Walrus does not persist data to disk. However, you can make your database persistent by specifying an existing directory to which Sync Gateway can periodically save its state. It saves the data to a file named `/<directory>/sync_gateway.walrus`. For example, the following command instructs Sync Gateway to save the data in a file named `/data/sync_gateway.walrus`.
```bash
mkdir /data
sync_gateway -url walrus:/data
```
You can use a relative path when specifying the directory for persistent data storage.
```bash
mkdir data
sync_gateway -url walrus:data
```
You can also specify the directory for persistent data storage in a configuration file. The *config.json* file would look similar to the following JSON fragment:
```bash
{
"databases": {
"couchchat":
...
}
...
}
```
Our own engineering team utilizes Walrus in place of a Couchbase Server installation to conveniently and quickly gain feedback during unit testing. Based on our experience, it is best to start with Walrus when developing with the Couchbase Mobile stack for the first time, but there are caveats to this prototyping model. In particular, the number of clients that Walrus can comfortably support generally is no more than one or two clients. For those doing advanced prototyping with larger datasets or more clients, we recommend using a true Couchbase Server database.
see other comments: https://github.com/couchbaselabs/couchbase-mobile-portal/issues/587