I'm trying to plan a web application that should use a noSQL solution - Cassandra seems to be a good solution. I saw there are libraries for PHP to manipulate the database like phpCassa.
Also I saw the new version of Cassandra 0.8 is introducing a query language CQL.
Are there php interfaces that use the CQL? What is the benefit using the CQL? Is it just a more sql-like way to make queries?
Thank you!
The link Greg posted above is to date the working repo and state of the php-cql driver efforts.
While a driver is not yet available it does not stop you from using CQL, the drivers are all going to be a wrapper of the thrift method "execute_cql_query" (Until a new transport is created anyway).
That means you can simply compile thrift for php or get it from an updated project and then pass your cql query to that method. It does mean manual handling of things that a driver will/should take care of.
"Is it just a more sql-like way to make queries?", basically...yes. One of the things that came up on the Cassandra mailing list was getting CQL to be as SQL-Like as possible.
"What is the benefit using the CQL?" Well, mainly that some new Cassandra users find the thrift API tedious to get to grips with, CQL may be much easier to learn since its is so close to the "normal" sql.
https://github.com/nicktelford/php-cql
I also believe that phpCassa should support it as well.
It's designed to make NoSQL more logical for people coming from SQL as a database engine.
This will really be helpful if you wish to use CQL to communicate with Cassandra via PHP
https://gist.github.com/1024060/983a5607390433b77d5c2e64a4ee148f4df46b69
This is a sample of what zcourts mentioned in his previous post
Regards,
Tamil
The official CQL drivers supported by the Apache Cassandra project at large are, I believe, all on Apache Extras, at this link:
http://code.google.com/a/apache-extras.org/hosting/search?q=label:cql
The PHP one is at
http://code.google.com/a/apache-extras.org/p/cassandra-pdo/
Connection via Thrift deprecated.
I am using PHP library for Cassandra database via a binary protocol.
Related
Does anyone know how to use phpcassa for cassandra with Yiiframework?
I've tried Cassandra PDO. It works very well, but I happened to like the way phpcassa works. Especially the support for most cassandra features.
I don't know but I found phpcassa much easier to use.
Any suggestions?
Regards
I'm not familiar with Yii in particular, but after glancing at it, I suspect you won't be able to use most of the Yii ORM-like features directly, whether it's though phpcassa or the PDO driver. Certainly it could work for some cases, but in general, your data in Cassandra is not modeled around objects, it's modeled around queries. Your goal is to lay out your data in such a way that you can answer queries that you have planned for very efficiently. Because Yii is object-oriented, there's a fundamental mismatch in how it expects you to interact with the database.
I've written an Yii extension today for cassandra-cql3, hope this might help others searching for an yii wrapper for cassandra CQL3
https://github.com/masumsoft/yii-cassandra-cql3
Are there any php extensions for cassandra yet like the php_mysql extension, or are there any PHP wrappers available.
I have seen phpCassa and similar ones but it doesnt quite have the same flexibility as the CQL (plus i hear it may be faster to use CQL, not sure why...)
See CQL!
There's a PDO CQL driver, which seems like exactly what you're looking for.
https://wiki.fourkitchens.com/display/PF/Using+Cassandra+with+PHP
Have you read this yet? Seems like it gives you a few options to interact with Cassandra directly from PHP
Here is an example of the code you could use in PHP. Seems SQL-esque enough to me:
http://wiki.apache.org/cassandra/ThriftExamples#PHP
Check out evseevnn's php-cassandra-binary: https://github.com/evseevnn/php-cassandra-binary
It uses Cassandra's binary protocol (no thrift) so it can be installed without any extensions!
I hope this might help you as well
http://itsallabtamil.blogspot.com/search/label/cassandra
Part 1 explains how to use PHPCassa to connect to Cassandra and fetch data via CQL
This is using PHPCassa
Regards,
Tamil
What is the preferred method of accessing a Microsoft SQL Server database with PHP 5.3+ on Linux?
Given the different extension options now available I'm unsure which method is preferred based on reliability and performance. Right now I am using the mssql extension with FreeTDS, but I'd like to know if this isn't the best way.
I've heard some recommend using php-odbc/EasySoft because the mssql extension has been abandoned - yet others have said going the ODBC route isn't worth the performance hit.
The response to this stackoverflow question seems to touch on what I'm asking, however it's Windows centric.
Thank you!
I've had good results using PHP's PDO (PHP Data Objects) library for this sort of thing. There's an excellent tutorial at http://net.tutsplus.com/tutorials/php/why-you-should-be-using-phps-pdo-for-database-access/. Just make sure you use the following template to initialize your database connection:
$dbh = new PDO("dblib:host=$host;dbname=$dbname", $user, $pass);
I use FreeTDS. It's far from satisfactory. In fact, I found your question because I live in hope that there must be a better solution and I keep looking for one. Unfortunately, FreeTDS seems to be the best option at the moment, if you're developing in a Linux environment.
If you were on Windows, you could obviously use the Microsoft SQL Server drivers for PHP which would be better, but even then there are missing features, like support for PDO lastInsertId().
I've made a web application using SQLite (2.8.17), I've only now discovered that there's an SQLite3. It somehow eluded my attention when making the web application, probably due to the lack of documentation for the php functions.
I'm wondering, what are the benefits of using SQLite3 over SQLite? Is it considerably faster?
SQLite2 internally stores every value as a string, regardless of its type.
Upgrading to SQLite3 will certainly shrink the database size since numbers and BLOBS get stored in their native formats, which could make things run faster. Another big advantage in my opinion is that recent versions of sqlite, (starting from 3.6.23) support foreign keys.
Since you were using PHP, I would suggest that you look into PDO. It could prove helpful in case you need to change the DBMS for the application
This documents from the sqlite.org website: http://www.sqlite.org/version3.html it doesn't talk about performance, but differences. anyway there are not update to sqlite2 I personally recommend using latest and greatest version 3 (see Improved Concurrency, always good for web applications).
I strongly prefer not to use additional 3rd party components, libraries or DLLs (at least in v1.0), unless there is absolutely no other solution.
Question: (how) can I use Delphi to progrtiamatically crate a BDE database and write to it, then use PHP to read from it?
Any URLs for examples of tutorial?
People are advising against it. Ok, the ultimate goal is some form of ODBC interface anyway. Someone mentioned ADO to me, but I don't see how to install it.
I need to crate the entire database and contents programatically in Delphi - at run time - I have no idea of it's contents or even name at compile time.
What's the simplest route for me? Thanks
Sounds like a bad idea to me, to be honest. BDE is long-since deprecated and I seriously doubt if you could get PHP to jive with it.
I would recommend using a standard database such as Firebird or MySQL for which established Delphi and PHP libraries exist, or XML if the dataset is not too large.
By BDE you mean Paradox or DBase? Wouldn't recomment using those anymore. I moved into Firebird and MySQL years ago just like Alan recommends.
Delphi supports Firebird/Interbase database out of the box AFAIK and PHP libraries exist for it. Other way around : MySQL support is in all PHP installations and there are some very good components for Delphi