ALL COVERED TOPICS

NoSQL Benchmarks NoSQL use cases NoSQL Videos NoSQL Hybrid Solutions NoSQL Presentations Big Data Hadoop MapReduce Pig Hive Flume Oozie Sqoop HDFS ZooKeeper Cascading Cascalog BigTable Cassandra HBase Hypertable Couchbase CouchDB MongoDB OrientDB RavenDB Jackrabbit Terrastore Amazon DynamoDB Redis Riak Project Voldemort Tokyo Cabinet Kyoto Cabinet memcached Amazon SimpleDB Datomic MemcacheDB M/DB GT.M Amazon Dynamo Dynomite Mnesia Yahoo! PNUTS/Sherpa Neo4j InfoGrid Sones GraphDB InfiniteGraph AllegroGraph MarkLogic Clustrix CouchDB Case Studies MongoDB Case Studies NoSQL at Adobe NoSQL at Facebook NoSQL at Twitter

NAVIGATE MAIN CATEGORIES

Close

PHP: All content tagged as PHP in NoSQL databases and polyglot persistence

MongoDB for PHP Developers

A two-part MongoDB tutorial for PHP developers: first part covering installation and the second giving a brief intro to MongoDB PHP API for queries and indexes. While not the tutorial that will get you up and running, it’s still a good resource for beginners.

Original title and link: MongoDB for PHP Developers (NoSQL database©myNoSQL)


Calculating the Cost of Storing PHP Sessions Using Amazon DynamoDB

Aside from nominal data storage and data transfer fees, the costs associated with using Amazon DynamoDB are calculated based on provisioned throughput capacity and item size (see the Amazon DynamoDB pricing details). Throughput is measured in units of Read Capacity and Write Capacity. Ultimately, the throughput and costs required for your sessions table is going to be based on your website traffic, but the following is a list of the capacity units required for each session-related operation with the assumption that your sessions are less than 1KB in size:

  • Reading via session_start()

    • With locking enabled: 1 unit of Write Capacity + 1 unit of Write Capacity for each time it must retry acquiring the lock

    • With locking disabed: 1 unit of Read Capacity (or 0.5 units of Read Capacity if consistent reads are disabled)

  • Writing via session_write_close(): 1 unit of Write Capacity

  • Deleting via session_destroy(): 1 unit of Write Capacity

  • Garbage Collecting via DyanamoDBSessionHandler::garbage_collect(): 0.5 units of Read Capacity per KB of data in the sessions table + 1 unit of Write Capacity per expired item

Nice translation of PHP function calls to effective Amazon DynamoDB capacity units.

Original title and link: Calculating the Cost of Storing PHP Sessions Using Amazon DynamoDB (NoSQL database©myNoSQL)

via: http://aws.typepad.com/aws/2012/04/scalable-session-handling-in-php-using-amazon-dynamodb.html


DynamoDB Libraries, Mappers, and Mock Implementations

A list of DynamoDB libraries covering quite a few popular languages and frameworks:

DynamoDB Libraries, Mappers, and Mock Implementations

A couple of things I’ve noticed (and that could be helpful to other NoSQL database companies):

  1. Amazon provides official libraries for a couple of major programming languages (Java, .NET, PHP, Ruby)
  2. Amazon is not shy to promote libraries that are not official, but established themselves as good libraries (e.g. Python’s Boto)
  3. The list doesn’t seem to include anything for C and Objective C (Objective C is the language of iOS and Mac apps)

Original title and link: DynamoDB Libraries, Mappers, and Mock Implementations (NoSQL database©myNoSQL)

via: http://aws.typepad.com/aws/2012/04/amazon-dynamodb-libraries-mappers-and-mock-implementations-galore.html


PHP and MongoDB Tutorial

Derick Rethans’s1 slides are a good MongoDB tutorial for PHP developers covering most of the API.


Activity Feeds with Redis

The how:

