Posts Tagged ‘database’

Walled City: Database, profiles, design and security

Server farm
Image courtesy of richardmasoner

Walled City has a new release that brings a number of substantial back end changes.

The largest change to the back end is a move to a more modular architecture. We decided to use the MVC style design pattern common in web applications. This will allow us in the future to reduce the chance of breaking interdependent things and to quickly add new features because of code reuse and the modular nature.

Secondly we migrated the database back to MySQL for the forums. We had been using CouchDB for a short bit. The reason for moving back was due to the stability and depth of MySQL. As well as using it for all our other data back ends. CouchDB was nice, but the unstable nature of the still developing project made it unwise to use when changes between versions broke Walled City. CouchDB is also such a specialized data store that using was in fact a form of premature optimization, something I’m trying to stay away from. All this was the deciding factor in using MySQL.

We have made some sublet changes to the layout of Walled City’s forums to help give some depth and ease the eye’s movement around the page. In addition some changes will help in navigation.

There is a new profile page for each user which will be their username after the domain name. (ie: http://walledcity.com/3jane ) The profile now only lists the Legend’s name and how long it’s been since they’ve registered.

To improve security and prevent forum spamming we have added reCaptcha to the registration process. This will make it harder for automated bot attacks. For now we hope this will suffice and there won’t be a need to add it to the posting and reply forms themselves.

Lastly a ton of little bugs were fixed that improved usability and security.

Walled City: Database changes

It took a couple of weeks longer than I would have liked but Walled City has a new release.

  • MySQL has been dropped and couchDB is the new database for the forum.

CouchDB and malformed URLs

CouchDB chokes on malformed URLs. This request works in Firefox but not curl or when called from a PHP script. The problem is that the space after the comma in the endkey is not properly encoded. The solution is to remove the space.

localhost:5984/db/_design/forum/_view/postsbak?startkey=["forum/test_page_1"]&endkey=["forum/test_page_1", {}]

Luckily the CouchDB team know about this (Doesn’t gracefully handle malformed URLs) and hopefully will be fixing it soon.