Live data from Hacker News

FlatDB – database designed to persist data using just PHP and flat-files

github.com

1–10 of 13 posts

Re: FlatDB – database designed to persist data using just PHP and flat-files

#3
At what point does it stop being a flat file and start being an actual database albeit one implemented in a bit of a round about way?

With that said, PHP has sqlite support built in since 5.0 and sqlite3 since 5.3 so I see no reason to use this over that. Maybe the author can elaborate.

I remember writing code to do stuff like this in C way back when because there were literally no other choices.

Also, why is this on Hacker News?

Edit: I do, however, applaud any effort to contribute to the open source community. However, for anyone to trust this they would need unit tests and a composer package on Packagist.

Re: FlatDB – database designed to persist data using just PHP and flat-files

#7
post #6
post #2

So why this and not SQLite? Just to save the dependency? What makes it "secure"?

Sometimes SQLite is not an option and I created FlatDB for my own needs. This is not a replacement for SQLite or other database engine.

When is it not an option?

Re: FlatDB – database designed to persist data using just PHP and flat-files

#8
post #7
post #6

Earlier quoted context omitted.

Sometimes SQLite is not an option and I created FlatDB for my own needs. This is not a replacement for SQLite or other database engine.

When is it not an option?

Please correct me if I'm wrong but SQLite database could be downloaded from web-browser. There is a some ways to prevent it by keeping db files above www/ dir or via htaccess, however what you will do if you have only limited access to www/ folder and .htaccess aren't supported?

Re: FlatDB – database designed to persist data using just PHP and flat-files

#9

At what point does it stop being a flat file and start being an actual database albeit one implemented in a bit of a round about way? With that said, PHP has sqlite support built in since 5.0 and sqlite3 since 5.3 so I see no reason to use this over that. Maybe the author can elaborate. I remember writing code to do stuff like this in C way back when because there were literally no other choices. Also, why is this on…

As I mentioned in other comments, it's not an replacement for SQLite or any other database engine. I created this script for my own needs and shared it because it may be useful for other developers.

Re: FlatDB – database designed to persist data using just PHP and flat-files

#10

At what point does it stop being a flat file and start being an actual database albeit one implemented in a bit of a round about way? With that said, PHP has sqlite support built in since 5.0 and sqlite3 since 5.3 so I see no reason to use this over that. Maybe the author can elaborate. I remember writing code to do stuff like this in C way back when because there were literally no other choices. Also, why is this on…

This is useful for some free web hosting sites with some limits (if file creation is not forbidden ;), also useful for simple personal blog system (composer is unnecessary).

Well, not great, but usable. The write method is not reliable for asynchronous operations.

Post reply on HN