Laravel or Phalcon for a heavy-traffic site [closed] - php

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I come from a Codeigniter background. I've used it for three years and really like it. It's simplicity is great.
I've built massive sites with Codeigniter, but I'm looking for a new PHP framework to learn.
The main reason for this change is a potentially big project on the horizon. It will not have many users (perhaps 100 at most), but the outbound traffic produced by the server will be huge. The project will transmit thousands of files (ranging in size from 1mb to several hundred mb) via FTP, one after the other. It also deals with users uploading hundreds of files.
The key for this project is speed. The system needs to fly through the running of the scripts (it runs a long script every time a file is sent via FTP to gather the file, it's type and it's destination) as quickly as possible to minimize performance issues. I'm aware that the transmitting of the files will only be as quick as the server can do it, and really as quick as the slowest bottleneck, but here I'm trying to minimize the bottleneck in the code as much as possible.
After a bit of research, I like the look of Laravel and have installed it to get to grips with it. But it's could its speed be an issue as its been tested to be slower than Codeigniter? Will heavy traffic and a lot of PHP parsing slow down the I know that Phalcon is based on C thus making it the fastest framework, would Phalcon be the better choice?
Any thoughts are much appreciated :)

I am unsure if your question will be taken down as it being an opinion (you know according to guidelines and all)
but IMO - despite Phalcon being fast for its C build, I find (being Laravel 3 user transitioning from Codeigniter before it retired) with Laravel 4 now - it has a lot of integration with known networks and architectures.
Not to bash Phalcon as I have very minimal usage of it but here are some bullets for Laravel:
Easily modular with composer: all packages can be imported in with the current PSR standards from composer for rapid deployment of dependencies which Codeigniter was lacking.
It can follow any style you want it to be: PSR-0 and PSR-4. It's a natural MVC but you can easily go with TDD(or BDD), and other format. Though this is a poor bullet to some but it offers a lot of flexibility on adapting to various works.
IoC is built into the APP. Its very comprehensible and extensives in order to utlize IoC
Taylor Otwell is very active in adjusting and fine tuning the framework. Its a very active thriving community (Laracon NYC just passed, next up Laracon Amsterdam), so you will not be shorted with support.
A lot of know application out there are pre-integrated with the framework from Queues (beanstalk, IronMQ) to mailers (swiftmailer), and even Cache systems (Redis or others). The interface is straight forward in terms of functions - worse case? just extend and you are ready to roll out.
Readability: a lot of the structure and how the ORM (if you choose with the native ORM of Laravel which is called Eloquent) is all about readability of your code despite the underbelly being complex. So it will scaled right (a lot of people who switched over states the same).
Some further readings from those who switched over and wondered like you:
http://www.web-and-development.com/laravel-vs-codeigniter/
and
http://mulzer.tumblr.com/post/24141993116/12-reasons-you-should-switch-from-codeigniter-to
Now a bullets for Phalcon vs Laravel in speed:
With Laravel + APC + a few other tweaks you can achieve something close to it while giving you all the flexibility that you gain from Laravel.
Finally if you need a side by side comparison:
http://vschart.com/compare/phalconphp/vs/laravel

If it's just about speed take a look at this benchmark:
http://systemsarchitect.net/performance-benchmark-of-popular-php-frameworks/
I would def go with phalcon since it's created on c level basically the same as if it is php itself.
EDIT:
As of the writing of this edit, the site mentioned above is non-functional. Below is a snapshot from archive.org:
https://web.archive.org/web/20160329072449/http://systemsarchitect.net:80/2013/04/23/performance-benchmark-of-popular-php-frameworks/

Related

