Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is CodeIgniter a wise choice for large applications?

I keep on reading how great codeigniter is from a development standpoint. And I am sure that using the framework will make the development process quicker. But the question I ask myself is, will there be a difference to a individually made framework, which caters to your needs?

Is CI, despite the advertised small footprint, going to "bog" down the system because it is basically a framework on a framework (the later referring to PHP as framework of C)? Are there good ways to spread the load? Are there any large applications in the wild that have been made with CI?

Thanks Casper.

like image 757
Joseph Avatar asked Jul 22 '09 11:07

Joseph


People also ask

Is CodeIgniter good for large applications?

Many big applications are beautifully supported by Codeigniter and are performing flawlessly for long, like Freedcamp and Buffer. Codeigniter is a PHP based framework that has an MVC structure.

Is CodeIgniter still relevant in 2021?

CodeIgniter is still exist but the name of this framework has become synonymous with a low-quality solution that is why we advise you Laravel as a better alternative. Both Laravel and CodeIgniter are open-source PHP framework.

What are the disadvantages of CodeIgniter?

Lacks Exhaustive Libraries But the libraries provided by CodeIgniter are not as exhaustive as the libraries provided by modern PHP frameworks. On the whole, CodeIgniter is a lightweight web framework. It lacks some of the robust features provided by modern PHP frameworks like Laravel.

What is better than CodeIgniter?

Ultimately, Laravel is a better framework than CodeIgniter majorly due to the coding pattern which is the most favored for its elegant look. Along with this, it also supports robust application development in no time.


2 Answers

I'm running a codeigniter site with about 11K files.

I've heavily modified the codeigniter's basic structure for my needs. For instance, I have 3 applications with 3 front controllers using the same system files. I'm using smarty as my templating engine. I have rich PHP web apps powered by jquery and prototype/Scriptaculous. I use form validation, authentication, active record, emailing, etc. etc.

My experience so far has been very positive.

Once you get a (real) templating engine like smarty plugged into Codeigniter you have all the power that you'll need for medium to large sites.

You have to think about organizing your site into large 'metagroups' as the 'controller' structure in Codeigniter expects such behavior. ('blogs', 'merchandise', 'forums', etc..)

CI is very easy to add plugins for.

The framework simplifies a lot of crap you would otherwise need to hand code. It's fast, simple and configurable.

My one big complaint with CI so far is that it's not very multi-application aware. The default layout assumes you're running 1 application. In my case, I have a global application with the global file that can be pulled into all running applications. However, this could be solved more elegantly. Additionally, you have to add a little extra fluff to switch between front controllers.

My favorite aspect of CI is easy of active record on a MySQL DB. It's dead simple to set up a DB connection and get active record queries running.

I would say that it's pretty easy to get started with. Just make sure you shop around and figure out how to plug smarty into your app. You CAN use the default 'view's of Codeigniter, but the minute you need if/else logic in your templates you're screwed.

I set up a 'templates' and a 'content' area in each app that I can fill with smarty templates and static content respectively. The rest I can pull from a DB connection.

like image 81
ascotan Avatar answered Oct 05 '22 13:10

ascotan


This really is a question that only you can answer. When you speak of a "large system", you could mean something largely used (by pageviews / etc.), or something that encompasses a huge set of business rules but used only by a few people. Does the application need to be fast, or can you load balance it across multiple servers?

Your "PHP is a framework on C" comment is fairly out of whack, IMO. No, PHP isn't as fast as C. But it's a LOT better at handling web requests. PHP is used in some of the biggest sites in the world -- Facebook was originally written entirely in PHP. Yahoo uses PHP quite a bit. So PHP is fast enough for just about anybody, especially considering that the database will almost always be your bottleneck. If your PHP applications are slowing, you can use memcache / load balancers / put more application servers on your network. Pretty easy to scale the PHP end of stuff.

What I can tell you is a brief comparison with other frameworks. I've used CI in limited deployments, mostly helping out other people, but what I have seen, I've liked. It gives you a speed-in-runtime advantage over something like CakePHP, but it will increase your development time (as Cake's biggest strength is its ability to rapidly develop and deploy). Speed-wise it feels pretty comparable to Zend or Symfony, which is still about 5-7x slower than just writing the raw PHP yourself.

To sum the various frameworks (NB: my opinion below):

  • CakePHP is great for rapid development. Its performance is the worst of the major frameworks, although the 1.3 release (coming soon!) is supposed to get you a free (no changes in the API, they're just removing the PHP4 support) 25% speed boost. It's focused on ActiveRecord, and is super fast to get a full featured site up and running (seriously, seriously Rapid Development / Prototyping chops).
  • Zend is the most widely used. It has the most flexibility with its adding modules. It's super fast, although not particularly lightweight. For an enterprise project, I'd go with this one or symfony. Feels like using a buncha different libraries to me. And their naming conventions are a little onerous...
  • Symfony - see the Zend comments. Although symfony is supposed to be even more enterprisey.
  • CodeIgnitor is the new hot kid on the block. Its focused on staying out of your way while still being a "framework", i.e. a tool that will help you do your job faster. It's fast to run, but a little slower to develop.
like image 38
Travis Leleu Avatar answered Oct 05 '22 15:10

Travis Leleu