No time to wait http://showmetheco.de/index.rss Just code Twist 0.1 Using Perl, Mojolicious and Redis in a real world asynchronous application http://showmetheco.de/articles/2011/1/using-perl-mojolicious-and-redis-in-a-real-world-asynchronous-application.html Mojolicious is a growing modern Perl web framework which is ready for building real world applications. Today we will consider architecture of http://check-host.net which is built on top of Mojolicious modules.

Redis is a powerful key-value database that allows you to create fast and lightweight applications. You can learn more about using Redis in Perl from other my article http://showmetheco.de/articles/2010/11/mojox-redis-an-asynchronous-redis-implementation-for-mojolicious.html. Building asynchronous applications allows you to avoid using threads, so such applications tends to use less memory and human power to deal with all their complexity.

Keep reading ]]>
Perl Mojolicious Redis async Fri, 14 Jan 2011 00:00:00 GMT http://showmetheco.de/articles/2011/1/using-perl-mojolicious-and-redis-in-a-real-world-asynchronous-application.html
Mojolicious, Async::ORM and DBSlayer http://showmetheco.de/articles/2010/1/mojolicious-async-orm-and-dbslayer.html After experimenting with Redis in Mojo (http://github.com/vti/mojox-socket_stream) I wanted to do something asynchronously with DBI also, using my another Async::ORM module. But apparently doing async with DBI is not that easy. By itself DBI blocks everything and thus there are a few workarounds on CPAN with forks, sockets and pipes like AnyEvent::DBI, POE::Component::EasyDBI, POE::Component::SimpleDBI, IO::Lambda::DBI and others. That is why I have AnyEvent::DBI driver inside of Async::ORM. But I wanted to use Mojo::IOLoop as an event loop.

Writing another forking hack module is cool but I am not that smart, that's why I googled with a hope to find some event loop independent async DBI. And I found dbslayer (http://code.nytimes.com/projects/dbslayer/wiki). DBSlayer is a proxy between HTTP+JSON and MySQL. You send your SQL query as a GET request in JSON format and get JSON response. So what I needed is a http client that can send json requests and parse json responses. Mojo has got both.

See more code ]]>
Perl Mojolicious async orm dbslayer Sun, 31 Jan 2010 00:00:00 GMT http://showmetheco.de/articles/2010/1/mojolicious-async-orm-and-dbslayer.html