Skip to content

Multiple Thread Overwrites #452

Answered by msiemens
jgarte asked this question in Q&A
Jan 6, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

@jgarte I've taken the liberty to move this to the discussions section as I think that's the best place to, well, discuss questions like these 🙂

Basically TinyDB doesn't handle this – at all. TinyDB expects you to either only write data from a single thread or use some kind of locking to make sure multiple threads don't create data corruption issues. The reasoning behind this is that TinyDB's design goals are 1) simplicity and 2) extensibility. The latter in particular means that there is no one-size-fits-all locking mechanism that would work with every imaginable storage backend that one could implement. And even if writing to the storage is atomic, TinyDB's insert and update methods are…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jgarte
Comment options

Answer selected by msiemens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #450 on January 10, 2022 19:45.