Is Laravel right choice for my project or some other is better [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
We are planing to make a new system to replace our 10 year old system, in doing so we are considering to make the new system in Laravel. Now I have concerns I will have to hack the whole thing and make it a mess to make it work as we wish. So I am asking if someone knows a better solution for it, or can tell that it is already made in it.
we need:
ftp, sftp, which are cron triggered.
mail daemon which is cron triggered.
easy way to implement multiple factories and easily to encapsulate them (i am thinking to use the model part for it)
easy possibility to switch the global database connection
inter server connectivity
caching functionality like memcache built into the database layer and object layer
possibility to tell the framework which pulls get stored in cache
an easy Templating system, ye i know i can make one easy, but some which is already done in Laravel would help :)
we have our own servers so module installations are not a problem.
Unit test implementations on factory based systems.
All suggestions are welcome, if i am by any chance in the wrong stack overflow part please just say in which section i should move it. Thank you in advance for all feedback :)
UPDATE->
The requierements above are minimum requirements for us/me to consider the framework good enough. If somone is able to point to tutorials how to do the stuff with laravel. Please provide links. In special Unit testing Laravel controllers, cron setup from Laravel... and so on..
This is truly a question only to be answered by you and your team (in terms of effectiveness, language understanding and framework pattern knowledge).
Laravel can surely withstand such projects and migrations but most of the frameworks out there can do, personally I've been using Laravel and Cakephp in terms of PHP frameworks and find both of them quick, efficient and easy to use (with Laravel code a bit more easily to read through large projects).
On the other hand there are frameworks out there which efficiently do what you need quicker and easier than most php frameworks, django (python) is one example, stable, lightning fast development (if you are already familiar with python concepts) and proven (instagram, disqus etc).
Nearly all frameworks have known RDBMS support, but are a bit back in terms of NoSQL support (yet you can find plenty of projects that provide support for NoSQL), Laravel can easily switch DB's but compared to the "DB router" feature of Django I believe it feels a bit behind on how much detail has been put to it.
Laravel is a beautiful framework, but this isn't a stackoverflow type question. None of us will be able to really give good advice, other than say Laravel is good.
Let me refine the question. I am not asking for opinion if i am using the right framework, i need some hard data.
I already know Zend 2 (working with it 1.5 years) and it is to bulky and to developer footprint heavy for our project(our logic would have to be developed into the damn thing... just not practical).
I already work with Cake, and it is to simple for us,
Symphony i know to, but it has BIG problems with our structures.
Code igniter is.... to simple... and so on and on...
I am currently reading trough Code Bright Book for introduction of the possibility's from Laravel. And i am half trough. But i have not found anything that tells me it can help my project with the points which are pointed out.
So i am asking again, i need examples of the points implementations in its simplest way for comparison. except in Zend, Code Igniter and Symphony.

RESTful webservice with Silex PHP : good choice? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I have to create a REST API for a mobile application and I don't really know how to begin it.
I read some articles and tutorial about REST in general, but I didn't find a complexe API example written in PHP.
So after more researches I choose to use a micro-framework (rather than start from scratch). A full framework like Symfony2 or Zend provide some methods that I will not need, and I think they are too big for.
Because I already worked with Silex PHP, I choose it.
But one question stay in my mind : is Silex a good choice to create a (future) big API ?
The API will evolve and could be more and more complexe (understand more URI will be avalaible in future, because we have goal to migrate from SOAP to REST).
Since Silex PHP uses a single file convention, I'm a little scared to use it (because file will be more and more larger, and I supposed with performances falling).
Also I would like to cache on server results (additionally with HTTP caching) when necessary, to reduce queries to database (MySQL).
What do you think and what do you advise ? :)
Silex is not a bad choice for building out an api service. I would recommend maybe starting with Silex Kitchen Edition for some decent organization and other useful configs and strip out what you don't need. Also, I would look for existing restful projects written in silex/symfony. As far as scalability you should read this post from Igor Wiedler one of the creators of silex.
Silex is a microframework meant to be used in small projects. It's suitable for small websites with low traffic. It is also a good way to introduce yourself into some concepts like dependency injection, without introducing too many abstraction layers.
They've recently introduced the target in their website as "single-file apps", giving you a bit of the target scope for the framework.
I think it should be fairly accepted fact that Silex is not suitable for anything big.
Silex will not perform badly if your project works, but it will not be the nicest to work with once you start growing, as it will not help you too much. Symfony uses concepts you'll see in Silex and is a full stack framework you can use for bigger applications with lots of bundles, plugins and a big community there to help you.
Edit:
Note I cannot delete the answer as it has been accepted. I haven't used PHP in years now, since then, Silex has changed their approach from "microframework" to being just a library it seems. Whatever the case, the down-voting I believe must come from people involved with the project, probably upset of having created something which didn't take off as they may have hoped.
Just read the product docs, this was a request for an opinion which was given and accepted. I don't think this question belongs to stackoverflow anyway.

