micro-analytics / micro-analytics/micro-analytics-cli
atomicity and db operation concerns
Nessuno ha ancora preso questa issue.
- Lingua principale
- JavaScript
- Stelle
- 732
- Fork
- 39
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
So as a few people have brought up, we are mimicking locking in our pushView util function which seems to be doing the db adapter's job. For example, if a db solution supports a "add or increment" function or handles atomicity cross process, then we are introducing a performance bottleneck by having all adapters use our locks logic and 2-3 transaction inserts. For the record, I think it was a really good starting point but we should take it to the next level.
So, I think that the next phase of our adaptors, while there are only two, need to support the API that we provided but the put needs to be changed. If they need to manually call their this.has() and this.get() to reconcile what they need to do, then go for it, but we shouldn't force that. So we should change put (or possibly rename it) but we should give them the key and they need to resolve a promise with the count value.
What do you think?
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia leggendo l’utility pushView e i due adapter del database, quindi segui il modo in cui la loro operazione put attuale esegue i controlli has/get, il locking e gli inserimenti nelle transazioni. Decidi il contratto di put lato adapter, incluso il modo in cui riceve la chiave e risolve il count, preservando l’API esistente dove richiesto. Il lavoro è completato quando entrambi gli adapter supportano il comportamento concordato per le operazioni atomiche senza locking condiviso forzato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, node.js
- Ambito
- backend, databases
- Tipo di issue
- Refactoring
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100