From 2428264315868f0860f9747c8b005536e5442db6 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 17 May 2013 23:04:18 -0400 Subject: Add Redis database support --- data/example.conf | 30 ++++++++++++++++++++++++++++-- data/modules.example.conf | 25 +++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 2 deletions(-) (limited to 'data') diff --git a/data/example.conf b/data/example.conf index f1433b7d1..aea4c07f3 100644 --- a/data/example.conf +++ b/data/example.conf @@ -22,7 +22,7 @@ * } * * Note that nameless blocks are allowed and are often used with comments to allow - * easialy commenting an entire block, for example: + * easily commenting an entire block, for example: * #foobar * { * moo = "cow" @@ -1082,7 +1082,7 @@ mail #module { name = "db_plain" } /* - * db_flatfile + * [RECOMMENDED] db_flatfile * * This is the default flatfile database format. */ @@ -1124,6 +1124,11 @@ module * This is only useful with very large databases, with hundreds * of thousands of objects, that have a noticeable delay from * writing databases. + * + * If your database is large enough cause a noticible delay when + * saving you should consider a more powerful alternative such + * as db_sql or db_redis, which incrementally update their + * databases asynchronously in real time. */ fork = no } @@ -1172,6 +1177,27 @@ module import = false } +/* + * db_redis. + * + * This module allows using Redis (http://redis.io) as a database backend. + * This module requires that m_redis is loaded and configured properly. + * + * Redis 2.8 supports keyspace notifications which allows Redis to push notifications + * to Anope about outside modifications to the database. This module supports this and + * will internally reflect any changes made to the database immediately once notified. + * See docs/REDIS for more information regarding this. + */ +#module +{ + name = "db_redis" + + /* + * Redis database to use. This must be configured with m_redis. + */ + engine = "redis/main" +} + /* * [RECOMMENDED] Encryption modules. * diff --git a/data/modules.example.conf b/data/modules.example.conf index 01730ce29..2129d3ac9 100644 --- a/data/modules.example.conf +++ b/data/modules.example.conf @@ -503,6 +503,31 @@ module { name = "help" } } } +/* + * m_redis + * + * This module allows other modules to use Redis. + */ +#module +{ + name = "m_redis" + + /* A redis database */ + redis + { + /* The name of this service */ + name = "redis/main" + + /* + * The redis database to use. New connections default to 0. + */ + db = 0 + + ip = "127.0.0.1" + port = 6379 + } +} + /* * m_regex_pcre * -- cgit