News for hackers. Stuff that matters.
Re:There are only four billion floats, so test them all (2014) by ChuckMcM on Sunday October 11, 2020 @01:40PM (#24747555)
I love this.

This is another in the "Now that we have computers with gazillions of bits of RAM and many cores and gazillions of cycles, what conventional wisdom is no longer wise?" series :-).

I suggested to a client that they use Sqlite3 for their company database rather than a disk based database. And they looked at me shocked, as if I had spoken heresy. I pointed out how many records they could store on a 64GB machine and that is a small data center class machine and it sort of boggled their mind. Add read-only copies, shared from a NAS device gave them perfect scalability in terms of queries per second (their sales folks had their own database that they were updating). It was fun to watch their expression go from horror to wonder to excitement when they finally implemented it.

Re:There are only four billion floats, so test them all (2014) by michaelmcmillan on Sunday October 11, 2020 @01:59PM (#24747686)
Yup! I'm currently running a b2c solution for a client that's grossing ~$3 million/year using Python + sqlite3 behind nginx.

I work for another shop that scolds me for even suggesting using something else than k8s. How can a persistent file system possibly scale? Lol. Ironically they're grossing -$3 million/year.

Re:There are only four billion floats, so test them all (2014) by tonetheman on Sunday October 11, 2020 @03:47PM (#24748508)
I am curious about your case is the traffic mostly read heavy? Ha wish you could share more. Interesting stuff.
Re:There are only four billion floats, so test them all (2014) by svnpenn on Sunday October 11, 2020 @02:33PM (#24747943)
> I suggested to a client that they use Sqlite3 for their company database rather than a disk based database.

Sqlite is a disk based database...

Re:There are only four billion floats, so test them all (2014) by capableweb on Sunday October 11, 2020 @03:03PM (#24748169)
Well, maybe not "disk based" per se. It can be stored on disk, yeah. But it can also run in memory. I think in this case it's clear that ChuckMcM meant a machine with 64GB of RAM (not disk space), therefore they are talking about having SQLite running in memory, not on disk.
Re:There are only four billion floats, so test them all (2014) by sillysaurusx on Sunday October 11, 2020 @08:07PM (#24750219)
Even if a DB is disk-based, you can throw it in a ramdisk to get the same speedups, often. I would be curious to know if there are any drawbacks or dangers from doing that, apart from the obvious “if your box powers off, the ramdisk is gone” and “each time the box restarts, you have to copy the db to the ramdisk.”

The main problem I was uneasy about was, I would simply use the equivalent of rsync -Pa /ramdisk /disk in a loop, which seemed to ensure safety in the event of a poweroff. It never broke, but I wouldn’t say it was a good idea, necessarily.

Sure speeds up most things though. The benefits are pretty crazy for I/O bound programs.

Re:There are only four billion floats, so test them all (2014) by MertsA on Monday October 12, 2020 @07:23AM (#24753305)
>I would simply use the equivalent of rsync -Pa /ramdisk /disk in a loop

That's probably a bad idea. rsync isn't going to copy over writes in the same order they were written by the DB. Most DBs assume that when there's some crash that at least the disk would have been in a logically consistent state with respect to the order of certain writes separated by e.g. fsync and barriers.

Re:There are only four billion floats, so test them all (2014) by AI_WAIFU on Sunday October 11, 2020 @08:22PM (#24750317)
Does anyone know the risk of radiation bit flips in this case? I don't think it's an issue with ecc ram, but if it's not that could be a problem for certain applications.
Re:There are only four billion floats, so test them all (2014) by count on Sunday October 11, 2020 @10:01PM (#24750791)
A friend of mine wrote a 'chaos engineering' tester for this specific issue: http://github.com/enferex/cme

Randomly inject bit flips into a target process memory space, so you can see/test how your software handles it (if at all).

Re:There are only four billion floats, so test them all (2014) by sillysaurusx on Sunday October 11, 2020 @09:15PM (#24750566)
Exactly! I was wondering about that. It seems like it's so rare as not to matter, but that's no guarantee it won't matter.
Re:There are only four billion floats, so test them all (2014) by fomine3 on Wednesday October 14, 2020 @12:00AM (#24772985)
Bit flip is always a risk even if you don't use ram disk.
Re:There are only four billion floats, so test them all (2014) by dmh2000 on Monday October 12, 2020 @12:06AM (#24751286)
'The most common way to force an SQLite database to exist purely in memory is to open the database using the special filename ":memory:".'
Re:There are only four billion floats, so test them all (2014) by dragontamer on Sunday October 11, 2020 @02:21PM (#24747854)
https://yourdatafitsinram.net/

The IBM 53-bit quantum compute result from a ton of hard drives + compute power was also intriguing (https://www.ibm.com/blogs/research/2019/10/on-quantum-suprem...).

128PiB of disk space needed for a 54-qubit computation on their system (hard drives). Fun to see where the supercomputers are still needed, but smaller qubits can be emulated on normal computers. 40 qubit calculations probably can be emulated on a 16TB team of hard drives in RAID0.

Re:There are only four billion floats, so test them all (2014) by kortilla on Sunday October 11, 2020 @02:25PM (#24747895)
The trade-off isn’t really size in a lot of cases though. When stuff is stored in RAM you lose the persistence story.
Re:There are only four billion floats, so test them all (2014) by greggyb on Monday October 12, 2020 @12:58PM (#24756535)
Disk storage for the WAL and periodic checkpoints can get you sub-second recovery targets easily.

Ninja edit: or a UPS and a shutdown procedure triggered by it that writes the database to disk. You can write 100GB in a couple minutes over a 10Gbps network. Faster to a local SSD.

Re:There are only four billion floats, so test them all (2014) by kortilla on Tuesday October 13, 2020 @07:12PM (#24771389)
Sub-second recovery and UPS triggered shutdowns are still nowhere near the reliability of a database ensuring fsync has been called when you call “commit”.

There are just certain classes of data (e.g. any kind of business transaction) where you can’t afford this type of best effort durability.