title: ÐÑÐ¿Ð¾Ð»ÑÐ·Ð¾Ð²Ð°Ð½Ð¸Ðµ Ð±ÐµÑÐºÐ¾Ð½ÑÐ»Ð¸ÐºÑÐ½ÑÑ ÑÐµÐ¿Ð»Ð¸ÑÐ¸ÑÑÐµÐ¼ÑÑ ÑÐ¸Ð¿Ð¾Ð² Ð´Ð°Ð½Ð½ÑÑ Ð´Ð»Ñ ÑÐ°Ð·ÑÐ°Ð±Ð¾ÑÐºÐ¸ ÑÐ¾Ð²Ð¼ÐµÑÑÐ½Ð¾Ð³Ð¾ ÑÐµÐºÑÑÐ¾Ð²Ð¾Ð³Ð¾ ÑÐµÐ´Ð°ÐºÑÐ¾ÑÐ°
title: Ð²ÑÐ¿ÑÑÐºÐ½Ð°Ñ ÐºÐ²Ð°Ð»Ð¸ÑÐ¸ÐºÐ°ÑÐ¸Ð¾Ð½Ð½Ð°Ñ ÑÐ°Ð±Ð¾ÑÐ° Ð±Ð°ÐºÐ°Ð»Ð°Ð²ÑÐ°
titleType: Subtitle
title: Using conflict-free replicated data types to develop a collaborative text editor
Creators: name: ÐÐ°Ð³ÑÐ¾Ð², ÐÐ°ÑÐ²ÐµÐ¹
Publisher: name: Ð¡Ð°Ð½ÐºÑ-ÐÐµÑÐµÑÐ±ÑÑÐ³ÑÐºÐ¸Ð¹ Ð¿Ð¾Ð»Ð¸ÑÐµÑÐ½Ð¸ÑÐµÑÐºÐ¸Ð¹ ÑÐ½Ð¸Ð²ÐµÑÑÐ¸ÑÐµÑ ÐÐµÑÑÐ° ÐÐµÐ»Ð¸ÐºÐ¾Ð³Ð¾
Year: 2024
Subjects: CRDT
P2P
MVP
WebSocket
TCP
Java
Gradle
Intellij IDEA
ÑÐ°ÑÐ¿ÑÐµÐ´ÐµÐ»ÐµÐ½Ð½ÑÐµ ÑÐ¸ÑÑÐµÐ¼Ñ
ÑÐµÐºÑÑÐ¾Ð²ÑÐ¹ ÑÐµÐ´Ð°ÐºÑÐ¾Ñ
ÐºÐ¾Ð½ÑÐ¸ÑÑÐµÐ½ÑÐ½Ð¾ÑÑÑ
Ð¿Ð¸ÑÑ
ÐºÐ»Ð¸ÐµÐ½Ñ
ÑÐµÑÐ²ÐµÑ
JSON
distributed systems
text editor
consistency
peers
client
server

