Design a service for sharing and collaborating on maps, with versioning, permissions, and offline edits.
Asked at
AI answer
Architecture and data model
Clients interact through an API and a collaborative editing service. Store Map, Layer, Feature, Membership, Permission, and immutable Operation/Version records. Store geospatial data and map metadata in a spatial database; store large attachments and version snapshots in object storage. A CDN speeds up delivery of tiles and immutable assets.
Collaborative editing
Each edit includes an operation ID, user, base version, timestamp, and modified object. The server checks permissions, saves the operation, and broadcasts it to subscribers over WebSocket; periodic snapshots keep the log from growing too long. CRDTs/operational transformations can be used for text fields or structured layers when concurrent edits are needed. For geometry, it is safer to detect competing changes to the same object and offer a comparison or explicit conflict resolution: automatic merging can alter the meaning of the map.
Versions and offline mode
The client stores a local copy of the map and a queue of operations with unique IDs. When connectivity is restored, it sends the operations along with the base version; the server checks permissions and conflicts, deduplicates retries, and returns either accepted changes or a conflict to resolve. Versions must be reproducible: record the author, timestamp, parent version, and operations; support viewing and rollback by creating a new version rather than deleting history.
Availability and security
Set permissions at the map level and, if needed, at the layer level: owner, editor, viewer; the server checks permissions for every operation. Use TLS, auditing, backups, and access controls for shared links. Isolate maps by owner/organization. Metrics: edit propagation latency, offline sync queue size, conflicts, save errors, and map loading time.
Also asked at Andersen
- Which company did you work for and what projects did you handle?
- How do you work with Linux at the system administration level?
- What databases do you have experience working with?
- How is a container built and run from a Dockerfile?
- How did you deploy the Kubernetes cluster and how did you manage it? What tools did you use for rollout?
Similar questions
- Design a service for sharing and collaborating on architectural diagrams, with versioning and comments.
- Design a service for sharing and collaborating on 3D models, with versioning, permissions, and streaming uploads of large files.
- Design a service for collaboratively creating and reviewing business plans, with versioning, comments, and roles.
- Design a service for sharing and collaboratively working on scientific papers, with peer review, versioning, and anonymity.
- Design a service for collaboratively planning trips, with bookings and changes.