diff --git a/README.md b/README.md index a9847b911..69770ed33 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,11 @@ documents. It is the realtime backend for the [DerbyJS web application framework](http://derbyjs.com/). For questions, discussion and announcements, join the [ShareJS mailing -list](https://groups.google.com/forum/?fromgroups#!forum/sharejs). +list](https://groups.google.com/forum/?fromgroups#!forum/sharejs) or [check the FAQ](./docs/faq.md). Please report any bugs you find to the [issue tracker](https://github.com/share/sharedb/issues). - ## Features - Realtime synchronization of any JSON document @@ -322,272 +321,6 @@ after a sequence of diffs are handled. (Only fires on subscription queries) `query.extra` changed. - - - ## Error codes ShareDB returns errors as plain JavaScript objects with the format: diff --git a/docs/faq.md b/docs/faq.md new file mode 100644 index 000000000..a8e116f76 --- /dev/null +++ b/docs/faq.md @@ -0,0 +1,9 @@ +# FAQ + +## Is it possible to completely delete documents from the db? + +No, it is not possible to use the ShareDB API to fully delete data. In addition, the operation log is kept forever by default. + +Maintaining persistence of snapshots and ops means that ShareDB can correctly deal with all cases where ops have been removed. Permanently removing the snapshot document could result in a corrupt state in some edge cases by not maintaining the current document version, which must be incremented on each commit. As well, if you delete ops and then a client reconnects needing those ops, you will break that client and it will be unable to submit any pending changes or bring itself up to date from its current state. If your usecase calls for complete deletion of operations, you'll need to ensure that no clients will ever need them again or deal with the error appropriately. + +You can currently delete from your persistent datastore directly. For example, if you're using MongoDB you can delete the data by connecting to Mongo directly, not via the ShareDB API. If you do delete snapshot data, be sure that you delete not just the document snapshot but all operations associated with that document. Having operations with no corresponding snapshot would result in a corrupt state.