HN user

jstin

59 karma
Posts7
Comments10
View on HN

This article conflates programming and making a product. The example of creating 'an app that would save the planet' most likely has little to do with who programmed it, and more to do with what it is, and how it is applied in the world.

I've been using the CanCan(Can) gem to handle all permissions logic, both in controllers and views. It abstracts all user state logic to a single file https://github.com/CanCanCommunity/cancancan

I find this pattern to be the most manageable especially in large projects.

But I agree with your point. "if current_user" is miles better than "if current_user.name != 'Guest'".

Edited to add: As far as this articles use of current_user.name being guest, it makes sense to use a presenter to display the data in the view. Conditionally displaying a user name or 'Guest' in a view is kinda gross. Again I'll suggest a gem for this pattern https://github.com/drapergem/draper

All objects coming into the view should be wrapped, especially and ActiveRecord objects.

Heroku sells convenience, and resells EC2 instances to you. Their previous dedicated database option, Ronin, cost $200/month. When you connect the dots that this DB has a 1.7GB cache and that a small instance on EC2 has 1.7GB memory[1], you start to realize what you're really paying for.

While paying 3.3 times more[2] may be ok for the added simplicity, you have to wonder if your 'dedicated' database is really just a small instance on EC2? If it is a larger instance, then you are sharing it with other users.

However, even a small instance is far from not being shared. EC2 has performance issues, especially small instances. Disk IO is the worst.[3]

Disclaimer: These are all just my observations, and I don't how Heroku actually configure their Ronin databases. I'd love to be proven wrong, and to have someone from Heroku explain. But from personal experience with both EC2 and Heroku's Ronin database, if my conclusions are wrong, the results are not. I've seen very slow performance on the simplest of queries on both configurations.

[1] http://aws.amazon.com/ec2/instance-types/ [2] http://aws.amazon.com/ec2/pricing/ [3] http://www.frederico-araujo.com/2011/12/27/why-ec2-still-sux...

I have used riak in a production app. Just recently switched to redis.

Riak was great for the most part. There were three nodes running on three different machines. Setting up a new node is a breeze. Eventually there become a data inconsitancy between the nodes that couldn't get resolved, and would happen intermittently.

When this happened, any sort of map reduce operation would fall. Individual keys could be requested, but only from a node that had the item.

In addition, removing a node in this inconsitant state was a no go. The other nodes would stay in the inconsitant state for good.

Interestingly enough, this only happened on certain buckets. There was a logger bucket that had keys updating and being created all the time that never had an issue.

Perhaps it was a bad configuration on our end...