in reply to Simultaneous access to the tk script
SQLite Write performance can be a big issue. In order to do a write (update, append) or whatever, the connection doing the write has to acquire an exclusive lock on the DB! SQlite has its own locking mechanism and this works fine on Windows or Unix. I would think that 20-30 readers would work fine. Whether the UI is driven by Tk or the exe is packed by PAR shouldn't matter. You might find SQlite V3 Exclusive Locking helpful.
The big issue with SQLite is going to come down to performance of write operations.
Some time ago, I was working on the design a similar project meaning 20-30 remote clients running a Perl Tk GUI viewing an SQLite DB. The design never progressed to an implementation phase. Some significant DB consistency issues surfaced. For this design, figured that I'd need a central server to manage the connections and the central server would be the single writer and would push notifications to the other clients.
Say User 1 updates a row that User 2 is looking at. I would have to know that User 2's data had been updated. User 2's view would need to be updated. What happens when two users try to update the same field at the same time? Who "wins" and how to do you tell the guy who "lost" that he lost?". When a row was updated this could potentially mean updating displays on all the attached clients. This was a very weird DB application where we knew that some rows (records) we corrupted. Two different users could come up with their own ideas of what record 1234 should be. Anyway that means complicated mess!
Hope this helps, Main point is that SQlite Write performance is limited.
Marshall
Update: No matter what the DB, if the DB changes a record, you have to figure out how to update the clients who are looking at that particular record. This can be complex. There are various "trigger" mechanisms, but your clients will have to be aware of a change in order to refresh their display based upon what other clients did to the central DB. WOW! This can become complicated.
If all of the clients are "read only", this is easy. If one or more of the clients can modify the DB...The complexity is x10.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Simultaneous access to the tk script
by Anonymous Monk on Jun 03, 2018 at 17:24 UTC | |
by Marshall (Canon) on Jun 04, 2018 at 18:52 UTC | |
by Anonymous Monk on Jun 06, 2018 at 17:54 UTC | |
by Marshall (Canon) on Jun 06, 2018 at 20:20 UTC |