description: Ð Ð´Ð°Ð½Ð½Ð¾Ð¹ ÑÐ°Ð±Ð¾ÑÐµ Ð¾Ð¿Ð¸ÑÑÐ²Ð°ÐµÑÑÑ Ð°Ð½Ð°Ð»Ð¸Ð· ÑÑÑÐµÑÑÐ²ÑÑÑÐ¸Ñ Ð¿ÑÐ¾Ð±Ð»ÐµÐ¼ ÑÐ°ÑÐ¿ÑÐµÐ´ÐµÐ»ÐµÐ½Ð½ÑÑ ÑÐ¸ÑÑÐµÐ¼ Ð¸ ÑÐ¾Ð²ÑÐµÐ¼ÐµÐ½Ð½ÑÑ Ð¼ÐµÑÐ¾Ð´Ð¾Ð² Ð¸Ñ ÑÐµÑÐµÐ½Ð¸Ñ. ÐÐ¿Ð¸ÑÐ°Ð½ Ð¿ÑÐ¾ÑÐµÑÑ ÑÐ°Ð·ÑÐ°Ð±Ð¾ÑÐºÐ¸ ÐÐ, ÑÐµÐ·ÑÐ»ÑÑÐ°ÑÐ¾Ð¼ ÐºÐ¾ÑÐ¾ÑÐ¾Ð¹ ÑÐ²Ð»ÑÐµÑÑÑ Ð¿ÑÐ¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ðµ ÑÐ¾Ð²Ð¼ÐµÑÑÐ½Ð¾Ð³Ð¾ ÑÐµÐ´Ð°ÐºÑÐ¸ÑÐ¾Ð²Ð°Ð½Ð¸Ñ ÑÐµÐºÑÑÐ° Ð´Ð»Ñ Ð½ÐµÑÐºÐ¾Ð»ÑÐºÐ¸Ñ ÑÑÐ°ÑÑÐ½Ð¸ÐºÐ¾Ð² Ð² Ð¾Ð´Ð½Ð¾ÑÐ°Ð½Ð³Ð¾Ð²Ð¾Ð¹ ÑÐµÑÐ¸ Ñ Ð²Ð¾Ð·Ð¼Ð¾Ð¶Ð½Ð¾ÑÑÑÑ Ð¾Ð±ÑÐ°ÑÑÑÑ Ð²Ð¾ Ð²ÑÑÑÐ¾ÐµÐ½Ð½Ð¾Ð¼ ÑÐ°ÑÐµ. Ð Ð¾ÑÐ½Ð¾Ð²Ðµ Ð»Ð¾Ð³Ð¸ÐºÐ¸ ÑÐµÐ´Ð°ÐºÑÐ¾ÑÐ° Ð»ÐµÐ¶Ð¸Ñ ÑÐ²Ð¾Ñ ÑÐµÐ°Ð»Ð¸Ð·Ð°ÑÐ¸Ñ Ð±ÐµÑÐºÐ¾Ð½ÑÐ»Ð¸ÐºÑÐ½ÑÑ ÑÐµÐ¿Ð»Ð¸ÑÐ¸ÑÑÐµÐ¼ÑÑ ÑÐ¸Ð¿Ð¾Ð² Ð´Ð°Ð½Ð½ÑÑ. ÐÐ°Ð´Ð°ÑÐ¸, ÐºÐ¾ÑÐ¾ÑÑÐµ ÑÐµÑÐ°Ð»Ð¸ÑÑ Ð² ÑÐ¾Ð´Ðµ ÑÐ°Ð·ÑÐ°Ð±Ð¾ÑÐºÐ¸: 1. ÐÑÑÐ»ÐµÐ´Ð¾Ð²Ð°Ð½Ð¸Ðµ Ð¿ÑÐµÐ´Ð¼ÐµÑÐ½Ð¾Ð¹ Ð¾Ð±Ð»Ð°ÑÑÐ¸; 2. ÐÐ½Ð°Ð»Ð¸Ð· ÑÑÑÐµÑÑÐ²ÑÑÑÐ¸Ñ ÑÐµÑÐµÐ½Ð¸Ð¹; 3. ÐÐ·ÑÑÐµÐ½Ð¸Ðµ ÑÑÐµÐ±Ð¾Ð²Ð°Ð½Ð¸Ð¹ Ð·Ð°ÐºÐ°Ð·ÑÐ¸ÐºÐ°; 4. Ð¤Ð¾ÑÐ¼Ð¸ÑÐ¾Ð²Ð°Ð½Ð¸Ðµ ÑÐµÑÐ½Ð¸ÑÐµÑÐºÐ¾Ð³Ð¾ Ð·Ð°Ð´Ð°Ð½Ð¸Ñ Ð¸ ÑÑÐµÐ±Ð¾Ð²Ð°Ð½Ð¸Ð¹ Ðº Ð¿ÑÐ¾Ð´ÑÐºÑÑ; 5. ÐÑÐ±Ð¾Ñ ÑÑÐµÐ´ÑÑÐ² ÑÐ°Ð·ÑÐ°Ð±Ð¾ÑÐºÐ¸; 6. ÐÑÐ±Ð¾Ñ Ð°ÑÑÐ¸ÑÐµÐºÑÑÑÑ; 7. Ð Ð°Ð·ÑÐ°Ð±Ð¾ÑÐºÐ° Ð¸ ÑÐµÑÑÐ¸ÑÐ¾Ð²Ð°Ð½Ð¸Ðµ Ð¿ÑÐ¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ; 8. ÐÐ½Ð°Ð»Ð¸Ð· Ð¿Ð¾Ð»ÑÑÐµÐ½Ð½ÑÑ ÑÐµÐ·ÑÐ»ÑÑÐ°ÑÐ¾Ð². ÐÐ»Ñ ÑÐ°Ð·ÑÐ°Ð±Ð¾ÑÐºÐ¸ Ð±ÑÐ» Ð²ÑÐ±ÑÐ°Ð½ ÑÐ·ÑÐº Ð¿ÑÐ¾Ð³ÑÐ°Ð¼Ð¼Ð¸ÑÐ¾Ð²Ð°Ð½Ð¸Ñ Java, Ñ ÑÐµÐ°Ð»Ð¸Ð·Ð°ÑÐ¸ÐµÐ¹ Ð³ÑÐ°ÑÐ¸ÑÐµÑÐºÐ¾Ð³Ð¾ Ð¸Ð½ÑÐµÑÑÐµÐ¹ÑÐ° Ñ Ð¿Ð¾Ð¼Ð¾ÑÑÑ Ð±Ð¸Ð±Ð»Ð¸Ð¾ÑÐµÐºÐ¸ Swing. Ð Ð°Ð±Ð¾ÑÐ° Ð²ÐµÐ»Ð°ÑÑ Ð² Ð¸Ð½ÑÐµÐ³ÑÐ¸ÑÐ¾Ð²Ð°Ð½Ð½Ð¾Ð¹ ÑÑÐµÐ´Ðµ ÑÐ°Ð·ÑÐ°Ð±Ð¾ÑÐºÐ¸ Intellij IDEA. ÐÑÐ½Ð¾Ð²Ð¾Ð¹ Ð¿ÑÐ¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ ÑÐ²Ð»ÑÐµÑÑÑ Ð°ÑÑÐ¸ÑÐµÐºÑÑÑÐ½ÑÐ¹ Ð¿Ð°ÑÑÐµÑÐ½ MVP. ÐÐ»Ñ ÑÐµÐ°Ð»Ð¸Ð·Ð°ÑÐ¸Ð¸ P2P ÑÐµÑÐ¸ Ð²ÑÐ±ÑÐ°Ð½ Ð¿ÑÐ¾ÑÐ¾ÐºÐ¾Ð» Web-Socket, Ð½Ð°Ð¿Ð¸ÑÐ°Ð½Ð° Ð¿ÑÐ¾Ð³ÑÐ°Ð¼Ð¼Ð° ÑÐ¸Ð³Ð½Ð°Ð»ÑÐ½Ð¾Ð³Ð¾ ÑÐµÑÐ²ÐµÑÐ°. ÐÐ»Ñ ÑÐµÐ°Ð»Ð¸Ð·Ð°ÑÐ¸Ð¸ ÑÐµÑÐµÐ²Ð¾Ð³Ð¾ Ð²Ð·Ð°Ð¸Ð¼Ð¾Ð´ÐµÐ¹ÑÑÐ²Ð¸Ñ Ð½Ð° Java Ð²ÑÐ±ÑÐ°Ð½Ð° Ð±Ð¸Ð±Ð»Ð¸Ð¾ÑÐµÐºÐ° Java-Websocket, Ð´Ð»Ñ ÑÐ¾ÐºÑÐ°ÑÐµÐ½Ð¸Ñ Ð¾Ð±ÑÐµÐ¼Ð° ÑÐ°Ð±Ð»Ð¾Ð½Ð½Ð¾Ð³Ð¾ ÐºÐ¾Ð´Ð° Ð¸ÑÐ¿Ð¾Ð»ÑÐ·Ð¾Ð²Ð°Ð½Ð° Ð±Ð¸Ð±Ð»Ð¸Ð¾ÑÐµÐºÐ° Lombok.
description: This paper describes an analysis of existing problems of distributed systems and modern methods for solving them. The software development process is described, the result of which is a collaborative text editing application for several participants in a peer-to-peer network with the ability to communicate in a built-in chat. The editors logic is based on its own implementation of conflict-free replicated data types. Problems that were solved during development: 1. Research of the subject area; 2. Analysis of existing solutions; 3. Study of customer requirements; 4. Formation of technical specifications and product requirements; 5. Selection of development tools; 6. Choice of architecture; 7. Application development and testing; 8. Analysis of the results obtained. The Java programming language was chosen for development, with a graphical interface implemented using the Swing library. The work was carried out in the integrated development environment Intellij IDEA. The basis of the application is the MVP architectural pattern. To implement the P2P network, the Web-Socket protocol was chosen, and a signaling server program was written. To implement network in-teraction in Java, the Java-Websocket library was chosen, and the Lombok library was used to reduce the amount of boilerplate code.