One coherent MiMo external-research pass. Discovery and reading remain visible as subsections inside the artifact, not separate top-level stages. Artifact has discovery and reading subsections. Event relay streams both.
1 line
7.5 KiB
JSON
1 line
7.5 KiB
JSON
{"success":true,"data":{"web":[{"url":"https://news.ycombinator.com/item?id=31473373","title":"I've yet to see how you can use SQLite for a multi-user multi-write app ...","description":"SQLite doesn't support concurrent writers. In WAL mode it can handle a single writer with concurrent readers. In \"vanilla\" mode, a writer requires exclusive ...","position":1},{"url":"https://sqlite.org/forum/info/b4e8b29ae409cd198652c6b7e70b53b702f269e67e1d2573d627feeba37bbf85","title":"Multiple Writers - SQLite User Forum","description":"# Multiple Writers\n### (1) By [pyarlath](https://sqlite.org/forum/timeline?ss=v&y=f&vfx&u=pyarlath) on 2025-01-03 08:35:02 [[link]](https://sqlite.org/forum/forumpost/7fb8bf206005d943) [[source]](https://sqlite.org/forum/forumpost/7fb8bf206005d943?raw)\n```\nI am new to this forum, so please be adjusting of me if i ask some noob level questions.\n\nWhy cant sqlite have multiple writers?\n\nMy theoretical understanding is if you open a file in append only mode by 2 process, each process can append data without overwriting each other, now i further understand the support for append is weak in other systems apart from linux or may even differ, but then whats stopping to write a module with shared memory or file or something equivalent to maintain a counter and allocate exclusive space for different writers such that they dont overwrite each other in same file a little like MVCC but instead of version of same data its writing different data from different writers..\n\nI understand there will be more issues internal to sqlite to manage other ds but i feel they can managed with some clever solution, the real limitation should be file cannot accept multiple writer, but they do in an append only mode..\n\nDoes this click some thought?\n```\n\n### (4) By [pyarlath](https://sqlite.org/forum/timeline?ss=v&y=f&vfx&u=pyarlath) on 2025-01-03 13:14:00 in reply to [2.1](https://sqlite.org/forum/forumpost/6fda11b073) [[link]](https://sqlite.org/forum/forumpost/dcdf209b088e7f93) [[source]](https://sqlite.org/forum/forumpost/dcdf209b088e7f93?raw)\n```\nI may be wrong but as a DB system it should be able to provide multiple writers to a same sqlite file is my recommendation here, if to writers wants to update same at same time fine we should be able to give them that provision with complete data integrity, what meaning that data makes to them is app driven logic..\n\nI am talking here about lockless system like MVCC where updates to same row can be made by just appending to the file at the same time without any locks. So i think there is no illusion here its a well known practice in DB world... i feel\n```\n\n### (5) By [pyarlath](https://sqlite.org/forum/timeline?ss=v&y=f&vfx&u=pyarlath) on 2025-01-03 13:16:22 in reply to [3](https://sqlite.org/forum/forumpost/c36f1f8f03) [[link]](https://sqlite.org/forum/forumpost/b85a03da3c87e6ea) [[source]](https://sqlite.org/forum/forumpost/b85a03da3c87e6ea?raw)\n```\nNot sure why you thought of performance is what i am after, i am not my request was just like multiple process can read the same DB file, i wanted to understand what is the challenge to provide multiple writer? specially when systems like append-only data structures exists..\n```\n\n### (12) By [pyarlath](https://sqlite.org/forum/timeline?ss=v&y=f&vfx&u=pyarlath) on 2025-01-03 19:07:57 in reply to [11](https://sqlite.org/forum/forumpost/b4e8b29ae4) [[link]](https://sqlite.org/forum/forumpost/85cde6083d4c6102) [[source]](https://sqlite.org/forum/forumpost/85cde6083d4c6102?raw)\n```\nI never said I understand sqlite, infact I am noob like i said in the original first post.. but am a big fan of the embedded database strategy..\n\nTransactions in append only file formats are durable and also have order the append order..\n\nI am not asking for a coordinator process but all we need is to do is coordinate of the underlying file size and keep appending ie adding to it as a shared counter..\n\nI completely understand file format compatibility is number 1 priority, but we can always achieve the said by having extra file just like Wal which will be home for multiple writers and possible move data to sqlite format on periodic time..\n\nAgain my interest is in suggesting this concept of achieving multiple writer but the community can tell me if this a feasible idea..\n```\n\n### (15) By [pyarlath](https://sqlite.org/forum/timeline?ss=v&y=f&vfx&u=pyarlath) on 2025-01-04 11:24:41 in reply to [13](https://sqlite.org/forum/forumpost/388af122d9) [[link]](https://sqlite.org/forum/forumpost/f39edda8db7d11a5) [[source]](https://sqlite.org/forum/forumpost/f39edda8db7d11a5?raw)\n```\nThat's called snapshot, Each transaction starts with a snapshot[simply say file size here] so when final commit happens transaction just compares the snapshot[file size] if no data is mutated it remains same else it's changes and we can throw serialization error for the transaction..\n\nAgain all this is common practice in PG and other ACID compliant RDBMS and solved problems.. you may want to read up on MVCC and Snapshotting\n\nSo wondering what's stopping sqlite from providing multiple writers?\n\nTill now I could gather file backward compatibility as P1 kind of issue for providing multiple writers..\n```\n\n### (14) By cj ( [sqlitening](https://sqlite.org/forum/timeline?ss=v&y=f&vfx&u=sqlitening)) on 2025-01-03 22:50:57 in reply to [12](https://sqlite.org/forum/forumpost/85cde6083d) [[link]](https://sqlite.org/forum/forumpost/91f76480f0d64d5b) [[source]](https://sqlite.org/forum/forumpost/91f76480f0d64d5b?raw)\n```\nA queue or multiple temp files can be created (doesn't have to be in SQLite)\nIf using a server this is not needed. SQLite only takes milliseconds between writers.\n\nCreate Thread Writer(UserNum)to hthread //create threads\n// WaitForSingleUser hThread //wait for thread(s) to finish\n// Process temp files\n\nTHREAD FUNCTION Writer (UserNum AS LONG) AS LONG\n OPEN \"temp\" + UserNum // create database\n create table if not exists t(c text) // create table\n INSERT into t(c) values(?),binddata // append\nEND FUNCTION\n```","position":2},{"url":"https://www.bugsink.com/blog/database-transactions/","title":"Single-writer Database Architecture with SQLite - Bugsink","description":"SQLite allows only one writer at a time. Even in WAL mode, concurrent write transactions are not possible – any attempt to write while another ...","position":3},{"url":"https://stackoverflow.com/questions/9264772/sqlite-alternative-with-concurrent-writing-delphi","title":"SQLite alternative with concurrent writing (Delphi) - Stack Overflow","description":"SQLite3 default writing method is expected to be such, in order to ensure access to the same file from multiple processesSQLite Concurrent Access - Stack OverflowTrying to hack my way around SQLite3 concurrent writing, any better way ...More results from stackoverflow.com","position":4},{"url":"https://turso.tech/blog/beyond-the-single-writer-limitation-with-tursos-concurrent-writes","title":"Beyond the Single-Writer Limitation with Turso's Concurrent Writes","description":"We see that Turso's write throughput drops similarly to SQLite in the single-threaded case because the busy-looping of each transaction uses up ...","position":5},{"url":"https://www.youtube.com/watch?v=vRIUbvKmoCg","title":"Small data, big features: we are rewriting SQLite! ft. Glauber Costa","description":"... SQLite's synchronous architecture and single writer design create bottlenecks that limit what's possible. Turso is fully async with MVCC for ...","position":6}]},"id":"01a08313-aa71-70d5-93a8-d61bd6c3c0f6","creditsUsed":2} |