SQLite – The “server-process-edition” branch
sqlite.org
sqlite.org
https://news.ycombinator.com/item?id=12739771
quinthar posted in quite a lot of detail there as well, so it may provide some context.
Not when you have potentially neatly 3TB of memory cache.
Of course it all depends on the dataset.
The BBU protects from power loss of the HDs, but not power loss or general failure of the mainboard or any other important component.
PAlso BBUs can run out of battery so a flash backed BBU is generally recommended.
Conversely, why would you choose one of those alternatives?
(I don't actually think there aren't any reasons to do so, mind you, but I can well imagine that if you really KISS, well - even at impressive sizes sqlite makes sense).
But, that's what this branch is supposed to be for. So now the reason is: "because you need multiple concurrent data writers from multiple processes." And it might also be "you need multiple concurrent data writers and care about your data enough to not risk loss in the event of a system crash or power failure" since it uses PRAGMA synchronous=OFF.
Don't let the "Lite" fool you. Depending on your needs, you can scale to 10s of thousand of users using just SQLite. Or not! It is all about knowing your system and properly evaluating your options. I choose to use SQLite because it often fits the use case of small to medium projects the best.
FWIW I use sqlite for a personal wiki, i.e. a website with exactly one user :)
SQL (S Q L or sequel, your call) - ite
So it does sound like the name of a mineral: bauxite, boehmite, hematite, etc. Heck, kryptonite :D
> Hm, like a mineral. Were you playing on the word "light", or were you just playing on mineral...?
> Richard Hipp:
> I was, I was.
It's pronounced as a mineral. It's still a pun on "light". And an obvious one, given what SQLite is compared to other RDBMSes.
On the other hand, if you need every ounce of performance and do not care so much about data resiliency on disk, then the other sql applications will be too much hassle to configure in a way you do not miss any of the many safeguards to save data they ship with by default, which will kill your performance when you least expect.
[0] http://www.oracle.com/technetwork/database/database-technolo...
But think about it as a library, you can build master-slave on top of it.
Which is basically what I did with https://redisql.com/ in the pro version exploiting Redis AOF
Seriously, as impressive as SQLite is for what it is, people shouldn't be given the impression that it doesn't come with some massive and often surprising caveats when viewed as a general purpose database.
Also, it has 64-bit integers - https://www.sqlite.org/datatype3.html
As for what most concerned me most when using SQLite was the ease of which it would happily allow me to make broken queries and not raise a fuss, e.g. referencing non-GROUP BYed terms in an aggregation.
Can you provide example(s) of the broken query with non-GROUP BY columns in an aggregation? (Or a reference link if this is well known - I've searched briefly but can't find anything.)
Select user.id, user.name, sum(tx.amount) from user inner join txn on (user.id = txn.uid) group by user.id
User.name is not in the group by list so it is picked arbitrarily from the rows in the group. It's harmless here but not in all cases.
But hell yes, tools should warn you about this loudly, as it's not generally correct.
Is there any reason why it is not incorporated into the main branch and activated by compile time flags? Just complexity?
https://sqlite.org/src/timeline?r=server-process-edition
looks active.
I would hesitate to integrate such a feature into mainline prematurely. If you really need it you can use the branch.
First off, it is not a single instance, but many sqlite databases. Many wich has 20+ TiBs of data.
For the last 10+ years I have worked at a backup company and we had gone threw some iterations of storage backends, including a inhoues system that fell on its face. So far the only thing that has been able to keep up with our demands has been Sqlite, although there have been some hurdles.
Because of how we want isolation between users having any sort of shared database system really is not a option. And in the early days our users liked the idea of simply copying a users dataset and sending it some place else.
In any case we tested, I should say a guy named Brain on our team tested many different systems and ended up picking Sqlite many years ago. It has stuck and served us very very well. It was not until we wanted to access the data in different ways that we ran into concurrency issues and made a few weird decisions on how to access the data to avoid some of these problems.
These databases store the volume data for each volume we back up. And because it is a database we can track the blocks in such a way that allows us to present a consistent view of each backup in time. And it has been good enough to be able to export volumes as iscsi luns (custom iscsi server I wrote to interface when the backend), and in turn allow us to virtualize peoples systems we backed up on the fly without moving data from one format to another.
Now that I think about it ~7PB is only half of it, that is just the data we have managed by our hardware. We have many other people storing just as much if not more on their systems.
Looking on my original comment it may seem like I implied that we have a single 7PB database, but no, it is 1000s of smaller ones between 8 and 30TiB in most cases.
Have we had data loss? yes, but it was mostly to improperly using sqlite. Except one occasion which we were sure it was sqlite itself, which I am sure Mr. Hipp will refute :p, but I forget the details and a fix was applied quickly.
Sqlite is nice, and I would recommend it to anybody for just about any use, even uses you might have not considered for a embedded database.
This has worked fine, but I don't think it is optimal. I think we might get some performance increases if we just used seqlite for keeping block offsets into a flat file. But then there are a bunch of other problems to solve.
Data is compressed, do we would have to handle free hole allocations for variable sized data. Or simply waste free space. Not that sqlite does does any better with those things, just things we would have to solve in general.
Why use a database if you only have one process?
It's also useful to point out that SQLite can have many reader processes. The single-process limit is only on writes.
Indexing any columns you want in one line of code is also very nice.
I read this as: retry logic required. That's a bit onerous IMO. Wrapping a single writer in a mutex gives near rw=1 performance in the cases I tested.
(a) Does this mean that there will be an sqlite version that can be deployed as a process accessible over network in servers?
(b) Does this mean that sqlite will now have the capability to do concurrent reads/writes, but that it is upto users to implement a process that can take advantage of this and create something like (a)?
No.
> (b) Does this mean that sqlite will now have the capability to do concurrent reads/writes, but that it is upto users to implement a process that can take advantage of this and create something like (a)?
Yes... this allows a multi-threaded application for example to have multiple readers/writers without blocking each other.
This appears to be a means to run Sqlite in a server environment with multiple processes hitting it.
What you linked is just some Lua based extension that has little todo with Sqlite performance on certain types of infrastructure.