こちらの記事で見かけた内容。 Do You Really Need Redis? How to Get Away with Just PostgreSQL Job Queuing管理をPostgreSQLでというのが面白そうだったので試してみます。 jobsテーブルの作成 jobを登録するテーブルはこんな感じになるかと思います。 create table jobs ( id serial not null primary key, status char(10) not null default 'pending', payload text); idは連番。 statusは、jobの状態。 初期状態はpendingで、running(処理中)、done(処理済)と変化していきます。 payloadはjobに与えるパラメーター格納用です。 job取得のプログラム 記事に記