DEV Community

Joshua Johnson for UA1 Labs

Posted on

Introduce NoSQL Into Your Legacy LAMP Stack Projects With FireSql

Tired of having to write schema update scripts every time you want to make a change to your MySQL data structure? Or do you have a client on Wordpress and you would like to introduce new data driven features but don't want to take the time to have to create and manage new MySQL tables and schemas to get your new functionality in place?

FireSQL may be the solution you are looking for!

Within 10 minutes, you can can have FireSQL setup and working within your project. Ready to start interfacing with data objects. Forget about the schemas! Just start inserting objects like this:

// connect to database
$dns = 'mysql:host=localhost;dbname=test;port=3306';
$username = 'username';
$password = 'password1';
$pdo = new PDO($dns, $username, $password);
$db = new Fire\Sql($pdo);

// get a collection
$cars = $db->collection('Cars');

// insert $car objects
$cars->insert($car);

// retrieve $car objects
$fordCars = $cars->find('{"make":"ford"}');

With the latest release of 2.1.0 we've gone through and fully documented all source code and added a detailed README on how to use FireSQL.

Check it out on Packagist.org

Top comments (2)

Collapse
 
tarialfaro profile image
Tari R. Alfaro

I think FireSQL would be great for prototyping, and then switching to a actual NoSQL or SQL database.

Collapse
 
joshualjohnson profile image
Joshua Johnson

First off, thank you so much for looking at FireSQL. I think you might be surprised by the performance of FireSQL. Take a look at the demo script.

github.com/ua1-labs/firesql/blob/m...

Run it locally and see what kind of performance you get.

echo $firebug->render();

This code will give you the metrics as these objects get inserted into the database.

Then run github.com/ua1-labs/firesql/blob/m... after you build up a decent amount of records. Look at the firebug panel and see what kind of performance you are getting. You'll definitely be surprised.

Lastly, I agree with you, this solution is not for Enterprise. This is more of a solution for a small to medium sized business who can't support a budget for enterprise level solutions.