News for hackers. Stuff that matters.
Re:Sqlite 3.30.0 by hardwaresofton on Friday October 04, 2019 @11:18PM (#21163614)
Glad to see SQLite on then front page -- it's one of the silent workhorses of the modern programming/database world. It is the most widely deployed database[0]. If you haven't given it a look/aren't interested in it since it seems to be a "toy" database (often the "test" or "local" db for frameworks like rails or django), you owe it to yourself to see what it can really do. Easy to use full text search[1][2], CTEs[3], JSON support via extension[4] (also the extension system is worth looking at[5]) and much much more. There are certainly things that SQLite does not do, and that's well documented too[6].

If all this doesn't convince you to use SQLite, it's also one of the most well documented large C codebases that is fantastic to learn from.

I'd go as far as to say that many modern startups could get pretty far with SQLite + aggressive caching before even bringing in a big database like Postgres (though with recent deployment/ops advancements it's easier than ever to run postgres).

[0]: https://sqlite.org/mostdeployed.html

[1]: https://www.sqlite.org/fts5.html

[2]: https://sqlite.org/fts3.html

[3]: https://sqlite.org/lang_with.html

[4]: https://www.sqlite.org/json1.html

[5]: https://www.sqlite.org/loadext.html

[6]: https://www.sqlite.org/whentouse.html

