diff --git a/README.md b/README.md index 70a7065..110d0a5 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ All types support `merge`, `clone`, `deinit`, and JSON serialization/deserializa |---|---|---|---| | `POST /` | 201 | Create CRDT from JSON body | | `GET /` | 200/404 | Read CRDT as JSON | -| `PATCH /` | 202 | Merge client replica into existing CRDT | +| `PATCH /` | 200/202 | Merge client replica into existing CRDT (202 when congested) | | `DELETE /` | 204 | Remove CRDT (idempotent) | | `POST /register` | 201 | Get next server replica ID | | `GET /` (WebSocket upgrade) | 101 | Real-time sync via WebSocket | @@ -63,11 +63,27 @@ WASM module exporting functions for collaborative text editing via the RGA CRDT. ## Future Work -- **Tombstone garbage collection**: Removed nodes accumulate without bound in RGA and OR-Set -- **No persistence**: All state is in-memory only -- **No authentication/authorization**: All endpoints are open -- **No rate limiting**: No protection against overload -- **Client-server only**: No peer-to-peer architecture +- **Delta sync**: Every PATCH sends the full CRDT state. For large RGA + documents this wastes bandwidth. Transmitting only what changed would + be faster and cheaper. + +- **TLS and auth**: The API is open. TLS termination and authentication + should be handled externally before requests reach the server. + +- **Tombstone garbage collection**: Removed RGA and OR-Set entries + accumulate forever. A compaction pass would reclaim memory once all + replicas acknowledge a deletion. + +- **Persistence**: All state is in-memory. A client application using the + library can add its own persistence layer (write-ahead log, snapshot, + database). + +- **Blocking notification channel**: WebSocket subscriber channels are + bounded queues (32 slots). When full, `queue.putOne` blocks the entire + actor thread, stalling all CRDT operations. Should use a drop-policy + or separate notification queue instead. + +- **Client-server only**: No peer-to-peer architecture. ## External Dependencies @@ -108,7 +124,7 @@ The server listens on `[::]:8080` with IPv4 `0.0.0.0:8080` fallback. # Create a counter curl -X POST http://localhost:8080/my-counter \ -H "Content-Type: application/json" \ - -d '{"type":"counter","counter":{"counters":[[0,1]]}}' + -d '{"counter":[[0,1]]}' # Read it back curl http://localhost:8080/my-counter @@ -119,7 +135,7 @@ curl -X POST http://localhost:8080/register # Merge a replica curl -X PATCH http://localhost:8080/my-counter \ -H "Content-Type: application/json" \ - -d '{"type":"counter","counter":{"counters":[[1,2]]}}' + -d '{"counter":[[1,2]]}' # Delete curl -X DELETE http://localhost:8080/my-counter