07-18, 11:00–11:30 (Europe/Sarajevo), PA01
Real-time GIS has become an essential tool in various domains, including Volunteered Geographic Information (VGI) and disaster management. One of critical topics in real-time GIS is concurrency control (Sun and Li 2016). In the geospatial domain, concurrency has traditionally been controlled using optimistic or pessimistic models (i.e. versioning and locking, respectively). In the domain of distributed databases, a standard consistency model, called strong consistency, ensures that a set of distributed databases behave as if they were a single database. However, enforcing strong consistency can introduce bottlenecks and lags, and requires significant hardware resources and time to implement.
To address these drawbacks, a more relaxed approach called strong eventual consistency (SEC) (Gomes et al. 2017) has been developed in the domain of real-time text co-editing. Unlike strong consistency, SEC lets each site edit its local copy of the data without any restrictions and replicate all the updates to all other sites, which, upon reception, apply them on their local data. Temporary local inconsistencies are allowed between the participating sites, but it is guaranteed that, once all sites have received the same set of updates, they will be in the same state (i.e., they will converge).
It has recently been shown that SEC model i.e. its instantiation, CRDT (Commutative Replicated Data Type) technology (Shapiro et al. 2011) can also be used for the task of geospatial co-editing. Within the research (Matijević et al. 2024), an experimental real-time geospatial co-editor (source code referenced in the original paper) has been developed and tested. The implementation uses OpenLayers (OL) on the graphical user interface (GUI) and a small, unoptimized but complete and correct Javascript CRDT library called Reference CRDTs (Gentle 2023). The research showed that, when applied to the co-editing of geospatial geometry in its native form, standard CRDT conflict resolution mechanics exhibit some issues. As an attempt to address these issues, the authors developed an advanced operation generation technique named “tentative operations”. This technique allows for the operations to be generated over the most recent session-wide state of the data, which in effect highly reduces concurrency and provides a “geometry aware” conflict resolution. The tests conducted using the developed system showed that in low-latency network conditions, the negative effects of standard CRDT conflict resolution mechanics do get minimized even under increased loads (many concurrent sites co-editing a low vertex count geometry).
Real-time co-editors generally aim to provide good user experience of the system, with correct handling of conflicts being one of its important aspects. However, besides correct handling of conflicts, the system also has to be responsive. The responsiveness of real-time co-editors depends on the efficiency of the underlying business logic but also on the efficiency of the GUI itself. Especially in the case of geospatial data manipulation, both the GUI and the business logic will be additionally stressed by increasing the vertex count of geometries being co-edited. Since within the original research the tests were performed using polygons low vertex count (several hundreds), it remained unknown how would a CRDT based geospatial co-editor behave when much larger geometries (e.g. hundreds of thousands of vertices) are co-edited.
Within this research we therefore investigate the impact that the increase of vertex count has on the overall performance of the system, which in turn can hinder responsiveness. We reused the existing implementation from (Matijević et al. 2024) and only introduced minor modifications to achieve the ability to time the execution of its key mechanisms. Instead of focusing on the performance of CRDT mechanisms only, we observed the behaviour of the complete system. We first analysed the overall composition of the system and divided it into several distinct parts. Then, during load testing we observed how the performance of each of those parts changes when handling geometries with increasing vertex counts. To stress the system, we created three polygons with 100K, 200K and 300K vertexes and conducted real co-editing sessions over those polygons. The upper limit of 300K was selected based on preliminary testing which showed that already at this vertex count OL starts to lose responsiveness in editing mode. The sessions were conducted using several identical instances of some recent, mainstream hardware and the latest Google Chrome browser.
As expected, the results of the experiment show that the overall performance of the system does suffer from the increased vertex count of the geometry being co-edited. In the setting as implemented within the research (Matijević et al. 2024) the part most affected by the increased vertex count turned out to be the redrawing on GUI upon integration of remote updates while the client is in editing mode. This is because the implementation uses a simple redraw method where the complete geometry is replaced by its new version.
The results from this research show that geometries with high vertex count can efficiently be co-edited in real-time. However, there exists a limit where the increased vertex count will start to render the system irresponsive, depending on the capabilities of the hardware that the clients are running on.
The results from this research are to be observed in the setting which includes both CRDT and OL written in Javascript, with CRDT implementation including only some simple optimizations and with no tighter CRDT-OL coupling other than what OL offers off-the-shelf. It can therefore be expected that a deeper integration of CRDT mechanisms with OL could make some of the critical parts of the implementation faster. Also, there exist several mature, production ready open-source CRDT frameworks which include many optimizations and can outperform the Reference CRDTs by orders of magnitude.
Gentle, J. 2023. Reference Crdts. https://github.com/josephg/reference-crdts
Gomes, V.B.F.; Kleppmann, M.; Mulligan, D.P.; Beresford, A.R. 2017. Verifying strong eventual consistency in distributed systems. Proc. ACM Program. Lang. 2017, 1, 1–28.
Matijević, H., Vranić, S., Kranjčić, N., Cetl, V. 2024. Real-Time Co-Editing of Geographic Features. ISPRS International Journal of Geo-Information 13, no. 12: 441.
Sun, Y., Li, S. 2016. Real-time collaborative GIS: A technological review. ISPRS J. Photogramm. Remote Sens. 2016, 115, 143–152.
Shapiro, M.; Preguiça, N.M.; Baquero, C.; Zawirski, M. 2011. Convergent and Commutative Replicated Data Types. Bull. EATCS 2011, 104, 67–88.
Hrvoje Matijević is assistant professor at University North, Department of Geodesy and Geomatics. His main research fields are Web GIS technologies, geospatial data processing and geospatial databases. Prior to resuming his academic career Hrvoje worked as consultant and project manager in several large IT companies dealing with GIS and geospatial data management.