-
Notifications
You must be signed in to change notification settings - Fork 3
Repository database overview
Patrick Titzler edited this page Sep 2, 2016
·
3 revisions
The service creates a small repository database named transform_
in the CouchDB instance identified by environment variable TARGET_COUCH_DB_URL
during startup.
Two views are defined in this database:
This view lists event processing documents, such as application starts:
{
"_id": "...",
"_rev": "...",
"task_id": "9565e09ad69a3c733c4bb2954e097940",
"record_type": "event",
"event_type": "start",
"data": {
"source": {
"url": "https://somebody@some-couchdb-host/",
"dbname": "source_database"
},
"target": {
"url": "https://somebody@some-couchdb-host/",
"dbname": "target_database"
},
"filter": {
"server": {
"name": "transform_service/exclude_deleted_docs",
"definition": "function(doc, req) { if(doc._deleted) { return false; } else { return true; }}"
},
"client": {
"name": "sample_filter_functions/ignore_design_documents.js",
"definition": "function (change) {\r\n\tif((! change) || (! change.doc) || (change.doc._id.startsWith('_design/'))) {\r\n\t\treturn false;\r\n\t}\r\n\telse {\r\n\t\treturn true;\r\n\t}\r\n}"
}
},
"transformer": {
"name": null,
"definition": null
}
},
"timestamp": "2016-09-02T21:37:36.487Z"
}
The task_id
is an MD5 hash, identifying the unique combination of source/target database.
This view returns one recovery document for each unique source-db/target-db combination. Recovery documents are updated every time a batch of transformed documents was successfully written to the target database.