Tag: NoSQL
-
How to pipeline with phpredis
Have you ever run into a scenario where you have to loop through a set of data and perform database queries for each iteration? Obviously we shouldn’t run them one by one, so we end up using a TRANSACTION or even just building out one large query in the case…
-
How to Install PHP Redis on Ubuntu 14.04 LTS
Previously, I had shown you how to install PHP Redis from source but things changed with the latest Ubuntu LTS release. Now you can install the phpredis extension from the Ubuntu respositories. First, if you don’t have it installed already, let’s install Redis: sudo apt-get install redis-server After we get…
-
How to Install the MongoDB PHP Module on Ubuntu 14.04 LTS
Installing the PHP module for MongoDB on Ubuntu 14.04 LTS is just a command away, but first, let’s ensure that we have MongoDB itself installed: sudo apt-get install mongodb Once we have MongoDB installed, we can proceed with installing the module. Please note that you could combine these commands to…
-
Reducing Redis used memory by moving back to MySQL
If you know me then you know I fucking adore Redis. Over the last few years it’s slowly worked it’s way into the majority of the things I have built. Unfortunately, recently I ran into a problem that Redis could easily accomplish but would require more RAM than I have…
-
MySQL and Redis Command Equivalents
Score another one for HitTail as this particular topic was their suggestion. MySQL (PostgreSQL, SQL Server, SQLite or any other RDBMS I didn’t list) and Redis are completely different beasts in regard to syntax and especially schema design (or lack there of). The following are just some common SQL statements…
-
How to Build a Leaderboard with PHP and Redis
One of biggest draws to Redis for me is the fact that it has more data structure types than just key / value. These additional data structures allow you to do some amazing things while still benefitting from being in-memory. One of the most notable ways to leverage Redis would…
-
PHP Redis Clients
In a previous post I’ve talked about installing phpredis a PHP Extension for Redis that has to be compiled from source. But what if you’re hosting scenario doesn’t allow you to compile extensions? Well you’re in luck, in addition to the extension, there are additional client libraries out there for…
-
How to Install the Memcached Module on Ubuntu 12.04 LTS
Installing the Memcached module for PHP on Ubuntu 12.04 LTS is as simple as can be. First let’s make sure we have Memcached installed: sudo apt-get install memcached On Ubuntu, the process to install the PHP module is similar to how we installed Memcached itself: sudo apt-get install php5-memcache php5-memcached…
-
Redis as a PHP Session Handler
Redis is one of my favorite key-value stores, the range of data types alone make it a must have in any developer”s tool belt. Another great use for Redis is as your session handler in PHP. The optional persistence that Redis provides makes it a better option than using Memcached…
-
Memcached as a PHP Session Handler
Memcached makes a semi-perfect solution for storing your PHP sessions. Why only semi-perfect? Well in Memcached’s defense, the fact that it is an in-memory data store makes it a great choice because of the speed. The negative is the lack of persistence, which makes it somewhat less desirable. What this…