Redis and MongoDB insertion performance analysis

Recently we had to study a software where reads can be slow, but writes need to be as fast as possible. Starting from this requirement we thought about which one between redis and mongodb would better fit the problem. Redis should be the obvious choice as its simpler data structure should make it light-speed fast, and actually that is true, but we found a we interesting things that we would like to share. This first graph is about MongoDB Insertion vs Redis RPUSH. Up to 2000 entries the two are quite equivalent, then redis starts to get faster, usually twice as fast as mongodb. I expected this, and I have to say that antirez did a good job in thinking […]

Remember me in Turbogears2

One of the problems with TG2 is that the current version doesn’t support a “standard” way to remember the user after he closes the browser. We have been able to find a quick and dirty solution that we like to share here. Keep in mind that this solution only works with recent versions of repoze.who, this works with TG2.0.3, but might not work with previous releases of TG2. Inside the login.html we set a cookie for the remember_me option to pass it to the controller and then inside the post_login we change the cookie. Supposing you have a #remember_me checkbox inside your login.html you can add this to set the cookie: function set_remember_cookie() { is_checked = jQuery(’#remember_me:checked’).length; if (is_checked) document.cookie […]

Turbogears authentication over mongodb users database

As we saw that there isn’t a lot of documentation around about how to perform authentication in turbogears over mongodb we decided to create a simple code snippet and public it here to help people trying to obtain the same thing. This is mainly a proof of concept and is quick and dirty way to obtain it. You will probably have something like ming as your model, instead of directly accessing mongo. This code also validates password over the clear text one, you will probably have hashed passwords in your database, so remember to change validate_password method as required To make it work you will have to place this code inside your config.app_cfg, it also expects you to have you […]

ACR gets Slice Templates

ACR is a flexible and quite powerfull CMS library, but users have to learn Slices and Slicegroups to be able to insert more advanced content like photo galleries, videos and a news section. To simplify this process we created “Slice Templates”. Slice Templates are actually a set of common ways to use slices to insert more advanced content. The first two slice templates implemented are: Youtube Videos which make easy to insert a youtube video inside an ACR Page. Photo Gallery which makes easy to insert a photo gallery with cool effects inside an ACR Page. Next template to come will be a news section, for now you can upgrade your libACR and start using the templates feature or take […]