Welcome to Dream.In.Code
Getting Help is Easy!

Join 118,860 Programmers for FREE! Ask your question and get quick answers from experts. There are 1,684 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



OS PHP FFDB

2 Pages V  1 2 >  
Reply to this topicStart new topic

OS PHP FFDB, Open Source PHP Flat File Database

grimpirate
post 8 May, 2008 - 11:34 PM
Post #1


D.I.C Head

Group Icon
Joined: 3 Aug, 2006
Posts: 177



Thanked 5 times

Dream Kudos: 375
My Contributions


ok well if you've read my blog then I assume you would know about this. However, since this forum was created then I'll just place this project here to see if I can get some feedback as the blog doesn't really get that much.

Here's the main page for my project:

Mimesis

How can you help? Umm... I suppose just test and retest. The site itself only goes up to v1.3. However the code I'm including is v1.4 which has some minor (albeit important) alterations. Some stuff may be buggy so please let me know if that's the case.

The phpdocs on the site and the tutorials are still applicable to the current encarnation.

I have yet to add the functions for deletion or moving of database items. Right now it creates the database items and can search through them.

Final note, yes I understand most people are nay sayers to the ffdbs so if we could avoid those comments that would be helpful as well. I'd prefer comments that center around improving how this ffdb works (and not by turning it into something else or another SQL system).

This post has been edited by grimpirate: 8 May, 2008 - 11:37 PM


Attached File(s)
Attached File  mimesis.zip ( 29.97k ) Number of downloads: 25
User is offlineProfile CardPM

Go to the top of the page


grimpirate
post 15 May, 2008 - 12:50 AM
Post #2


D.I.C Head

Group Icon
Joined: 3 Aug, 2006
Posts: 177



Thanked 5 times

Dream Kudos: 375
My Contributions


v1.5

This post has been edited by grimpirate: 15 May, 2008 - 12:51 AM


Attached File(s)
Attached File  mimesis.zip ( 30.23k ) Number of downloads: 22
User is offlineProfile CardPM

Go to the top of the page

grimpirate
post 17 May, 2008 - 07:09 PM
Post #3


D.I.C Head

Group Icon
Joined: 3 Aug, 2006
Posts: 177



Thanked 5 times

Dream Kudos: 375
My Contributions


v1.7 has two bug fixes.


Attached File(s)
Attached File  mimesis.zip ( 31.83k ) Number of downloads: 20
User is offlineProfile CardPM

Go to the top of the page

grimpirate
post 25 May, 2008 - 11:57 AM
Post #4


D.I.C Head

Group Icon
Joined: 3 Aug, 2006
Posts: 177



Thanked 5 times

Dream Kudos: 375
My Contributions


v1.8 released. Read more on it at my blog.
User is offlineProfile CardPM

Go to the top of the page

grimpirate
post 2 Jun, 2008 - 10:08 PM
Post #5


D.I.C Head

Group Icon
Joined: 3 Aug, 2006
Posts: 177



Thanked 5 times

Dream Kudos: 375
My Contributions


v2.0 released along with a site redesign. Get it here.
User is offlineProfile CardPM

Go to the top of the page

skyhawk133
post 2 Jun, 2008 - 10:10 PM
Post #6


Head DIC Head

Group Icon
Joined: 17 Mar, 2001
Posts: 14,608



Thanked 39 times

Dream Kudos: 1650

Expert In: Web Development

My Contributions


This is good stuff. Keep us posted with more updates!
User is offlineProfile CardPM

Go to the top of the page

grimpirate
post 7 Jun, 2008 - 01:07 AM
Post #7


D.I.C Head

Group Icon
Joined: 3 Aug, 2006
Posts: 177



Thanked 5 times

Dream Kudos: 375
My Contributions


Thank you skyhawk. It's nice to see a couple of people have taken interest in my project. It seems most of the time all I get is "Why would you use an ffdb? That's preposterous!" It's nice to have some encouraging words now and again. Newest things going on with Mimesis: I'll just keep adding more tutorials and/or expanding on the ones that are already there, and the site has been redesigned to look much cleaner and sleeker with some nice and simple graphics dotted here and there, and much more understable CSS.

