开发者

Help me to select a NoSQL Package

I'm c开发者_开发知识库ompletely new to NoSQL [have just read some articles on NoSQL] and want to develop a simple application using it.

Please help me to select a NoSQL system

The system should have these features

  • SQL like Select query (select col1, col2 from tbl where col1>10)
  • SQL like insert query (it will be better if it has Auto increment feature)
  • It should be compatible to use with PHP


Look at MongoDB. Simple to use, fast, reliable and quite powerful. Also, there's a nice driver for PHP.

MongoDB is "NoSQL", schema-free and document-oriented. Different terminology is used, but as a beginner you can think it has collections instead of tables, documents instead of rows and fields instead of columns. Inserting and selecting is quite simple:

// Select some documents.

$cursor = $db->my_collection->find(array(
    'field1' => array('$gt' => 10), // where field1 > 10
), array(
    'field1', 'field2', // which fields to fetch
))->sort(array(
    'field3' => -1, // sort descending by field3
));

while($document = $cursor->getNext())
{
    // ...
}

// Insert a document.

$db->my_collection->insert(array(
    'field1' => 'a',
    'field2' => 2,
    'field3' => 14.8,
));


I think most of the nosql dbs support creation of collections/tables/column families and are compatible with php. You better need to look at what kind of data you want to store and retrieve to decide which one to use.


Does your design have many inter-relating entities, or is it relatively few large tables?

If the latter then I'd wholeheartedly agree that a document oriented database such as Mongo or Apache CouchDB would suit.

If the former then you may want to look at neo4j -- which has a node graph approach. The introductory videos on the site are worth watching. The key benefit of a graph oriented solution is that relationships can be defined on an instance by instance basis (rather than the class level entity approach of a RDBMS)

For admin and simple data entry: CouchDB and neo4j both have easy to use web based front ends; Mongo has phpmoadmin (3rd party) application.

Disclaimer -- I've not attempted to see how any of the above scales, my biggest application [Couch with Ruby on Rails] has only approx 1000 entries.

good luck !

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