 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
James Morris: A WebSockets, Ratchet, Silex and Redis PubSub Implementation
by Chris Cornutt January 23, 2013 @ 12:09:33
James Morris has an interesting new post to his site about the creation of a real-time web service that could be used for iOS applications via Websockets. He chose Ratchet for the handling (a PHP-based websocket tool) combined with Redis and Silex.
I was approached by a betting/gambling development company who potentially needed a middleware building that would pull from an existing gambling web service and basically transmit to connected iPhone clients the changes from the web service. At first, the obvious answer might be to create another REST web service that the iPhone clients could just ping for changes. However, one of the devs explained that this wouldn't be fast enough, or scale - they'd need changes to be transmitted as soon as possible, as the app would be a real-time betting app and there'd be thousands of connections to the server.
His solution involved hooking together Ratchet, Redis, Silex and Predis-async to create this sample tool for handling the websocket requests. it uses the "pubsub" mechanism of Redis to push the updates out to listening clients.
voice your opinion now!
realtime websockets silex pubsub redis ios application api
PHPMaster.com: An Introduction to Redis in PHP using Predis
by Chris Cornutt May 03, 2012 @ 09:35:21
On PHPMaster.com today there's a new tutorial by Daniel Gafitescu showing you how to work with Redis (a key-value store) via PHP with the help of the Predis library.
There is a lot of argument whether Redis or Memcache is better, though as the benchmarks show they perform pretty much on par with each other for basic operations. Redis has more features than Memcache has, such as in-memory and disk persistence, atomic commands and transactions, and not logging every change to disk but rather server-side data structures instead. In this article we'll take a look at some of the basic but powerful commands that Redis has to offer using the Predis library.
He helps you get a local redis server up and running and includes a link to the repository for the latest version of the Predis library. Some sample code is provided showing how to connect to the server, push data into a key/value combination, get the value back out, increment it and check to see if it exists. He also talks about some of the available data types Redis provides and a few other more complex operations you can perform on things other than strings.
voice your opinion now!
predis redis tutorial library connect server
Justin Carmony's Blog: PHP Workers with Redis & Solo
by Chris Cornutt January 11, 2012 @ 11:50:52
In this latest post to his blog Justin Carmony shares some of his experience using Redis and Solo to asynchronously run queries and return data without the user having to wait.
Sometimes there are situations when you want to parallel process things. Other times you might have a list of tasks to accomplish, and you don't want to make the user wait after pressing a button. This is where "Workers" can come in. They are independent scripts that run along side of your application, performing tasks, or "jobs."
Solo is a very basic Perl script that ensures only one process of a type is running at once. Using this and a PHP library called predis, he shows how to set up workers and add items to your processing queue. The workers themselves run on a cron job and connect to the queue server to see what they need to do. He also throws in some "bells and whistles" - extras that can enhance your worker system: queue monitoring, version numbering and killing workers based on a hash value.
His code examples are posted on his github account and a screencast is included in the post to show the system in action.
voice your opinion now!
redis solo cron tutorial queue worker
Justin Carmony's Blog: MySQL, Redis, and a Billion Rows - A Love Story
by Chris Cornutt May 26, 2011 @ 10:57:24
In a new post to his blog Justin Carmony shares the story of how he took a platform running with MySQL as the backend (Dating DNA) and made the choice to move to Redis for storing compatibility scores for every user in the system.
We wanted not only for people to be able to visit a profile and see a score, which is easy to generate a score on demand. We wanted our users to be able to browse other profiles sorted by their score with them. This requires us to pre-generate and store these scores, and then later query them. [...] I believe we could have bent MySQL to our will and got it to work, but it would be at a high cost of server power, and that cost wouldn't scale well with our revenue stream.
He talks about some of the other options they sorted through including NoSQL databases or building something completely in-house. In the end, though, they decided that Redis was more of what they needed. He prefaces talking about their configuration with some of the limitations of the tool and then moves into their setup and statistics on its use (complete with pretty graphs). He points to predis as their Redis client of choice for PHP.
voice your opinion now!
mysql redis datingdna casestudy
Raphael Stolt's Blog: Installing the PHP redis extension on Mac OS X
by Chris Cornutt May 17, 2010 @ 08:55:44
In his latest blog post Raphael Stolt has a new guide to getting the Redis extension installed on your Mac OS X PHP setup. Redis is a key-value based storage tool.
Two out of [the list of libraries] caught my particular attention: Rediska due to it's impressive Zend Framework integration and phpredis as it's a native PHP extension written in C and therefore supposed to be blazingly faster than vanilla PHP client libraries. The following blog post will show how to install and configure the aforementioned, native PHP extension on a Mac OS X system.
You'll need to have the redis server already installed (via MacPorts or some other method) but with that and the necessary libraries in place installing the extension is a simple "git clone" away. He even includes the location of a gist (code snippet) to help you test it out.
voice your opinion now!
redis extension macosx osx tutorial storage
PHPBuilder.com: Add NoSQL Data Storage to Your PHP Development with Redis
by Chris Cornutt April 29, 2010 @ 08:45:36
On PHPBuilder.com today there's a new tutorial that helps you integrate a tool from the the NoSQL movement - Redis - into your application. This tutorial shows you how to add this powerful, fast database as a general content store for your application.
NoSQL is all the rage for Web developers who are tired of building complex SQL. Redis, a NoSQL database server much like Cassandra or MongoDB, provides a powerful and speedy alternative to relational database servers for PHP developers. Redis is similar to Memcached in terms of speed, but the data isn't volatile. That means that when your server reboots, your Redis data will still be there. You can back it up too.
Installing the server for Redis is easy (if you use a package management system) and getting up and running with PHP is as easy as using one of the PHP connection libraries out there like Rediska. In his example he shows one of the most basic operations - storing string values, appending to them and pulling them back out based on their unique key.
voice your opinion now!
tutorial redis nosql data storage
Kevin van Zonneveld's Blog: Redis PHP Introduction
by Chris Cornutt March 26, 2010 @ 07:46:04
Kevin van Zonneveld has written up a new post for his blog today looking at using Redis in your application for caching information (similar to memcache).
Don't know Redis? Think Memcache, with support for for lists, and disk-based storage. You can use Redis as a database, queue, cache server or all of those combined. [...] Redis keeps the entire dataset in memory, so it's still crazy fast: 110000 SETs/second, 81000 GETs/second. Good enough for to you? [...] Yes, you can store (serialized) arrays in Memcache. But every time you change 1 element, you'd have to invalidate & overwrite the entire array.
He talks about installing the redis server (a simple task if you use the package management tool for your linux release) and some simple code to push data into the caching server for keys, lists, sets and how to pull the information back out sorted.
voice your opinion now!
redis cache memcache memory
|
Community Events
Don't see your event here? Let us know!
|