To the code the only real changes I can see I might need to make are in the queryTable method of the Mimesis class. Currently it performs a series of passes over the data (after it's all been grabbed) in order to filter out the results. I'd much prefer it to perform the filtering the moment it grabs the data (one row at a time) and then simply exclude it from the results. This would improve overall query speed.
User is offlineProfile CardPM

Go to the top of the page

Tom9729
post 7 Jun, 2008 - 11:04 AM
Post #8


Debian guru

Group Icon
Joined: 30 Dec, 2007
Posts: 1,429



Thanked 10 times

Dream Kudos: 325
My Contributions


Flat-file databases are very useful when you don't feel like setting up an SQL server for a small site, or when you simply don't have access to one. I'm not currently looking to use a ffdb, but this project looks very promising nonetheless. Keep up the good work! icon_up.gif
User is offlineProfile CardPM

Go to the top of the page

grimpirate
post 11 Jun, 2008 - 03:08 PM
Post #9


D.I.C Head

Group Icon
Joined: 3 Aug, 2006
Posts: 177



Thanked 5 times

Dream Kudos: 375
My Contributions


Thanks for the encouraging words Tom. I'm actually hoping that Mimesis can handle large loads of data (so that it can be used on large sites and not just small ones).

I tried enhacing the queryTable method, but it actually performed faster than what I thought would be optimized with the currently standing code. However, I did find a small code bug in the Mutex class, but it isn't catastrophic, just something that needed to be changed.

I'm going to to create some random data and see how Mimesis handles it. Anyone have any ideas of how much data would be considered larger than small for a site?
User is offlineProfile CardPM

Go to the top of the page

Tom9729
post 11 Jun, 2008 - 03:50 PM
Post #10


Debian guru

Group Icon
Joined: 30 Dec, 2007
Posts: 1,429



Thanked 10 times

Dream Kudos: 325
My Contributions


Well I think the one reason really big sites use databases like MySQL is so they can run multiple servers to "bear the load".

I mean that makes sense to me logically, I don't know if it's true though. smile.gif
User is offlineProfile CardPM

Go to the top of the page

grimpirate
post 11 Jun, 2008 - 04:08 PM
Post #11


D.I.C Head

Group Icon
Joined: 3 Aug, 2006
Posts: 177



Thanked 5 times

Dream Kudos: 375
My Contributions


Well I just ran a quick test to see what would happen:
CODE
<?php
error_reporting(E_ALL);

require_once('mimesis/Mimesis.php');

$start = microtime(true);
$cwd = realpath(dirname(__FILE__));
$tableName = 'dutyTable';
$rowLabel = str_pad(0, 8, '0', STR_PAD_LEFT);
$columnsFile = 'keys';

$mimesis = new Mimesis($cwd, $tableName, $rowLabel, $columnsFile);

$mimesis->lockTable();
$mimesis->createTable();
for($i = 0; $i <= 99999999; $i++){
    $rowLabel = str_pad($i, 8, '0', STR_PAD_LEFT);
    $mimesis->redefineRow($rowLabel);
    $temp = array($i, time(), str_pad('x', 1024, 'x', STR_PAD_LEFT));
    $mimesis->insertRow($temp);
}
$mimesis->releaseTable();
echo microtime(true) - $start;
?>
Script execution timed out (at 30 seconds) and only created 2353 entries before aborting. Ran it again it produced 2639 more entries before timing out.

Second test involved querying 4992 entries that were created as follows:
CODE
<?php
error_reporting(E_ALL);

require_once('mimesis/Mimesis.php');

$start = microtime(true);
$cwd = realpath(dirname(__FILE__));
$tableName = 'dutyTable';
$rowLabel = str_pad(0, 8, '0', STR_PAD_LEFT);
$columnsFile = 'keys';

$mimesis = new Mimesis($cwd, $tableName, $rowLabel, $columnsFile);

$temp = $mimesis->queryTable(array(array(0, SORT_ASC)), null, false, array('/^.*keys\.php$/i'));
echo microtime(true) - $start;
?>
The browser output a total time of 22.610347986221 seconds.

The table itself is 5,320,383 bytes of data.
The size on disk of the table is 20,451,328 bytes.

This post has been edited by grimpirate: 11 Jun, 2008 - 04:20 PM
User is offlineProfile CardPM

Go to the top of the page

grimpirate
post 12 Jun, 2008 - 02:59 PM
Post #12


D.I.C Head

Group Icon
Joined: 3 Aug, 2006
Posts: 177



Thanked 5 times

Dream Kudos: 375
My Contributions


Working on an experimental version of Mimesis. Shows promise. I ran the code again and it timed out at 3188 entries. To match the 4992 of the initial run it took an additional 13.77 secomds. The query took 18.69 seconds (there was no sorting involved either). However, the database now stores a bit more additional data with the entries and it's also not backwards compatible. To illustrate the difference the size was 5,350,349 bytes and the size on disk was 20,451,328 bytes

This post has been edited by grimpirate: 12 Jun, 2008 - 03:00 PM
User is offlineProfile CardPM

Go to the top of the page

2 Pages V  1 2 >
Fast ReplyReply to this topicStart new topic
Time is now: 10/13/08 01:45AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month