Live data from Hacker News

SQLite Is Serverless

sqlite.org

101–110 of 453 posts

Re: SQLite Is Serverless

#101

> Of those that are serverless, SQLite is the only one known to this author that allows multiple applications to access the same database at the same time. IIRC, MS Access allowed that, which explained a lot of its popularity.

And all xBase based programming languages, Clipper, FoxPro, Visual Assist, and their competition Paradox.

I loved the Clipper 5 OOP capabilities, sadly Visual Objects tried to be too much like Visual Basic and some of the easiness was lost.

Re: SQLite Is Serverless

#102
post #86

Earlier quoted context omitted.

I'm not sure I understand what the physical transport has to do with this. Can you please expand a bit?

Maybe disconnect and reconnect cause windows network share to lose locks or something like that.

Yes, for Access (and sqlite?) it is the client computers that do the edits directly to the database file, rather than via a mediating server side process, so they are particularly vulnerable to network interruptions while in the middle of an edit. Cable is far more reliable than wifi and so far fewer interruptions. I think that's it.

Re: SQLite Is Serverless

#103

> Of those that are serverless, SQLite is the only one known to this author that allows multiple applications to access the same database at the same time. IIRC, MS Access allowed that, which explained a lot of its popularity.

It did allow it but getting it running reliably was basically getting punched in the face on a daily basis. Act! Was similar except they included getting kicked in the balls two to three times a week.

The reason access was popular was it made any middle manager that could wield an Excel spreadsheet think they could build a database.

Re: SQLite Is Serverless

#104
post #81

Earlier quoted context omitted.

MS Access "allowed" it. SQLite actually works.

Access is actually designed to work in a multiuser situation over a LAN for concurrent read and write. SQLite isn't afaik. As long as the LAN was cabled I never saw any issues. The only reason it was necessary to move to a server type database was because people were insisting on wifi networking.

It might have been designed for it. It was poorly designed for it. It was a clustfuck of corruption when actually utilized

Re: SQLite Is Serverless

#105
post #24

a bit tangential, but when do you move form using in-application data structures (maps, trees, vector/arrays) to using a database? Is it basically when the data doesn't fit in memory? I've been programming for almost a decade and I've never come across needing a database... (for context, it's ten years without anything web related) I'm interested in them and I'd love to learn SQL but I can't even think of a use case…

SQL queries tend to be much smaller than their equivalent data-structure traversal procedures. This can be beneficial even when you still want the data in your process's address space, hence embedded database engines like sqlite. Libraries like Linq can also provide the same expressive power over a programming language's native objects and collections. As to why you'd want a separate DB server process: long lived mut…

hmm, it seems to map to my workflow with Clojure lately. But there I'm massaging and generating new data sets (even though it's statless) but I can see that if you have a very settled data format then this would work in a language agnostic data-interface kind of way. I could see like measurement/time series data being stored in SQL and accessed that way would be much cleaner than opening and closing CSV files for all sorts of datasets

Re: SQLite Is Serverless

#106

> Of those that are serverless, SQLite is the only one known to this author that allows multiple applications to access the same database at the same time. IIRC, MS Access allowed that, which explained a lot of its popularity.

It did allow it but getting it running reliably was basically getting punched in the face on a daily basis. Act! Was similar except they included getting kicked in the balls two to three times a week. The reason access was popular was it made any middle manager that could wield an Excel spreadsheet think they could build a database.

I have a sales guy buddy with a 50K contact database in Act! that runs a Win95 VM to maintain access to this data. I've tried to figure out how to migrate it, but it is more than a few hours and who has that kind of time?

Re: SQLite Is Serverless

#107
post #91

It does allow multiple applications to access the same database at the same time, but when you do so it really hurts performance. I noticed this when i wrote a web crawler in go and used sqlite as the backend. As soon as i connect using the command line interface, it slows down significantly. Just something to bear in mind if you want to use it with multiple processes!

Presumably multiple readers are fine, with only multiple writers being an issue?

I vaguely recall trying to use multiple threads to write to an SQLite DB some years ago, and I think it actually locked the entire file for writes. I might remembering wrongly, but I think I switched to reader/writer locks in c# instead, and seeing a huge perf boost.

Re: SQLite Is Serverless

#108
post #84

Earlier quoted context omitted.

If you do find the link could you please share it here. I think I've been hit by it once before. Also, it's comparatively simpler than other DBMS's like Postgres or MySQL.

Link: https://www.sqlite.org/howtocorrupt.html Discussion: https://news.ycombinator.com/item?id=22098832

Thanks. Useful information.

But I've been copying after taking a shared lock on the sqlite db and I think that's supported as mentioned on https://www.sqlite.org/backup.html.

The online backup API is nice but it has to be done in-process or through a dedicated application. While the lock and file copy is very easy to do using whatever shell the OS provides.

Re: SQLite Is Serverless

#109
post #95

> Of those that are serverless, SQLite is the only one known to this author that allows multiple applications to access the same database at the same time. IIRC, MS Access allowed that, which explained a lot of its popularity.

MS Access “allowed” it but depending on the version it could be quite problematic. We had a use case where Tableau connected to an Access file read only (but which another program used as a data store and wrote to it often) on an Windows file share, and once in a while the lock files would get screwy and we would have to manually delete the lock files to get things working again. Deleting lock files could be a huge c…

Yeah, Access' Jet Engine and many of its issues are very well known.

[https://en.wikipedia.org/wiki/Microsoft_Jet_Database_Engine]

Re: SQLite Is Serverless

#110
post #95

> Of those that are serverless, SQLite is the only one known to this author that allows multiple applications to access the same database at the same time. IIRC, MS Access allowed that, which explained a lot of its popularity.

MS Access “allowed” it but depending on the version it could be quite problematic. We had a use case where Tableau connected to an Access file read only (but which another program used as a data store and wrote to it often) on an Windows file share, and once in a while the lock files would get screwy and we would have to manually delete the lock files to get things working again. Deleting lock files could be a huge c…

> Access is really meant for single-user scenarios

In a lot of cases, I've found it to be the best tool for a temporary or one-off (preferably smaller scale) data mining/massaging project. The query-building interface was the way I originally learned the basics of relational databases, and it also helped me get a better grasp of SQL-- the ability to flip back & forth from the GUI query builder to the SQL it generates is nice.

On the multiuser side, however, I have found a couple workarounds in the past. If you have everyone operate locally and space out their central database connections to intermittent, automated burst queries, you can get more concurrent users than you might expect. It helps to have fewer users per table, as well, and of course it really helps if they don't need to see the most recent adds/changes in real time.

Post reply on HN