Pushing MySQL updates to Memcache using SQL triggers

How to make MySQL trigger cache updates after an INSERT or UPDATE on the DB.

CREATE TRIGGER tr1 AFTER INSERT ON table1 FOR EACH ROW DO memcache_set("localhost:11211",NEW.name,NEW.value);
CREATE TRIGGER tr1 AFTER DELETE ON table1 FOR EACH ROW DO memcache_delete("localhost:11211",OLD.name);

Source

Tags: ,

One Response to “Pushing MySQL updates to Memcache using SQL triggers”

  1. Mark says:

    How do you get the memcache_set() function to work in MySQL?

Leave a Reply