appwrite / appwrite/appwrite

🚀 Feature: Optimistic Concurrency

Offen
#5,348 2 Kommentare 7 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
TypeScript
Sterne
57.4k
Forks
5.7k
Ø Merge
16 Std. 13 Min.
Gemergte PRs (30 T.)
297

Beschreibung

### 🔖 Feature description

Optimistic concurrency allows to manage the update of a "document or record" when multiple users try to update it at the same time. For instance, user A open the form of document X and start to edit it; after a few seconds/minutes user B open the same form of document X and "edit and save" faster than user A, so, when user A click "save" button a popup or error appears saying that the document has changed (with a button to query the document again).

### 🎤 Pitch

Many backend frameworks implement this out-of-the-box, like .NET abp framework:
https://docs.abp.io/en/abp/latest/Concurrency-Check

And it is a necessary feature for enterprise domains. An example of a use case is manufacturing process:
lets say in the BOM (bill of materials) of a product we have 30 parts, and there are a lot of supervisors that request parts via an APP (that uses appwrite) to start the production in each line; if 2 or more supervisors open the same order (with 100 ordered products) and they request the entire order, without optimistic concurrency 6000 part will be get from inventory instead of 3000, and no body knows that until the parts arrive to the lines or the finished product inventory. Optimistic concurrency avoid the need of comunication between supervisors, or that certains supervisor only can touch certain orders (bad practice in some companies), etc, etc.

Optimistic concurrency helps to simplify those kind of use cases, other example is when someone update the price of a product in an order or buget document.

### 👀 Have you spent some time to check if this issue has been raised before?

- [X] I checked and didn't find similar issue

### 🏢 Have you read the Code of Conduct?

- [X] I have read the [Code of Conduct](https://github.com/appwrite/.github/blob/main/CODE_OF_CONDUCT.md)

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Es werden keine Dateien, Tests oder Einstiegspunkte genannt. Beginnen Sie damit, den Backend-Aktualisierungspfad für Dokumente oder Datensätze zu finden und die bestehenden Konventionen für Konflikte und Fehler zu prüfen; als abgeschlossen gilt die Aufgabe, wenn ein vereinbartes Nebenläufigkeitsdesign, eine Konfliktantwort und das Aktualisierungsverhalten des Clients festgelegt sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
backend-api-design, databases
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.