Skip to content
reezer edited this page Mar 6, 2011 · 15 revisions

Database support for Mojolicious

Mojolicious is a fast, lightweight framework without any dependencies to further modules except the core modules of your Perl distribution. Therefor it doesn't include any database storage methods except those which are inside the core modules already like dbfile. If you look for a more complex database engine you should keep the simplicity in mind. Pulling DBIx::Class for database operation inside your webapps is totally fine with Mojolicious, however, it has a pretty decent number of modules it depends on. If that's not an issue for you that's totally fine, go ahead. If you need to keep an eye on your dependencies and your environment (like shared webspaces) you should choose a different option.

ORLite is a small OR mapper based on SQLite, see the short introduction in this wiki.

CouchDB

http://couchdb.apache.org/

CouchDB is a nice option as Mojolicious is able to work with JSON well. Check out the documentation inside this wiki about examples of CouchDB and Mojolicious.

Membase

http://www.membase.org/

Membase is a NoSQL database which basically is a memcache daemon with a persistent data layer. It supports clustering and replication. The membase database uses the memcache protocol (binary and ascii) as API. Any memcache client will work. The feature set is limited so far.

Redis

http://redis.io/

Redis is another NoSQL database which plays well with light frameworks. A pure Perl client is provided, too.

Kyoto Cabinet and Kyoto Tycoon

http://fallabs.com/kyotocabinet/ http://fallabs.com/kyototycoon/

Kyoto Cabinet and its database server Kyoto Tycoon may also be viable NoSQL databases. While there are no Perl bindings for the latter yet its RESTful HTTP interface can be easily accessed using Mojo.

Clone this wiki locally