The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::Google::SafeBrowsing2::Redis - Redis as back-end storage for the Google Safe Browsing v2 database.

The source code is available on github at https://github.com/juliensobrier/Net-Google-SafeBrowsing2-Redis.

SYNOPSIS

  use Net::Google::SafeBrowsing2::Redis;

  my $storage = Net::Google::SafeBrowsing2::Redis->new(host => '127.0.0.1', database => 1);
  ...

DESCRIPTION

This is an implementation of Net::Google::SafeBrowsing2::Storage using Redis.

CONSTRUCTOR

new()

Create a Net::Google::SafeBrowsing2::Redis object

  my $storage = Net::Google::SafeBrowsing2::Redis->new(
      host     => '127.0.0.1', 
      database => 0, 
  );

Arguments

host

Optional. Redis host name. "127.0.01" by default

database

Optional. Redis database name to connect to. 0 by default.

port

Optional. Redis port number to connect to. 6379 by default.

backward_compatible

Optional. Stay backward compatible with 0.3, but requires a bigger Redis database. 0 (disabled) by default

keep_all

Optional. Keel all full hashes, even after they expire (45 minutes). 0 (disabled) by default

PUBLIC FUNCTIONS

BENCHMARK

    Here are some numbers comparing the MySQL 0.6 back-end and Redis 0.4 back-end:

    Database update, from empty to full update: MySQL: 1330s Redis 2.4: 351s

    10,000 URLs lookup MySQL: 6s Redis 2.4: 5s

    Storage: MySQL: 154MB Redis 2.4: 780MB

CHANGELOG

0.7

FIX: chunks were not deleted correctly.

0.6

FIX: some keys were never deleted from Redis.

0.4

New options backward_compatible and keep_all.

Save 140MB in Redis (as of 08/01/2012)

0.3

Break backward compatibility with previous versions. Make sure you start from a fresh database (reset your existing database if needed).

Improve performances, fixes lookup. Requires 920MB for a full database (as of 07/31/2012)

SEE ALSO

See Net::Google::SafeBrowsing2 for handling Google Safe Browsing v2.

See Net::Google::SafeBrowsing2::Storage for the list of public functions.

See Net::Google::SafeBrowsing2::Sqlite for a back-end using Sqlite.

Google Safe Browsing v2 API: http://code.google.com/apis/safebrowsing/developers_guide_v2.html

AUTHOR

Julien Sobrier, <jsobrier@zscaler.com> or <julien@sobrier.net>

COPYRIGHT AND LICENSE

Copyright (C) 2012 by Julien Sobrier

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 41:

You forgot a '=back' before '=head2'

Around line 76:

=back without =over