You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ej2-react-toc.html
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -859,6 +859,7 @@
859
859
<li><ahref="/ej2-react/document-editor/server-deployment/word-processor-server-docker-image-overview">Word Processor Server Docker Image Overview</a></li>
860
860
<li><ahref="/ej2-react/document-editor/server-deployment/how-to-deploy-word-processor-server-docker-container-in-azure-app-service">How to Deploy Word Processor Server Docker Container in Azure App Service</a></li>
861
861
<li><ahref="/ej2-react/document-editor/server-deployment/how-to-deploy-word-processor-server-docker-container-in-azure-kubernetes-service">How to Deploy Word Processor Server Docker Container in Azure Kubernetes Service</a></li>
862
+
<li><ahref="/ej2-react/document-editor/server-deployment/how-to-deploy-word-processor-server-docker-container-in-amazon-kubernetes-service">How to Deploy Word Processor Server Docker Container in Amazon Kubernetes Service</a></li>
862
863
<li><ahref="/ej2-react/document-editor/server-deployment/how-to-publish-documenteditor-web-api-application-in-azure-app-service-from-visual-studio">How to Publish DocumentEditor Web API Application in Azure App Service from Visual Studio</a></li>
Copy file name to clipboardExpand all lines: ej2-react/document-editor/collaborative-editing-java.md
+74-8Lines changed: 74 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Allows multiple users to work on the same document simultaneously. This can be d
16
16
17
17
The following are needed to enable collaborative editing in Document Editor.
18
18
19
-
-Socket JS
19
+
-Sock JS
20
20
- PostgreSQL database
21
21
22
22
## How to enable collaborative editing in client side
@@ -57,9 +57,9 @@ render() {
57
57
}
58
58
```
59
59
60
-
### Step 2: Configure SocketJS to send and receive changes
60
+
### Step 2: Configure SockJS to send and receive changes
61
61
62
-
To broadcast the changes made and receive changes from remote users, configure SocketJS like below.
62
+
To broadcast the changes made and receive changes from remote users, configure SockJS like below.
63
63
64
64
```typescript
65
65
import*asSockJSfrom'sockjs-client';
@@ -98,7 +98,7 @@ public onDataRecived(data: any) {
98
98
99
99
### Step 3: Subscribe to specific topic while opening the document
100
100
101
-
When opening a document, we need to generate a unique ID for each document. These unique IDs are then used to create rooms using SocketJS, which facilitates sending and receiving data from the server.
101
+
When opening a document, we need to generate a unique ID for each document. These unique IDs are then used to create rooms using SockJS, which facilitates sending and receiving data from the server.
### Step 1: Configure SocketJS hub to create room for collaborative editing session.
145
+
### Step 1: Configure SockJS hub to create room for collaborative editing session.
146
146
147
-
To manage groups for each document, create a folder named “Hub” and add a file named ```DocumentEditorHub.java``` inside it. Add the following code to the file to manage SocketJS groups using room names.
147
+
To manage groups for each document, create a folder named “Hub” and add a file named ```DocumentEditorHub.java``` inside it. Add the following code to the file to manage SockJS groups using room names.
148
148
149
149
Join the group by using unique id of the document by using JoinGroup method.
#### Add Web API to get previous operation as a backup to get lost operations
270
-
On the client side, messages send from server using SocketJS may be received in a different order, or some operations may be missed due to network issues. In these cases, we need a backup method to retrieve missing records from the database.
270
+
On the client side, messages send from server using SockJS may be received in a different order, or some operations may be missed due to network issues. In these cases, we need a backup method to retrieve missing records from the database.
271
271
Using the following method, we can retrieve all operations after the last successful client-synced version and return all missing operations to the requesting client.
272
272
273
273
```java
@@ -297,7 +297,73 @@ int clientVersion = action.getVersion();
297
297
returnacion;
298
298
}
299
299
```
300
+
## How to perform Scaling in Collaborative Editing.
300
301
302
+
### Role of Scaling in Collaborative editing
303
+
As the number of users increases, collaborative application face challenges in maintaining responsiveness and performance. This is where scaling becomes crucial. Scaling refers to the ability of an application to handle growing demands by effectively distributing the workload across multiple resources.
304
+
305
+
During scaling the users may connected to different servers, so collaborative editing application introduces a specific challenge like, updating the edit operations to all the users connected in different serves. To overcome this issue you need to use ```RedisCachepub/sub``` for message relay(syncing the editing operations to the users connected to different server instance)
306
+
307
+
### Use of Redis Pub/Sub in scaling environment
308
+
Redis offers Pub/Sub functionality. The publish/subscribe (pub/sub) pattern provides asynchronous communication among multiple AWS services without creating interdependency. When a user edits a document, the application can publish the changes to a Redis channel. Clients (in different server instances) subscribed to that channel receive real-time updates, reflecting the changes in their document views.
309
+
310
+
### Steps to configure Redis in Collaborative Editing Application
311
+
Refer to the below steps to know about the Redis pub/sub implementation to sync the messages.
312
+
313
+
#### Step 1: Configure Redis in application level to establish the connection.
314
+
315
+
```java
316
+
//Redis configuration
317
+
spring.datasource.redishost="<Redis host link>"
318
+
spring.datasource.redisport="<Redis port number>"
319
+
```
320
+
#### Step 2: Publish each editing operation to a Redis channel
321
+
322
+
Publish each editing operation to Redis channel with the room name. This will send notifications to all the users(in different servers) subscribed to that specific channel. Refer to the publishToRedis() method in DocumentEditorHub.Java for details.
jedis.publish("collaborativeedtiting", new com.fasterxml.jackson.databind.ObjectMapper().writeValueAsString(payload));
327
+
break;
328
+
} catch (JedisConnectionExceptione) {
329
+
}
330
+
```
331
+
#### Step 3: Subscribe to the specific channel using the Redis Cache 'Subscribe'
332
+
333
+
Redis cache will be initialized and subscribe to the specific channel using the Redis Cache 'Subscribe' option. This ensures that users in any server will get notified when an editing operation is published to the Redis cache using the onMessage() API. Refer to the code snippet in RedisSubscriber.Java for details.
#### Add Web API to get previous operation as a backup to get lost operations
358
358
359
-
On the client side, messages broadcasted using SignalR may be received in a different order, or some operations may be missed due to network issues. In these cases, we need a backup method to retrieve missing records from the database.
359
+
On the client side, messages broadcast using SignalR may be received in a different order, or some operations may be missed due to network issues. In these cases, we need a backup method to retrieve missing records from the database.
360
360
Using the following method, we can retrieve all operations after the last successful client-synced version and return all missing operations to the requesting client.
## How to perform Scaling in Collaborative Editing.
403
+
404
+
As the number of user increases, maintaining responsiveness and performance becomes challenging. Scaling tackles this by distributing the workload across resources. You can scale the collaborative editing application using either ```AzureSignalRserviceorRedisbackplaneservice```
405
+
406
+
### 1. Scaling with Azure SignalR
407
+
408
+
Azure SignalR Service is a scalable, managed service for real-time communication in web applications. It enables real-time messaging between web clients (browsers) and your server-side application(across multiple servers).
409
+
410
+
Below is a code snippet to configure Azure SignalR in an ASP.NET Core application using the ```AddAzureSignalR``` method
Using a Redis backplane, you achieve horizontal scaling of your SignalR application. The SignalR leverages Redis to efficiently broadcast messages across multiple servers. This allows your application to handle large user bases with minimal latency.
422
+
423
+
In the SignalR app, install the following NuGet package:
title: Deploy Syncfusion Word Processor in Amazon Kubernetes Service
4
+
description: Learn here all about How to deploy word processor server docker container in amazon kubernetes service in Syncfusion React Document editor.
5
+
control: How to deploy word processor server docker container in amazon kubernetes service
6
+
platform: ej2-react
7
+
documentation: ug
8
+
domainurl: ##DomainURL##
9
+
---
10
+
# How to deploy Word Processor server in Amazon Kubernetes Service
11
+
12
+
## Prerequisites
13
+
14
+
*`AWS Account`:Have Amazon account
15
+
*`AWS CLI`: Install the AWS Command Line Interface (CLI) on your local machine.
16
+
*`Kubectl` : Install the Kubernetes command-line tool kubectl on your local machine.
17
+
*`Docker`: Install Docker on your local machine.
18
+
*`Word Processor Docker Image`: Have a Docker image of the Word Processor server ready to deploy.
19
+
20
+
To deploy the Word Processor server docker image, need to follow the below process
21
+
22
+
* Push Docker Image to Registry (Amazon Elastic Registry)
23
+
* Deploy Docker Image on Amazon Kubernetes Service
24
+
25
+
Lets us discuss briefly about the each process
26
+
27
+
## Push the Docker image to the Amazon Elastic Registry
28
+
29
+
**Step 1:** Dockerize the Word Processor Server Application with the image name [syncfusion/word-processor-server](https://hub.docker.com/r/syncfusion/word-processor-server)
30
+
31
+
```
32
+
docker build -t <your-image-name>
33
+
```
34
+
35
+
**Step 2:** Create a private repository name ‘documenteditor’ in Amazon Elastic Container Registry (ECR) using the AWS CLI or AWS Console to push the docker image
**Step 4:** Tag the Docker Image to the created cluster
92
+
93
+
```
94
+
docker tag <your-aws-account-id>.dkr.ecr.<your-region>.amazonaws.com/<repository-name>:<tag> <your-eks-cluster-id>.dkr.ecr.<your-region>.amazonaws.com/<repository-name>:<tag>
95
+
```
96
+
97
+
Refer to the following example
98
+
```
99
+
docker tag 12345.dkr.ecr.us-east-1.amazonaws.com/documenteditor:latest 98765ABCD.dkr.ecr.us-east-1.amazonaws.com/documenteditor:latest
100
+
```
101
+
102
+
In this command:
103
+
* <your-eks-cluster-id> should be replaced with your EKS cluster ID, which is the base part of your EKS cluster endpoint (e.g., abcd1234).
104
+
* <your-region> should be replaced with your AWS region.
105
+
106
+
107
+
**Step 5:** To create Kubernetes deployment write Kubernetes manifest
108
+
109
+
**i.** Create a Kubernetes Deployment manifest (deployment.yaml) for your application. Specify the Docker image location.
0 commit comments