You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
-
wow this is entirely different than everything I implemented so far... so serialise all the operations in so to say a queue? I assume there would be only 1 worker thread then? Why do you say overwrites cannot be avoided? (the -1 is not from me btw)– UserCommented Dec 15, 2015 at 16:41
-
Yes, one thread. Overwrites are unavoidable since you cannot prevent a later transaction to overwrite the change you previously made, neither with my approach or yours, although I've seen that Apple just duplicates some entries when there's a conflict, when syncing notes, which is weird since nobody else is syncing my notes. I'll add an edit to the overwrites part.– Tulains CórdovaCommented Dec 15, 2015 at 17:51
-
@ixxzz The gist of my answer is that by doing it asyncrhonously you take out a lot of complexity.– Tulains CórdovaCommented Dec 15, 2015 at 17:55
-
Mhh interesting. Yeah update overwrites would be unavoidable without a timestamp check. But I think that's ok. Wonder about the performance, my code is already asynchronous (the database access also). But not limited to a single thread. Also, to represent these transactions, a nosql database is probably suitable? Have a lot of items with very different structure. Not sure if it's worth to rewrite my sync instead of trying to improve what I have already. For now +1, I'm curious if there are other approaches.– UserCommented Dec 15, 2015 at 19:08
-
I'd argue that updating data needs to be synchronous if the data can be partially updated. Otherwise, data integrity cannot be guaranteed.– Jeffrey SweeneyCommented Dec 15, 2015 at 22:00
|
Show 3 more comments
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
-
create code fences with backticks ` or tildes ~
```
like so
``` -
add language identifier to highlight code
```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_`
- quote by placing > at start of line
- to make links (use https whenever possible)
<https://example.com>
[example](https://example.com)
<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. design-patterns), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you