Re:Sqlite 3.30.0 by kragen on Saturday October 05, 2019 @12:57AM (#21163893)
I only learned this week that it supports recursive CTEs (although apparently you can't refer to them in subqueries yet?) and only yesterday that you can do this:

    >>> import sqlite3
    >>> con = sqlite3.connect(':memory:')
    >>> cur = con.cursor()
    >>> q = '''select x, sum(a * power(x, e))
    ... from (select -2 as x union select -1 union select 0 union select 1 union select 2) xt,
    ... (select 1 as a, 2 as e union select 4, 1 union select 2, 0) et
    ... group by x'''
    >>> cur.execute(q).fetchall()
    Traceback (most recent call last):
      File "<stdin>", line 4, in <module>
    sqlite3.OperationalError: no such function: power
    >>> con.create_function('power', 2, lambda base, power: base**power)
    >>> cur.execute(q).fetchall()
    [(-2, -2), (-1, -1), (0, 2), (1, 7), (2, 14)]
That is freaking cool. Not evaluating polynomials in SQL, I mean, but defining a user-defined function for SQL in one line of Python.
Re:Sqlite 3.30.0 by emj on Saturday October 05, 2019 @05:12AM (#21164541)
That is cool; Being able to call python code from SQL is very cool. Is it very slow?
Re:Sqlite 3.30.0 by oefrha on Saturday October 05, 2019 @09:52AM (#21165483)
It simply uses the sqlite3_create_function API, so it’s as fast/slow as your Python function. You can even use Cython if pure Python isn’t fast enough. I use UDFs quite a bit and the performance is fine without extra tweaks most of the time, but for something like pow I’d use the math extension instead which would be way more performant.

Btw, user-defined scalar functions aren’t remotely as sexy as user-defined window functions.

Re:Sqlite 3.30.0 by sevensor on Saturday October 05, 2019 @11:15AM (#21165967)
Beware that only recent versions of Python have a sqlite3 recent enough to support window functions. This bit me recently; I had to scrap a prototype, pull all the data out, and use numpy instead. Still, in general, SQLite3 is amazing and it's my automatic first choice when working with 100GiB or less.
Re:Sqlite 3.30.0 by oefrha on Saturday October 05, 2019 @11:30AM (#21166060)
Python links to sqlite3 dynamically so you just need to sub in a more recent sqlite3 (>=3.25.0). I don’t think it has anything to do with the Python version.
Re:Sqlite 3.30.0 by kyberias on Saturday October 05, 2019 @07:25AM (#21164942)
Being able to call python code from SQL is super scary!
Re:Sqlite 3.30.0 by sbierwagen on Saturday October 05, 2019 @12:04PM (#21166245)
What attacks do you believe it enables?
Re:Sqlite 3.30.0 by kragen on Saturday October 05, 2019 @06:53PM (#21168513)
I haven't benchmarked it.
Re:Sqlite 3.30.0 by saagarjha on Saturday October 05, 2019 @03:04AM (#21164190)
> If you haven't given it a look/aren't interested in it since it seems to be a "toy" database

As you mentioned, it ships in every major browser, most OSes, and a number of extremely popular instances of consumer software. If that's still a "toy" I don't know what isn't…

Re:Sqlite 3.30.0 by beatgammit on Saturday October 05, 2019 @09:39AM (#21165427)
We used SQLite for a while until we were limited by IO on our crappy SD cards for our embedded product and wanted a database server with more tuning options. Before that point, it was a very capable database, she I wouldn't hesitate to use it for pretty much any product that doesn't need high performance, cross thread access (basically any crud app) or the ability to run in a cluster/dedicated server (e.g. high storage requirements).

It's fast, simple, and easy. Perhaps my favorite feature is that backups are just a copy (in fact, when I'm debugging an app, I often copy the database into a temp directory and go to town).

I totally agree that SQLite is a great first option for startups. If your database will fit on your filesystem (gigabytes, not terabytes), it'll probably do really well. It's really easy to switch to something like Postgres later, and it's really nice to not have to worry about the complexities of a database server until you actually need them (e.g. you're considering hiring dedicated IT/DBA staff instead of just developers). And there's a good chance you'll never need anything other than SQLite.

Re:Sqlite 3.30.0 by siscia on Saturday October 05, 2019 @03:41AM (#21164269)
Indeed, I believe as well that SQLite is underused in a lot of situations.

Which is mostly the reason why I created RediSQL[1], to allow a more widespread use of it also in "modern"/"cloud native" application where you want to just connect to a database via the network, ideally through common API like the Redis one.

It has the great benefit, that if you create your database in memory is crazy fast, and it retains the persistency properties of Redis, which are good enough in most cases.

[1] https://RediSQL.com

Re:Sqlite 3.30.0 by jeff_redradish on Saturday October 05, 2019 @06:30AM (#21164782)
Just FYI, on Chrome a 'Subscribe to the mail list' pop-up appears, and cannot be dismissed by clicking the X. Hitting Escape works.
Re:Sqlite 3.30.0 by siscia on Saturday October 05, 2019 @06:36AM (#21164805)
Thanks so much!

Sorry for the annoyance!

Re:Sqlite 3.30.0 by philips on Saturday October 05, 2019 @09:29AM (#21165377)
Safari on iPadOS as well.
Re:Sqlite 3.30.0 by steve_adams_86 on Saturday October 05, 2019 @01:31AM (#21163993)
Checkfront, a booking management system, got by on sqlite up until maybe 2 years ago - it was the solution for 5 or more years! These days it runs on postgres but it went very far without it.
Re:Sqlite 3.30.0 by ngrilly on Saturday October 05, 2019 @03:48AM (#21164289)
> I'd go as far as to say that many modern startups could get pretty far with SQLite + aggressive caching before even bringing in a big database like Postgres

Modern startups need their services to be available, and this is difficult to achieve with SQLite because you can't run long database migrations without blocking writes during the migration. Personally, I'd use SQLite more often if there was a good solution to this (and also DROP COLUMN).

Re:Sqlite 3.30.0 by hardwaresofton on Saturday October 05, 2019 @04:22AM (#21164382)
My statement was definitely a reach, but I think there is a bunch of space in the life of an early startup for lack of highly available services. I've found startups to prioritize time-to-market (or time to PoC) over technical purity -- there's usually lots of unplanned outages early on that often have nothing to do with the database or are a result of bad application code/misunderstood requirements as well, so I'm not fully buying the availability emphasis, but a few things that I think could counteract it:

- I'm not sure I agree that the delay of the blocking write from a migration is so long as to cause significant (if any) damage to the business.

- If SQLite makes development and deployment easier (I think it does), this becomes a tradeoff between a deployment downtime/partial operation window likely on the order of milliseconds and hours of time spent setting up/managing the alternatives. With really robust systems like Postgres out there this is a pretty weak argument on my part, but there is at least something there.

- As I've also mentioned elsewhere, a high read-to-write workload would be less affected by this problem. If your startup produces aggregated business analytics dashboards for manufacturing plant stakeholders for example, your data set could be completely static.

- WAL mode[0] improves SQLite's resiliency to concurrent readers/writers.

- In the extreme case, you could treat SQLite as a hybrid row & JSON document store, and manage your own schemas (I do not endorse this approach), but you'd still be saving some time because you can do stuff like make use of SQLite's FTS search features, and you'd have access to other relational features that you might not get with other document stores.

All this said, SQLite is not for lots of concurrent writers, and they so themselves[1], but I think it can absolutely be done. More to the point, I think that SQLite can help you get something out and easily deployable, and is not hard to move off of later.

[0]: https://sqlite.org/wal.html

[1]: https://www.sqlite.org/whentouse.html

Re:Sqlite 3.30.0 by shantly on Saturday October 05, 2019 @08:21AM (#21165099)
> My statement was definitely a reach, but I think there is a bunch of space in the life of an early startup for lack of highly available services.

I think there's room for a lot fewer 9s for most businesses generally, provided you have enough isolation that one thing being down doesn't also take down everything else. The exceptions are mainly ones that are trying to be someone else's infrastructure.

For lots of businesses, especially early on, maintenance windows are entirely fine and perfect bigco rolling deploys to giant HA clusters and such are way overkill that introduce all kinds of costs and complexity (=risk) that could be avoided by just accepting that every now and then some part of your site/service will be down. Just have backups, know how to restore from them quickly, and make sure you have scripted from-scratch deployments that actually work (having developers build them daily or weekly for their own local work does a pretty decent job of sussing out brokenness) and you're probably fine.

[EDIT] but of course that's the opposite of Résumé Driven Development and is very Not Cool and likely to be unpopular with clueless managers.

manager: "Why's our site down?"

you: "a deployment broke, it's fine, we can restore from scratch in ten minutes flat if we have to."

versus, also you: "as you know we follow Google's best practices and use Kubernetes and blah blah blah and you see [translated from Bullshit Speak] we don't actually understand it very well and it's super complex and it shit the bed for some reason but we're fixing it, and as you know this is all best practices and Google like and such as"

Unfortunately the latter is often "safer" than the former... for one's career, not for the product or service you're providing.

Re:Sqlite 3.30.0 by ngrilly on Saturday October 05, 2019 @08:29AM (#21165130)
I can see what you mean, but most startups try to have users as early as possible, to demonstrate traction. Most also practice continuous deployment. In the early stage, a lot of refactoring usually happens, which often requires database migrations. If we are afraid to refactor our database because our service may be unavailable and disappoint our early adopters, then we lose velocity and peace of mind. A tool like PostgreSQL solves this, with a small admin overhead compared to SQLite.

And the admin overhead can be reduced by using a managed service (Amazon RDS, Google Cloud SQL, Digital Ocean Managed Databases, etc.). With a managed service, we can even go serverless for the rest of the app. With SQLite, we have to closely manage and backup our server since the data are stored on it.

> I'm not sure I agree that the delay of the blocking write from a migration is so long as to cause significant (if any) damage to the business.

I agree that most migrations, in the early stage of a project, run for a few seconds to a few minutes maximum. But in my experience that's usually enough to be noticeable by our users.

> If SQLite makes development and deployment easier (I think it does)

I agree. That's why I use it sometimes :)

On the same topic, about the “server-process-edition” branch of SQLite: https://news.ycombinator.com/item?id=17766799

Re:Sqlite 3.30.0 by dmarlow on Saturday October 05, 2019 @12:05AM (#21163737)
I only wish I could do some basic things without having to create temporary tables and copy data around.
Re:Sqlite 3.30.0 by hardwaresofton on Saturday October 05, 2019 @01:17AM (#21163949)
I'm not sure exactly what the use case is but another awesome tool that's recently been making the rounds is datasette[0], it provides an easy to use data exploration point for SQLite databases. There's also a PyCon 2019 talk[1].

[0]: https://datasette.readthedocs.io/en/stable

[1]: https://www.youtube.com/watch?v=pTr1uLQTJNE

Re:Sqlite 3.30.0 by gigatexal on Saturday October 05, 2019 @12:22AM (#21163789)
Yeah that’s likely the one thing that keeps it from being perfect.
Re:Sqlite 3.30.0 by dmarlow on Friday October 04, 2019 @11:38PM (#21163664)
Apparently clustering too

https://github.com/rqlite/rqlite

Re:Sqlite 3.30.0 by minxomat on Friday October 04, 2019 @11:56PM (#21163711)
Hardly, that is more of a hack. There is however a distributed, clustered version of sqlite: Bloomberg's Comdb2. It has the same scaling factors as e.g. percona, can be Geo-replicated (multi-roomed) and has many advanced timing and financial data types. Plus SQL functions can be written in Lua. Oh, and it has super granular serialization guarantees, up to and including full linearizibility.

By using Sqlite as the SQL frontend, it retains features other NewSQL engines struggle with (recursive CTE, deep optimization, compatibility with existing queries etc)

Re:Sqlite 3.30.0 by e12e on Saturday October 05, 2019 @06:55AM (#21164852)
Wow, thats: https://github.com/bloomberg/comdb2

Looks interesting. Any experience using it in real projects?

Re:Sqlite 3.30.0 by minxomat on Saturday October 05, 2019 @07:02AM (#21164876)
Yeah it works well. I also sometimes push code into the db for faster execution (sorry on mobile, can't detail now).

Haven't tested out Geo replication though, but it's pretty straightforward. Clock drift maximum and all that.

Re:Sqlite 3.30.0 by hardwaresofton on Saturday October 05, 2019 @01:02AM (#21163906)
Also there is dqlite[0]. I really do think that SQLite can go even farther than people think, but the exploration makes less and less sense the better and easier to run options like postgres become. That said, I'm glad projects like dqlite and rqlite exist.

There are also previous threads discussing them but here's one[1].

[0]: https://github.com/CanonicalLtd/dqlite

[1]: https://news.ycombinator.com/item?id=20836331

Re:Sqlite 3.30.0 by speedplane on Saturday October 05, 2019 @01:10AM (#21163929)
> I really do think that SQLite can go even farther than people think

I know different databases support different features (e.g., atomic transactions, ACID compliance, etc.), but it seems like the big differentiator is size, namely:

1. Can your database live within a single computer's RAM?

2. Can your database live within a single computer?

3. Can your database live across a cluster of computers in a single data center?

4. Can your database live across a cluster of computers spread across the planet?

Once you pick your category from the above, there are still choices to be made, but the "best" options narrow down significantly.

Re:Sqlite 3.30.0 by hardwaresofton on Saturday October 05, 2019 @01:28AM (#21163982)
I'd argue that feature set (transactions, ACID, etc) are a bigger differentiator because they drive/change application development -- this can have drastic effects on application features and complexity whether immediately or down the road.

I agree that the possible second biggest (if not the first) differentiator is size though -- despite the amount of choices out there, once you start narrowing down answering those questions, many options fall away very quickly.

I'd also add on that the only real way to scale a database is to shard. There are a bunch of tricks you can do to improve throughput and those are always welcome, and sometimes I'll see articles that proclaim "we just changed to a system with 256GB of RAM to fix our scaling problem!" -- but these improvements don't get past the basic premise that once your data does not fit on one computer/harddrive you need to start figuring out a way for multiple to coordinate. You need to shard, and you need to organize your data in such a way that it can shard, then you need to start worrying about data access patterns. There's a lot of space before something like this is necessary (you really do have to have a lot of data for it to not fit on one machine these days), but I think people don't see this chain coming fast/often enough.

Re:Sqlite 3.30.0 by speedplane on Saturday October 05, 2019 @01:48AM (#21164027)
> I'd argue that feature set (transactions, ACID, etc) are a bigger differentiator because they drive/change application development

Handling atomic transactions or ACID on a single computer is a completely different problem from dealing with them across multiple, and still a different problem from dealing with them across datacenters. I'd argue that the size of your data is the first question you need to ask, only then you can figure out if you need/desire these features.

> once your data does not fit on one computer/harddrive you need to start figuring out a way for multiple to coordinate

Going from one computer to two generally more than doubles the complexity of the system. But when done right, going from two computers to two hundred can be easy. However, going from two hundred (in a single datacenter) to ~two thousand (across multiple datacenters) brings its own unique set of challenges.

Picking the database for an app is one of the biggest tech decisions any team can make, certainly more important than the underlying OS, and even potentially more important than choosing a predominant programming language. Even when starting a tiny startup with no initial customers, considering how big about the absolute max you think you your data can grow, and picking a database that can grow with you can save you huge headaches down the road.

Case Study: I started a company on Python 2.7 (fine, but not enlightened decision), a fork of Django that supported NoSQL (bad decision), and an underlying NoSQL database that scaled with no configuration (great decision). In the first year, the database had around a gigabyte of data, so NoSQL was definitely overkill. But now, it's over 100 Terabytes, with auto replication making it much larger than that. Changing the Django middleware or even the Python language to 3.x will be difficult, but not impossible. Moving the database is far more terrifying, a non-starter.

Re:Sqlite 3.30.0 by e12e on Saturday October 05, 2019 @06:57AM (#21164856)
Which nosql system did you pick?
Re:Sqlite 3.30.0 by speedplane on Sunday October 06, 2019 @03:04AM (#21170328)
> Which nosql system did you pick?

I used Google's NoSQL datastore database. It's generally worked well for me, and has scaled from 1GB to 100TB incredibly well, it feels like magic. But I made the decision to go with it years ago. If I were starting from scratch today, I'd want to do a lot more research before endorsing it.

Re:Sqlite 3.30.0 by ngrilly on Saturday October 05, 2019 @03:52AM (#21164299)
Another big factor you don't mention is concurrency. SQLite is single writer/multiple readers, unlike PostgreSQL which supports multiple concurrent writers. This makes hard to run database migrations without blocking writes during the migration, which is an issue for most services requiring availability.
Re:Sqlite 3.30.0 by Scarbutt on Saturday October 05, 2019 @01:48AM (#21164029)
But why?(for a server)

Postgres can run in a 256MB VPS(if one can find one these days) and has more features that you might need later.

Installing is as easy as 'apt-get install postgresql', create user, create database, done.

Re:Sqlite 3.30.0 by throwaway_bad on Saturday October 05, 2019 @02:58AM (#21164183)
I have a small blog (using Ghost) that uses sqlite as the main database and it's incredibly easy to maintain. It's just a single file. For example if you want to back up, you just copy the file or add it to git. If you want to do a diff you just do sqldiff on two files. It is as easy as working with json or csv files, except with atomic writes and better querying.

From their site: https://www.sqlite.org/whentouse.html

>SQLite does not compete with client/server databases. SQLite competes with fopen().

Re:Sqlite 3.30.0 by majewsky on Saturday October 05, 2019 @07:04AM (#21164878)
> For example if you want to back up, you just copy the file or add it to git. If you want to do a diff you just do sqldiff on two files.

With Postgres, you run pg_dump on the database (which is a shell one-liner, only with slightly more arguments than cp) and that's even better for putting into git because it's a text file that git can diff natively and store efficiently with delta compression.

Re:Sqlite 3.30.0 by hardwaresofton on Saturday October 05, 2019 @02:31AM (#21164135)
SQLite is even easier to start with -- I'm not trying to say Postgres is not the right choice, but it is certainly a more complex choice.

Postgres is a fantastic database, but most of the time getting started with and using SQLite will be easier. For example -- you'd never have to secure firewall rules to a SQLite instance. Bad defaults (unlikely but possible) or some bad post-install configuration and you've got an exposed server.

I want to emphasize that my point about SQLite being viable for startups was with the assumption of a low-write high read workload -- most of the time queries won't even hit the DB but instead be served by some caching layer. It's also really easy to scale read only versions of your applications horizontally if all you've got to do is ship/swap out DB files (again at this point it might make more sense to look into a bigger DB and just scaling vertically).

Re:Sqlite 3.30.0 by xyzzy_plugh on Saturday October 05, 2019 @02:08AM (#21164069)
Furthermore, postgres has great replication, and a read-replica is trivial to set up. sqlite is amazing (for any embedded database, absolutely) but postgres can't be beat as a go to for server side.
Re:Sqlite 3.30.0 by cyphar on Saturday October 05, 2019 @06:30AM (#21164783)
To paraphrase the SQLite site: "SQLite isn't competing with [PostgreSQL]; it's competing with fopen(3)."

The primary purpose is to replace custom (and fragile) single-file databases with something that is far more resilient and provides uniformity in implementation. The fact that it is a suprisingly good SQL database (to the point where folks are actively arguing that much more fully-fledged databases are better in some aspects) is incidental.

Re:Sqlite 3.30.0 by netol on Saturday October 05, 2019 @03:44AM (#21164277)
There is no real reason to use sqlite in web apps. Just use postgres and mysql, that's the the industry standard and you'll have less issues
Re:Sqlite 3.30.0 by gunnihinn on Saturday October 05, 2019 @08:45AM (#21165195)
Fewer.
Re:Sqlite 3.30.0 by erik_seaberg on Saturday October 05, 2019 @03:23AM (#21164237)
sqlite can be handy but it's not a substitute for testing against a staging instance of another database platform. It ignores a lot of mistakes in column types and size limits and sometimes even foreign keys. If anything, I would want tests to be more strict than prod.
Re:Sqlite 3.30.0 by hardwaresofton on Saturday October 05, 2019 @03:38AM (#21164265)
Your point is correct, but I'm afraid you might not have understood what I meant -- I meant that people should be considering using SQLite in production.

Agreed that testing against copies of production or staging instances that are as close as possible to production is important, but what I'm suggesting is that you could ride SQLite all the way into production if you wanted to.

I'd love to hear more about the ignoring column types/size limit/other issues that you've run into though, have you written about them anywhere or is there an SO post? I haven't run into anything super egregious though I've had some problems with FKs before.

Re:Sqlite 3.30.0 by ris on Saturday October 05, 2019 @11:35AM (#21166094)
Do a GROUP BY, and then try referencing a term which hasn't been either aggregated or mentioned in the GROUP BY clause. The result should be "abort! this query can't make sense!". The result (last I tried) is instead "sure, here's some arbitrary value from this group".
Re:Sqlite 3.30.0 by justinclift on Saturday October 05, 2019 @04:44AM (#21164440)
Foreign keys are supported with SQLite version 3.6.19 onward (~late 2009), though not enabled by default.

https://sqlite.org/foreignkeys.html

If you can add "PRAGMA foreign_keys = ON;" to your testing script SQL calls - somewhere soon after connecting to SQLite - that enables it.

Re:Sqlite 3.30.0 by marmaduke on Saturday October 05, 2019 @03:41AM (#21164271)
It seeks to replace fopen() not postgres.
Re:Sqlite 3.30.0 by bob1029 on Saturday October 05, 2019 @10:29AM (#21165683)
I am glad to see other SQLite advocates out here.

>Many modern startups could get pretty far with SQLite + aggressive caching

Not only did we get "pretty far", we got to what is effectively a final destination for this generation of our product. We don't even need "aggressive caching" beyond what the filesystem provides to us by way of accessing the SQLite db file.

Today, we have a single SQLite database persisting stateful data for an application that is used concurrently by 100+ users. I have benchmarked 512KB state update writes in a multithreaded scenario at >500 per second. 64KB updates exceed 1000 per second. It took us a lot of time and understanding to get to this point. At the end of the day with SQLite, less is always more. The first attempts we did involved connection pools, queues and all kinds of other fancy over-engineering in an attempt to extract more performance. We finally ended up with just the following:

- Enable Write Ahead Logging

- Set Synchronous to Normal

- Use a single SQLiteConnection

Justification for a single connection: We are using .NET with application-level locking and an RWLS where appropriate. This is in contrast to relying on the database to push these transactional scopes to disk. For us, losing an in-flight transaction tracked in memory is not catastrophic so we can tolerate this 1-100ms danger zone for the huge upside we get in throughput. This is a great example of something you can only do with SQLite. No hosted database solution offers this degree of exclusivity over your data store from an application perspective.

One other application note to keep in mind is that SQLite (by default) operates in serialized mode, so the above approach is consistent regardless of the fact that we are hitting a single connection from multiple threads at once. The usages of RWLS are required in our case simply because we need to do multiple dependent sequential operations (select+modify+update) or insertion of new items (insert+last insert row id from connection). It is hypothetically possible to avoid locking altogether (aside from the implicit SQLite serialization) if you can structure your database such that you perform all operations in a single command - E.g.: Use application-generated keys upon insertion rather than waiting for the DB to generate one.

Also, backups and restores are super trivial as mentioned elsewhere in this discussion. I have considered writing a backup agent directly into our software that is transactionally-aware. E.g.: During a backup request, I can take out a write lock on the RWLS for the SQLiteConnection while copying the database to a backup destination. Alternatively, since the DB lives on the same machine as the application, you can just take a single VM snapshot throughout the day, but this won't be as consistent a backup (tolerable for our use case though).

The biggest advantage we see with using SQLite as our principal data store is that it has allowed us to completely avoid operational annoyances regarding how we actually ship our stack to various environments. .NET Self-Contained Deployments + SQLite = one bin folder that "just works". We were able to build custom deployment tooling because of the simplicity of this model, rather than relying on off-the-shelf tech that doesn't quite fit 100% into our use case.

Re:Sqlite 3.30.0 by asdkhadsj on Saturday October 05, 2019 @10:38AM (#21165755)
Recently I heard[1] that SQLite does not offer concurrent access safety. That is to say, the premise was that if you were to use it as a database backing something multi user, like a forum, SQLite would suffer due to the concurrent access of users against the DB.

While I've not had time to research it yet, I'd be curious on your (or anyones) knowledge / experience in this context.

My plan, if SQLite didn't offer concurrent access safety, was simply to put concurrent primitives around SQLite to ensure safety. However I'm not doing anything until I can make heads or tails of that original comment[1].

Thoughts?

[1]: https://news.ycombinator.com/item?id=21041433

Re:Sqlite 3.30.0 by thijsvandien on Saturday October 05, 2019 @12:44PM (#21166480)
I don’t have much experience with this, but I’ve been reading a bit about it last days. As far as I can tell:

- Concurrent reading has always been possible.

- Reading while writing is possible when the relatively new WAL mode is enabled, at no significant cost.

- Writing still results in a lock, and other writers can decide how long they’re willing to wait on it.

Re:Sqlite 3.30.0 by meddlepal on Saturday October 05, 2019 @11:08AM (#21165930)
Why not just devise a test rather than waiting for someone to hand you the answer? It's not a hard thing to simulate...
Re:Sqlite 3.30.0 by asdkhadsj on Saturday October 05, 2019 @01:15PM (#21166685)
I'm not expecting someone to hand me an answer. I was merely asking for experiences in this area. You think I'm going to rely merely on internet stranger to decide course of action on production systems?

God forbid I ask for experiences from people who seem seasoned in this area on Hacker News of all places. The gall I must have, right?

Re:Sqlite 3.30.0 by porker on Saturday October 05, 2019 @03:32PM (#21167441)
What is RWLS in this context please?
Re:Sqlite 3.30.0 by bob1029 on Saturday October 05, 2019 @05:13PM (#21167999)