php: All content tagged as php in NoSQL databases and polyglot persistence
Monday, 30 January 2012
PHP and MongoDB Tutorial
Derick Rethans’s1 slides are a good MongoDB tutorial for PHP developers covering most of the API.
Thursday, 14 April 2011
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:
- Fan-out on read (do these queries ahead of time and cache them)
- 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)
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:
- If you use a timestamp as the score parameter, you can really easily query for feed items based on time
- You can easily get the union of multiple sorted sets in order to generate an aggregated “friend feed”
Original title and link: Activity Feeds with Redis (NoSQL databases © myNoSQL)
Saturday, 22 January 2011
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)
Wednesday, 12 January 2011
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:
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)
Sunday, 5 December 2010
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)
Tuesday, 19 October 2010
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)
Friday, 8 October 2010
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)
Tuesday, 5 October 2010
MongoDB: A ToDo App with Ruby and PHP
Sort of ☞ todo.txt, but using MongoDB with ☞ Ruby or ☞ PHP:
Earlier this summer, we kicked off a series on MongoDB where the goal was to write a simple todo application using native MongoDB drivers and three of our favorite scripting languages.
Original title and link: MongoDB: A ToDo App with Ruby and PHP (NoSQL databases © myNoSQL)
Wednesday, 15 September 2010
Redis: Implementing Auto Complete or How to build Trie on Redis
In the days the news are about instant searches and auto complete, Salvatore Sanfilippo (@antirez) shows how to use Redis sorted sets and corresponding commands (ZRANGE, ZRANK) to implement autocompletion:
The initial code in Ruby:
already got ported to Python:
As Ilya Grigorik (@igrigorik) commented, this is building a ☞ Trie with Redis.
Original title and link: Redis: Implementing Auto Complete or How to build Trie on Redis (NoSQL databases © myNoSQL)
Friday, 10 September 2010
CouchDB: Getting Started using PHP
I hope you like this first sight of the CouchDB database. Couch have many other features, but the documents and views are the central part of the system : once those are well understood, the rest is easily understandable. The most difficult part, as said in the introduction, is to forget years of SQL thinking to build web applications.
Definitely not the first CouchDB and PHP guide — see Quick guide to CouchDB and PHP, CouchDB basics for PHP developers, A not-so-quick guide to CouchDB with PHP — and most probably not the last and/or definitive one.
Original title and link for this post: CouchDB: Getting Started using PHP (published on the NoSQL blog: myNoSQL)
Most Popular Articles
- Translate SQL to MongoDB MapReduce
- Tutorial: Getting Started With Cassandra
- CouchDB vs MongoDB: An attempt for a More Informed Comparison
- Cassandra @ Twitter: An Interview with Ryan King
- A Couple of Nice GUI Tools for MongoDB
- NoSQL benchmarks and performance evaluations
- Ehcache: Distributed Cache or NoSQL Store?
- Document Databases Compared: CouchDB, MongoDB, RavenDB
- Quick Review of Existing Graph Databases
- NoSQL Data Modeling
