View Full Version : cakePHP vs RoR for a browser-based game?
Solistus
May 29th, 2008, 01:56 PM
I have a long-term project to create a browser-based RPG. It will be heavily database driven; user and character records, combat states for ongoing fights and all monster, item, skill, etc. data will be in a SQL database (another side-question: MySQL or postgreSQL?). The code will be OOP, MVC and oh so sexy ;)
I have minimal experience with cakePHP and have yet to learn RoR. I plan to learn both eventually, and I'd like to use this project (if and when I get to it) to learn one of them. Which one would be better suited for such a project? I'm sure either could do it just fine, but which will perform better if and when server load becomes an issue? There will be a lot of SQL querying and data crunching for very active user. Caching won't help much, as most pages will involve at least one fresh query for the dynamic game data. There won't be lots of sorting through huge rowsets from large SELECT queries; more like a lot of single- or limited row SELECTs and single row UPDATEs. So, which will perform better, assuming both are coded properly?
Charleh
May 29th, 2008, 02:10 PM
I have a long-term project to create a browser-based RPG. It will be heavily database driven; user and character records, combat states for ongoing fights and all monster, item, skill, etc. data will be in a SQL database (another side-question: MySQL or postgreSQL?). The code will be OOP, MVC and oh so sexy ;)
I have minimal experience with cakePHP and have yet to learn RoR. I plan to learn both eventually, and I'd like to use this project (if and when I get to it) to learn one of them. Which one would be better suited for such a project? I'm sure either could do it just fine, but which will perform better if and when server load becomes an issue? There will be a lot of SQL querying and data crunching for very active user. Caching won't help much, as most pages will involve at least one fresh query for the dynamic game data. There won't be lots of sorting through huge rowsets from large SELECT queries; more like a lot of single- or limited row SELECTs and single row UPDATEs. So, which will perform better, assuming both are coded properly?
Surely dynamic game data is only as dynamic as the parameters you enter - so you should be storing SQL as stored procedures and passing in parameters rather than putting SELECT statements into page code - then you get the benefits of pre-compiled queries and execution plans.
ahmednuaman
May 29th, 2008, 03:39 PM
If you're taking the PHP route, use CodeIgnitor: http://codeigniter.com/ (It's much easier, lighter, nicer than cake)
evildrummer
May 29th, 2008, 07:01 PM
^ Pointless without arguments. Easier in what way? I don't think so. Lighter? For some things maybe.
I would ask these things:
1) What if your experience with PHP and Ruby? - You have to know the base language for the framework
2) What is the timeframe for this app? If you don't know Ruby and it's a short timeframe then you've answered your question.
3) Do you have a server? Does it support RoR (at good speeds)?
4) How much traffic are you planning on getting? For most low end and medium servers a CakePHP app will be able to handle more request then a RoR app.
Personally I would say out of those two options go with CakePHP.
This is coming from someone who loves both, uses neither at work (codes without a framework in PHP) and uses both at home. CakePHP is great for people knew to web frameworks as it's easier to install on a server and have run smoothly. It's also pretty easy to learn. Just make sure you use the new 1.2 betas.
My reasons against using CodeIgniter (from suggestion above):
1) If your knew to PHP then CodeIgniter will be more work, theres no bundled theme system
2) models are more work
3) and it's more like a bunch of libraries then a single framework.
Hope this helps
ahmednuaman
May 30th, 2008, 05:55 AM
Well looks like I got told, nevertheless, the whole "which framework is better" argument isn't one worth doing. Personally, I found CI works well for me. 'evildrummer' prefers Cake, and some will. If you've got the time, take note of all these factors and see which one works for you. Once you understand the basic principles, you can then migrate and move amongst languages and frameworks.
simplistik
May 30th, 2008, 11:06 AM
well, i'd say try using RoR. As a PHP developer there's a lot of areas that PHP in it's "structure" that it could tighten up. which is why people use frameworks a lot. But Ruby code and syntax is really nice, really clean and easy to understand as well. I'm personally not a fan of RoR, as I'm so familiar w/ PHP and versed in it, but I also don't use a readymade PHP framework such as CI or Cake, we created our own.
:lol: evildrummer you need to post using a framework to help fix your grammar and spelling errors holy begeezus
evildrummer
May 30th, 2008, 12:02 PM
[ot]
^ Yeah, I was in a bit of a hurry and started changing sentences around but instead of actually changing them I just hit enter in the middle, lol.
[ot]
joran420
May 30th, 2008, 04:52 PM
imho using a framework for php work is pointless as its fairly trivial to implement most of the stuff that frameworks do at a low overhead. and more readable than framework code.
Ive used cakePHP and while it was kind of cool and nice overall i could have probably halved my developement time if i had just made my own.
Esherido
May 30th, 2008, 05:23 PM
^ :lol: I've compared some of my non-framework code to some of my framework-based PHP code and I found the frameworked code to be much more easy to read and understand. I'm a CI fan, mainly because, like Stuart (evildrummer) said, it's more of a big bunch of libraries and helpers than an actual framework, which suits my style perfectly. If you're looking for something highly regimented and organized go with Cake, if you want something that's light and will let you do it your way, go with CodeIgniter. And if you're going to be handling a bunch of requests like an MMO would, you'd definitely want to go with PHP unless you had a giant, optimized Rails stack waiting for you.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.