Skip to content

Commit 20a60a8

Browse files
committed
chore: update readme
1 parent ecd15e9 commit 20a60a8

File tree

1 file changed

+37
-15
lines changed

1 file changed

+37
-15
lines changed

README.md

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,46 @@
11
> This is a fork of [y-redis@be833ff](https://github.com/yjs/y-redis/tree/be833ff1ccea630fbc45097cc3d122cc8a690733) with [y-socket.io](https://github.com/ivan-topp/y-socket.io) connection layer
22
3+
## Installation
4+
5+
```sh
6+
npm install @hackmd/y-socketio-redis
7+
```
8+
9+
## Usage
10+
11+
Server side:
12+
13+
```js
14+
import { createYSocketIOServer, createWorker } from '@hackmd/y-socketio-redis'
15+
```
16+
17+
Client side:
18+
19+
```js
20+
import { SocketIOProvider } from '@hackmd/y-socketio-redis/client'
21+
```
22+
323
---
424

5-
# y-redis :tophat:
25+
# y-redis :tophat:
26+
627
> y-websocket compatible backend using Redis for scalability. **This is beta
728
> software!**
829
930
y-redis is an alternative backend for y-websocket. It only requires a redis
10-
instance and a storage provider (S3 or Postgres-compatible).
11-
12-
* **Memory efficient:** The server doesn't maintain a Y.Doc in-memory. It
13-
streams updates through redis. The Yjs document is only loaded to memory for the
14-
initial sync.
15-
* **Scalable:** You can start as many y-redis instances as you want to handle
16-
a fluctuating number of clients. No coordination is needed.
17-
- **Auth:** y-redis works together with your existing infrastructure to
18-
authenticate clients and check whether a client has read-only / read-write
19-
access to a document.
20-
- **Database agnostic:** You can persist documents in S3-compatible backends, in
21-
Postgres, or implement your own storage provider.
31+
instance and a storage provider (S3 or Postgres-compatible).
32+
33+
- **Memory efficient:** The server doesn't maintain a Y.Doc in-memory. It
34+
streams updates through redis. The Yjs document is only loaded to memory for the
35+
initial sync.
36+
- **Scalable:** You can start as many y-redis instances as you want to handle
37+
a fluctuating number of clients. No coordination is needed.
38+
39+
* **Auth:** y-redis works together with your existing infrastructure to
40+
authenticate clients and check whether a client has read-only / read-write
41+
access to a document.
42+
* **Database agnostic:** You can persist documents in S3-compatible backends, in
43+
Postgres, or implement your own storage provider.
2244

2345
### Components
2446

@@ -40,7 +62,7 @@ stored redis and in the persistent storage (e.g. S3 or Postgres) for the initial
4062
sync. After the initial sync, the server doesn't keep any Yjs state in-memory.
4163
You can start as many server components as you need. It makes sense to put the
4264
server component behind a loadbalancer, which can potentially auto-scale the
43-
server component based on CPU or network usage.
65+
server component based on CPU or network usage.
4466

4567
The separate y-redis **worker component** (`/bin/worker.js`) is responsible for
4668
extracting data from the redis cache to a persistent database like S3 or
@@ -153,7 +175,7 @@ docker run -p 6379:6379 redis
153175

154176
Setup an S3-compatible store at your favorite cloud provider.
155177

156-
Alternatively, simply run a *minio* store as a docker container:
178+
Alternatively, simply run a _minio_ store as a docker container:
157179

158180
```sh
159181
docker run -p 9000:9000 -p 9001:9001 quay.io/minio/minio server /data --console-address \":9001\"

0 commit comments

Comments
 (0)