# js-collaboration-ot

## Content

`js-collaboration-ot` is a collaboration library based on Operational Transformation (OT) technology, designed to enhance the real-time synchronization capabilities of `js-collaboration`. Through the OT technology, it enables multiple users to edit the same data simultaneously. It is divided into the client side ([js-collaboration-ot-client](/spreadjs/api/collaboration/js-collaboration-ot-client/README#spreadjs-api)) and the server side ([js-collaboration-ot](/spreadjs/api/collaboration/js-collaboration-ot/README#spreadjs-api)).

## Applicable Scenarios

Suitable for applications requiring real-time collaborative editing, including:

* ​​Collaborative spreadsheet editing
* Rich text co-authoring
* Interactive chart collaboration

## Core Features

* **Custom OT Types**: Supports developers in defining custom operation types to meet various business needs.
* **Data Persistence**: Provides adapter interfaces for integration with database storage.
* **Fragment Mechanism (Fragments)**: Improves synchronization performance for large documents.
* **Conflict Resolution**: Ensures data consistency through the OT algorithm.
* **Middleware and Hooks**: Supports inserting validation, logging, and other logic into the collaboration process.

## Design Advantages

* **Modularity**: OT types, middleware, and adapters are independently designed, making customization and extension easy.
* **Efficiency**: The Fragment mechanism reduces I/O overhead for large documents.
* **Flexibility**: Supports asynchronous middleware and diverse databases, adapting to complex business scenarios.

## Next Steps

Follow these step-by-step tutorials using `js-collaboration` and `js-collaboration-ot` to build a real-time collaborative text editor based on Operational Transformation (OT):

* [Tutorial: Real-Time Collaborative Text Editor](/spreadjs/docs/spreadjs-collaboration-server/collaboration-framework/js-collaboration-ot/tutorial-real-time-collaborative-text-editor)
* [Tutorial: Add History Functionality](/spreadjs/docs/spreadjs-collaboration-server/collaboration-framework/js-collaboration-ot/tutorial-real-time-collaborative-text-editor/tutorial-add-history-functionality)
* [Tutorial: Configure Database Adapter](/spreadjs/docs/spreadjs-collaboration-server/collaboration-framework/js-collaboration-ot/tutorial-real-time-collaborative-text-editor/tutorial-configure-database-adapter)

Master core concepts and APIs of `js-collaboration-ot`, covering:

* [Operation (Op)](/spreadjs/docs/spreadjs-collaboration-server/collaboration-framework/js-collaboration-ot/operation-op)
* [Conflicts and Transform](/spreadjs/docs/spreadjs-collaboration-server/collaboration-framework/js-collaboration-ot/conflicts-and-transform)
* [OT Types](/spreadjs/docs/spreadjs-collaboration-server/collaboration-framework/js-collaboration-ot/ottypes)
* [SharedDoc](/spreadjs/docs/spreadjs-collaboration-server/collaboration-framework/js-collaboration-ot/shareddoc-class)
* [DocumentServices](/spreadjs/docs/spreadjs-collaboration-server/collaboration-framework/js-collaboration-ot/constructing-and-using-documentservices)
* [Database Adapter](/spreadjs/docs/spreadjs-collaboration-server/collaboration-framework/js-collaboration-ot/database-adapter)
* [OT Middleware](/spreadjs/docs/spreadjs-collaboration-server/collaboration-framework/js-collaboration-ot/ot-middleware)
* [Fragment Mechanism](/spreadjs/docs/spreadjs-collaboration-server/collaboration-framework/js-collaboration-ot/fragment)

Each module will demonstrate practical usage via code examples. It is recommended to gradually practice by following the tutorial path in the left-hand navigation bar.