News for hackers. Stuff that matters.
Re:Smaller is better – The rise, fall, and rise of flat file... by DeathArrow on Sunday May 22, 2022 @01:24PM (#31470552)
A database can be relational, it can make some guarantees, it can pass Acid. With a file you are responsible for performance, reliability, integrity and security of the data.

Do you believe that you can do a better job than those tens of guys who contributed to a DBMS? Go ahead.

Do you not need reliability, integrity, security, performance? Go ahead.

So use a file to store data instead of database but know the trade-offs.

Re:Smaller is better – The rise, fall, and rise of flat file... by throwawayboise on Sunday May 22, 2022 @04:49PM (#31472621)
Yeah, none of that may matter for a "brochure" type of website, or a blog where you are the only person updating it.

As soon as you start processing forms and doing anything transactional based on that, you'll be quickly reinventing a lot of wheels if you aren't using a DBMS of some sort.

Re:Smaller is better – The rise, fall, and rise of flat file... by JumpCrisscross on Sunday May 22, 2022 @05:32PM (#31473009)
> none of that may matter for a "brochure" type of website, or a blog where you are the only person updating it

Doesn't Hacker News run on flat files?

Re:Smaller is better – The rise, fall, and rise of flat file... by randombits0 on Sunday May 22, 2022 @05:29PM (#31472978)
But only the wheels you need, when you need them. Don’t carry the overhead unless needed.
Re:Smaller is better – The rise, fall, and rise of flat file... by lmm on Sunday May 22, 2022 @09:42PM (#31474561)
ACID comes with costs, those guys may be smart but they're not magicians. As a rule of thumb, if you never handle a transaction failure or deadlock with something that is not retrying or failing, you shouldn't be using an ACID-based system since you're not getting any benefit from it.

And if you e.g. have multiple dataflow paths with different priorities then you also probably shouldn't be using a DBMS, because they're too much of a closed world. Using database technology as a library would be a better approach; otherwise sooner or later you'll find you need to customize the internals of your DBMS, and with most extant products that's somewhere between hard and impossible.

Re:Smaller is better – The rise, fall, and rise of flat file... by Kinrany on Monday May 23, 2022 @06:11AM (#31477099)
> As a rule of thumb, if you never handle a transaction failure or deadlock with something that is not retrying or failing, you shouldn't be using an ACID-based system since you're not getting any benefit from it.

Could you expand? Does this mean you wouldn't use an ACID database for CRUD?

Re:Smaller is better – The rise, fall, and rise of flat file... by lmm on Monday May 23, 2022 @07:40PM (#31486212)
Depends how you're interpreting the "U" in CRUD - if you have some complex business logic to resolve conflicting updates to the same object then maybe an ACID database would make sense. But certainly if you're just doing last write wins like 99% of CRUD webapps then using an ACID database is wasteful and pointless. The whole point of ACID is to say that you need these globally isolated transactions and you're willing to pay for them, and while database engines are pretty smart with MVCC and so on there's fundamentally only so much they can do.

99% of the time all you want to do is a) commit input events to a durable store as quickly as possible b) read a state-of-the-world that's consistent in the sense that it represents all the consequences of all the inputs up until some (logical) time t, and IME an event sourcing model is if anything better at doing that than an RDBMS is.

Re:Smaller is better – The rise, fall, and rise of flat file... by DarylZero on Sunday May 22, 2022 @08:04PM (#31474074)
The filesystem provides its own ACID guarantees too. Well, some filesystems.
Re:Smaller is better – The rise, fall, and rise of flat file... by pixl97 on Sunday May 22, 2022 @02:11PM (#31471072)
Portability to other systems.
Re:Smaller is better – The rise, fall, and rise of flat file... by The_Colonel on Sunday May 22, 2022 @04:47PM (#31472601)
Which platform do you miss, which SQLite does not support?
Re:Smaller is better – The rise, fall, and rise of flat file... by malux85 on Sunday May 22, 2022 @02:43PM (#31471375)
Portability is more important than guaranteed atomicity, consistency, isolation and durability?
Re:Smaller is better – The rise, fall, and rise of flat file... by joebob42 on Sunday May 22, 2022 @02:51PM (#31471469)
I mean, not always, but I can certainly imagine cases where it might be.
Re:Smaller is better – The rise, fall, and rise of flat file... by irrational on Sunday May 22, 2022 @03:54PM (#31472069)
Sometimes. It really depends on the use case. Use the right tool for the job.
Re:Smaller is better – The rise, fall, and rise of flat file... by therealdrag0 on Sunday May 22, 2022 @02:55PM (#31471507)
What kind of portability? Why isn’t a db portable?
Re:Smaller is better – The rise, fall, and rise of flat file... by cortesoft on Sunday May 22, 2022 @04:45PM (#31472575)
A SQL dump is incredibly portable.