4 ms·
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 securit
by DeathArrow 4y ago
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.
- pixl97 4y agoPortability to other systems.
- malux85 4y agoPortability is more important than guaranteed atomicity, consistency, isolation and durability?
- joebob42 4y agoI mean, not always, but I can certainly imagine cases where it might be.
- irrational 4y agoSometimes. It really depends on the use case. Use the right tool for the job.
- therealdrag0 4y agoWhat kind of portability? Why isn’t a db portable?
- cortesoft 4y agoA SQL dump is incredibly portable.
- The_Colonel 4y agoWhich platform do you miss, which SQLite does not support?
- throwawayboise 4y agoYeah, 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.
- randombits0 4y agoBut only the wheels you need, when you need them. Don’t carry the overhead unless needed.
- JumpCrisscross 4y ago> 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?
- DarylZero 4y agoThe filesystem provides its own ACID guarantees too. Well, some filesystems.
- lmm 4y agoACID 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.
- Kinrany 4y ago> 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?
- lmm 4y agoDepends 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.