Any disadvantage to using Zend for a very small website [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm using Zend and want to know if there's any disadvantages to using it for a small website. The website is maybe 4 pages: a couple of forms and a couple of static pages.
Will Zend still speed up development for such a small website? or the opposite?
Does the whole bootstrapping flow and MVC structure and routing overburden performance for such a small website?
I see it being useful for a big website serving lots of content, but for a brochure website, does it still make sense to use the framework. It's sitting on the server so there's no initial cost to adding it to the project, but is there performance and implementation issues (maybe longer implementation time) for such a small project I'm not noticing yet?
I'm getting suggestions for other
frameworks. I'm sure Codeigniter,
Kohana, and modx are great, but they
require time to learn their API. I
already know and use Zend so the
choice is between it and plain PHP.
I opt for the framework on nearly all sites.
In my experience, a site rarely stays as small and static as one might think when starting out. Using the full framework on a small site might seem like overkill, but it still assists in rapid application development.
Even if the site - as currently envisioned - is only a few pages, those pages probably share a common layout. So use the layout/template functionality of the framework.
Handling the forms and their submissions is easier in an MVC environment. The framework helps there.
And ultimately I find it aesthetically pleasing to truly separate concerns: bootstrapping, controllers, layouts, views, etc. Gotta put all that code/information somewhere. Why not in a set of standard places?
The most compelling argument against using a full framework for a small site would be if you had to actually "learn" the framework to do it. But since you are already familiar with Zend Framework, there is no learning curve associated to getting up and running; you get the RAD benefits right out of the gate.
In short, I find that it's faster to use the framework and it gives me the firm foundation to grow the site.
It might speed up development, but it might be funny having a 27Mb library on a site with only 4 pages.
Do you really need a framework for a basic 4 page site? You say yourself that a couple of those pages will be static.
This seems like overkill to me. I don't see whats wrong with taking a no framework approach to such a small task.
I'm not sure if this will speed up development either, and a 4 page website (with a couple of static pages) running on bare bones PHP will be much faster then its framework counterpart, that is assuming no caching.
Zend is slower, but (at least in my case) it speeds up development. You can always use Request cache on such a simple website.
Use something like modx for speedy development of such a small site. Just delete all the example stuff and throw your content into the content management system.
I propose this for speed of development. As for performance it is likely slower than a framework like codeigniter.
In response to your edit:
Q: Which will be faster for
development?
A: Which are you more familiar with (Zend or standard PHP)? The final
answer depends on your level of
reliance on Zend to perform standard
php tasks.
Q: Which has better performance for static content?
A: Likely standard
php since you will only call the
libraries you need and no framework overhead.

ezPublish experiences [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
Facing a need for a single CMS we can use for rapid deployment of customized CMS solutions, I am wondering if anyone can share any constructive feedback, experiences, pros and cons of this, seemingly powerful, piece of software.
The whole story/marketing pitch sounds solid, and from a quick glance at the CMS itself things seem to be put together in a coherent and pretty flexible way. I am however looking for first hand experiences as they usually reflect the real situation way better than anything else.
If you have used (or are still using) ezPublish for something, I would love to hear about it.
Thanks!
Having in mind all good points of eZ Publish you should be aware of bad ones. From programmer point of view: Most of the system was written in php4, and was rewritten in a hurry, to make it works with php5. Lack of design patterns and object oriented approach in kernel, makes system hard to develope with, and to read its code. To add some heavier functionality not supplied by CMS, you can use extension system. Problem is programming extensions is slow and painful (documentation only in code). There is quite good technical documentation on www.ez.no but most of it is for webdesigners.
I'v used ezPublish for quite a while and I can say its very flexible and allows a range of different solutions to quickly be developed with it. The ability to add content types is what makes it awesome.
It can be a little bit slow at times, but with proper caching set up it can also be really fast.
The biggest downside: The learning curve is very steep and long, and there aren't enough knowledgeable eZ Publish developers available in North America.
However, from the beginning I've been fond of its overall architecture, which seems to be elegant, flexible and generally well thought-out. Over time, some things have been bolted on in ways that don't necessarily fit perfectly. But it's pretty amazing what you can accomplish with the core functionality, and overriding and extending the core is clean and maintains good separation.
I would say that if you are in it for the long haul and can afford to train your developers (really, you can't afford not to) then eZ Publish is a reasonably good choice. Once you figure out the platform and develop your own kit of tools, it should be fairly quick to deploy custom solutions.
I will also concur with an earlier answer, that the class system really shines. Caching is always an issue, so don't forget to learn the caching system. Your site can fly on eZ Publish, but you must understand caching to make it do so!
I have Used eZ Publish for some years now.
It was quite difficult to learn it at first and understanding the structure, but when you are on the way then everything would be simple and fast, especially with their new kernel on Symfony2.
I would recommend using eZPublish 5, as I suppose you no longer talk about the older versions, only if you have at least some basic knowledge of eZ version4. That is because the admin is still using the legacy and all the settings are done using .ini files which you really have to know. Nothing hard, but learning curve is definitely steep.
Also using eZFlow will require working with both .ini and .yml configuration files, so you need to understand both config structures.
Further on, as I have been at a presentation for the new admin, which unfortunately will be using YUI as JS framework, and having seen the release plan for this year, I can say you will have to keep the legacy admin if you want to benefit of all the functionalities as there is an enormous amount of work to be done to have everything migrated on Symfony 2.
Even with the announcement of eZPlatform(eZ 6), I am not that confident we will have a really STABLE version anywhere this year.

Does anyone write really long, complex PHP apps? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
It's hard for me to imagine a php script that is more than a few hundred lines of code. It seems that, for a non-persistent environment, web-based scripting is usually done is small chunks and used for the purpose of delivering a portion of a website to the end user. I'd like to know if people are developing any type of large, or persistent, or complex apps with php, and what is it exactly you are working on. I've only done small projects for small websites, so I don't know what can be accomplished on a larger scale. It would also be nice to know what libraries you are using, and what other technologies you are integrating with. Please enlighten me so I can start to dream of bigger things!
I would look at some of the well-known open source web apps that use PHP to get a good sense of what can be accomplished, and how PHP is used in each of them. The advantage is that since they are all open source, you can actually look at the PHP code to see how various functionality was implemented.
Some good examples to look at include:
WordPress
TextPattern
MediaWiki
PhpBB *questionable code quality
SugarCRM
Joomla
Drupal
Also look at some of the popular frameworks to see what kind of functionality they offer (this should give you a good sense of what types of things PHP is most often used for):
Zend Framework
CakePHP
CodeIgniter
Symfony
For my day-job we run everything in PHP - our front-end website, our backend for agents and employees, inventory, server control interfaces, etc. These are everything from spiffy new AJAX-enabled Zend Framework apps to legacy code that we haven't ported yet. On top of that we use things like Mantis (bug tracking built in PHP), Mediawiki, and phpMyAdmin.
The only thing that isn't PHP are vendor apps because vendors love Java. The one ASP.NET application we have was actually abandoned by the vendor during the project (not really a knock against ASP.NET, that app was just the perfect definition of a runaway project and would have failed no matter what language it was written in).
With mature frameworks like Zend Framework, CodeIgnitor, and CakePHP creating just about anything in PHP is possible.
The biggest problem developing large scale programs is definitely keeping them maintainable in the long-term. Initially, a program starts out all full of ideal methods and ideas, but keeping the integrity intact, especially, over time fails, in my opinion, more often than not.
In addition, scope creep is your enemy. You HAVE to reign that in ASAP.
As far as large scale programs go the company I work for has a few internal programs constantly under development. One example is our proprietary website engine. It's a very large code-base that includes a dozen modules (user management, survey system, blogs, user galleries, etc) that allows us to build our clients sites rapidly.
We also develop our own internal project management program for managing our clients work.
You should definitely be thinking in terms of scale in the long term. In almost every project I've worked on there's a permission/group element for users involved. You might want to start thinking about the possibilities and issues involved in that and work up to more complicated functionality.
MediaWiki is one of the largest public PHP apps, and it's got very nice code. . I know some larger ones, but they're utterly awful and you'd learn nothing by reading them.
There are lots of complex OpenSource php applications. For example, the Drupal CMS, which can be considered a platform in its own right for developing other web sites.
You can browse through the source code online: http://cvs.drupal.org/viewvc.py/drupal/drupal/
+1 for Wilco
I have a software I use for some of my clients, it's a CMS, Blog, eCommerce beast, the code base is HUGE, but everything cooperates with each other nicely.
My company works on educational software. We've recently started doing web-based content delivery, including video and audio, with the backend written entirely in PHP using MySQL. We have two primary apps, one which lives on our servers and one which is delivered to the customer. One clocks in at ~42,000 lines of code (using a physical line count) and one at ~68,000 lines.
We use PEAR extensively and a recently started project is using the Zend Framework.
We use PHP at our company. (We do online language learning: http://www.livemocha.com. You should go take a look at the site. Yes, it's sort of a shameless plug, but it's also topical. :-) )
I can't give you a precise number of users, but we put out a press release a while back celebrating hitting the 3 million mark. That's a pretty large scale as web apps go.
We build on the CakePHP framework, which is based on an MVC architecture... at least in theory. In practice, they auto-generate certain methods for the models which tend to have the result of pushing some pieces of model code (caching, deciding which DB to use) into the controllers. They also have a few localization issues in 1.2 that make me think this part of the framework hasn't really reached maturity yet. That said, I find CakePHP pretty comfortable to work with overall, and you should at least take a look at it if you're considering implementing a large-scale web app in PHP. It has some excellent documentation available as well (google for "CakePHP bakery").
Get CodeIgniter and rebuild Amazon or Ebay. If you can dream it you can build it in PHP but you might not be able to maintain it because it is so easy to created bad code that works. PHP.net is your friend. Whatever framework you use make sure your read the User Guide and let it guide you.
I can't believe nobody has mentioned the MVC pattern yet. IMO, it's one of the best things you can use to help you maintain large codebases.

Categories