Results 1 to 11 of 11
Thread: flat file php forum
-
04-24-2004, 08:04 AM #1WHT Addict
- Join Date
- Nov 2002
- Posts
- 163
flat file php forum
Well after looking for one for a while (all too big and bloated crap lol). I gave up and started writing one myself. I do need some feedback/testing on it to make sure it doesnt break right away.
It's very simple at this time, however with time the following things will come: user registration/login (name protection) simple admin features (lock/make sticky/delete msgs/threads) thread email subscription.
I placed all data files outside (below) public_html, what else should one do when its flat file versus php/mysql? (I do run a homemade php/mysql board on another site that has run extreme well so far- 1500+ threads 5000+ messages - no hacks or anything happened).
It's at:
http://greylisting.org/forum/
Design isn't worked out completely yet. I'll probably give it a grey look eventually.
-
04-25-2004, 03:34 PM #2WHT Addict
- Join Date
- Oct 2003
- Posts
- 115
sounds interesting
can you tell me how fast the pages are loading?
-
04-26-2004, 06:18 AM #3WHT Addict
- Join Date
- Nov 2002
- Posts
- 163
>>can you tell me how fast the pages are loading?
Hmm, I dunno. Haven't tried calculating it. However, I would think that, provided the computer has plenty of RAM, a flat file forum is not much slower then a mysql forum (if slower at all). When browsing; data files would stay in memory cache (I think). The biggest problem is the scaleability - lack thereof - if it gets very busy.
-
04-27-2004, 03:40 PM #4Web Hosting Guru
- Join Date
- Nov 2003
- Posts
- 297
I wrote one that's very small and nonbloated but is also very simple and used a ton of javascript. here it is though...
http://www.neohz.com/flatforum.zip
i had a lot of fun building it
-
04-27-2004, 04:06 PM #5Newbie
- Join Date
- Apr 2004
- Location
- UK
- Posts
- 5
I was thinking of writing one as a college project, it would be ideal for those looking for portability, as it would work under any platform with PHP, and you could back up the forum using one file.
As stated above the only drawback would be when the forum gets busy, as it would require a lot of HDD reads/writes.
I wrote a flat-file database class a couple of weeks ago, i might try and implement it into this idea.
-
04-27-2004, 05:05 PM #6Web Hosting Guru
- Join Date
- Nov 2003
- Posts
- 297
php5 will come with SQLite which is a flatfile database so soon it shouldn;t matter but flatfiles are great for portability and ease of use. I've heard you can break the text file with multiple simultanious accesses so make sure you back them up.
-
04-27-2004, 05:49 PM #7WHT Addict
- Join Date
- Nov 2002
- Posts
- 163
>>>I've heard you can break the text file with multiple simultanious accesses so make sure you back them up.
But shouldn't using flock() avoid this? :-) (SYNCHRONIZING access to files, ie. shared read locks for reading, exclusive lock for when you need to update a file)
-
04-27-2004, 06:47 PM #8Web Hosting Master
- Join Date
- Dec 2002
- Location
- NY, NY
- Posts
- 3,974
But its not as good.
You will spend so much more time on search functions and the like.
Instead of a simple sql query like:
"select * from xxx where a = b order by id DESC;
you would have a hell of alot of code.webmaster A T 420th.com
What is my Itunes playing? Visit 420th.com/nowplaying.jsp to find out.
Ask the monkey: http://www.monkeyfaq.com
-
04-27-2004, 09:04 PM #9Newbie
- Join Date
- Apr 2004
- Location
- UK
- Posts
- 5
Originally posted by ilyash
But its not as good.
You will spend so much more time on search functions and the like.
Instead of a simple sql query like:
"select * from xxx where a = b order by id DESC;
you would have a hell of alot of code.
-
04-27-2004, 09:28 PM #10Web Hosting Master
- Join Date
- Dec 2002
- Location
- NY, NY
- Posts
- 3,974
it would take a whole lot more code.
And that was only one example.
There are countless others.
Like updates, and different cases and such...webmaster A T 420th.com
What is my Itunes playing? Visit 420th.com/nowplaying.jsp to find out.
Ask the monkey: http://www.monkeyfaq.com
-
04-28-2004, 11:27 AM #11Web Hosting Guru
- Join Date
- Nov 2003
- Posts
- 297
RE: exclusive lock for when you need to update a file
the problem being that as soon as you start locking files you have essentially made your app single threaded which is a pretty big hit to scalability. Of course if you were thinking scalable you probably wouldn't even consider flat files.