One brief note about architecture: since it’s impractical to simply query the activity of 500 friends, there are two general approaches for building scalable news feeds:

  1. Fan-out on read (do these queries ahead of time and cache them)
  2. Fan-out on-write (write follower-specific copies of every activity so when a given user asks for a feed you can retrieve it in one, simple query)

blog.waxman.me

And why Redis:

First off, why Redis? It’s fast, our data model allows us to store minimal data in each feed entry, and Redis’ data-types are pretty well suited for an activity feed. Lists might seem like an obvious choice and could work for a basic feed implementation, but we ended up using sorted sets for two reasons:

  1. If you use a timestamp as the score parameter, you can really easily query for feed items based on time
  2. You can easily get the union of multiple sorted sets in order to generate an aggregated “friend feed”

nleach.com

Then the code in Ruby and PHP

Original title and link: Activity Feeds with Redis (NoSQL databases © myNoSQL)


Create a blog with MongoDB and Zend Framework

We never run out of the “hello worlds” of the web applications NoSQL-based blogs:

Now this article should have given you a good idea of just how easy it is to integrate MongoDb and the Zend Framework, specifically with the Shanty-Mongo library. I appreciate that there are a lot of things that I’ve not covered here, like the forms, proper security and more thorough validation. I’ve also not gone in to a lot of detail about the wide variety of features that are available with MongoDB, such as storing documents and exactly how replication works. But I hope that I’ve whet your appetite for learning more.

We’ve had a blog engine based on MongoDB using Mongomapper and also a guide to Zend and MongoDB to be run on one of the MongoDB cloud hosts, but never a blog with MongoDB and Zend. All combinations allowed!

Original title and link: Create a blog with MongoDB and Zend Framework (NoSQL databases © myNoSQL)

via: http://www.maltblue.com/2010/11/uncategorized/writing-a-simple-blog-with-zend-framework-and-mongodb


Redis and PHP: What Library to use?

Ori Pekelman discusses in two posts — here and here — the status of the various PHP libraries for Redis:

After looking at all of these I quickly turned to the C extension, Redisent looked nice but did not implement the new unified bulk protocol, and to be true, the code was a bit buggy. The others (Predis, Rediska ) seemed like bloatware, that capture the real essence of PHP (making complicated incoherent APIs) while missing that of Redis (Simple, Fast, Awsomeness).

As you can imagine such a comment generated some reactions and Ori followed up with a (not exactly scientific) benchmark:

Redis PHP Libraries Benchmark

While initially considering 6 PHP libraries (phpredis, Predis, Redis PHP bindings (deprecated), Redisent, Rediska), the benchmark didn’t include Rediska as the library is defining a too custom API for Redis.

Do you have a different experiences with any of these Redis PHP libraries?

Original title and link: Redis and PHP: What Library to use? (NoSQL databases © myNoSQL)


CouchDB and PHP Video Tutorial

Besides LAMP, you can now learn about LAP(hp)-CouchDB-:

PHP developers generally use MySQL, but the rise of NoSQL databases has opened up new options for creating web apps. CouchDB’s unique replication feature set and easy API make it a great fit for PHP developers looking to move into a NoSQL database.

Original title and link: CouchDB and PHP (NoSQL databases © myNoSQL)


PHP Doctrine and CouchDB

I already mentioned Doctrine support for CouchDB, but couldn’t find the reference before:

As I blogged recently we started working on CouchDB support on top of the Doctrine2 infrastructure back at FrOSCamp. […] Like I was in #couchdb on freenode the other day and David asked a fairly legitimate question: “can you enlighten me as to why you’d need an ORM on top of native json object”? In this blog post I will try to explain why it makes sense to add a model based infrastructure underneath a NoSQL database.

Still not completely convinced

Original title and link: PHP Doctrine and CouchDB (NoSQL databases © myNoSQL)

via: http://pooteeweet.org/blog/0/1832


Doctrine: MongoDB Object Document Mapper for PHP

Jonathan Wage’s preso:

And I think I’ve read the Doctrine is now working on tightly integrating with CouchDB too.

Original title and link: Doctrine: MongoDB Object Document Mapper for PHP (NoSQL databases © myNoSQL)