Is ASP better than PHP for large data management?

You could argue Java's better than both of them..

Yahoo's built with PHP... so is Wikipedia, so I wouldn't worry too much unless you're looking to create a site bigger than the worlds largest Wiki (I believe it's the biggest?) :)
 
"large data management" should be the job of the database, not of the code.

Data manipulation in ASP.net is quite powerful with LINQ but PHP's database abstraction like PDO have made DB access quite nice too.

Perhaps you should be asking if MSSQL is better than MySQL for large data management?

Anyway, either stack is capable of scaling and both are battle tested to be able to do "large data management".
 
In what way?

Scripting engines (ASP, PHP and other ilk) versus just-in-time compilation running on a virtual machine (Java, .NET).

As far the OPs question goes I would say both Legacy ASP and PHP are pretty rubbish at "large data management". The scope for optimisation is quite small.

And I can guarantee you if Facebook could rollback time by about 8 years then they would ditch PHP in a heart beat. They have entire departments just focused on ironing out the flaws in PHP. And you can bet they have plenty of critical backend code by now that isn't even PHP at all.
 
Last edited:
Facebook is coded in PHP, but converted/compiled to one of the C languages I believe? But either way, I can't see there being any issues

Yeah, a few years a go they just ran PHP now they convert it from PHP to c++ then to machine code. apparently cut their processing usage by about 50% which I'm assuming is millions of dollars on a scale like that.
 
Depends what sort of data management you mean. If it's holding large amounts of data in memory and "doing things" with it; manipulations, pivots, abstractions, cubes, sorting, searching, aggregating, etc... then neither PHP nor ASP are particularly great in terms of memory management/efficiency or speed of processing. You'd be better off with ASP.Net or some sort of Java J2EE implementation. And then shoot whoever decided to do all of that with ASP/PHP as those processes are much better served by being done natively in wherever they are stored.
 
Facebook developed HipHop: https://github.com/facebook/hiphop-php to transform the areas of their code base that doesn't change much into C++ modules.

And no, they wouldn't "ditch PHP in a heart beat." They have repeatedly stated that PHP is their deliberate language of choice and are sticking with it. For one, they are massive advocates of open-sourced tools.

See here for such an example from 2006 about their dedication to "openness": https://blog.facebook.com/blog.php?post=2223862130
Here from 2010 about their dedication to PHP (and HipHop): https://developers.facebook.com/blog/post/2010/02/02/hiphop-for-php--move-fast/
 
Last edited:
your own URL said:
Since 2007 we've thought about a few different ways to solve these problems and have even tried implementing a few of them. The common suggestion is to just rewrite Facebook in another language, but given the complexity and speed of development of the site this would take some time to accomplish. We've rewritten aspects of the Zend Engine — PHP's internals — and contributed those patches back into the PHP project, but ultimately haven't seen the sort of performance increases that are needed. HipHop's benefits are nearly transparent to our development speed.

Hacking Up HipHop

One night at a Hackathon a few years ago (see Prime Time Hack), I started my first piece of code transforming PHP into C++. The languages are fairly similar syntactically and C++ drastically outperforms PHP when it comes to both CPU and memory usage. Even PHP itself is written in C. We knew that it was impossible to successfully rewrite an entire codebase of this size by hand, but wondered what would happen if we built a system to do it programmatically.

It seems deep down that they consider a rewrite in another language as the absolute best technical decision but not the best business decision. Which is fine. All I said is that if they could roll back time they would have chosen their stack more wisely. It's too late now which is why they've resorted to hacks.
 
One of the key values at Facebook is to move fast. For the past six years, we have been able to accomplish a lot thanks to rapid pace of development that PHP offers. As a programming language, PHP is simple. Simple to learn, simple to write, simple to read, and simple to debug. We are able to get new engineers ramped up at Facebook a lot faster with PHP than with other languages, which allows us to innovate faster.
Yup. I read it. They love PHP.
 
I would think ASP and PHP have much the same performance due to them just being scripting languages, performance improves once you start using stuff which is compiled. I guess it kinda boils down to ease of use vs performance, something like:

PHP/ASP = slow+easy to use
C/C++ = fast+slightly harder to use
assembly = extremely fast+very hard to use

So facebook should skip rewriting in C and do it in assembly instead :P they wouldn't be able to easily make adjustments then either though :(
 
Why do you need to stick to one language? If I were approaching a large project then I'd be looking at the best language for the presentation layer and then the best language for the actual logic itself. For example PHP to drive the web pages and Java as the back end (just examples - you could substitute other languages for each). The point is that you choose the best tool for each part of the job.

But, of course, one consideration is the hosting that you have and that may well drive your decision to use a single language.
 
Why do you need to stick to one language? If I were approaching a large project then I'd be looking at the best language for the presentation layer and then the best language for the actual logic itself. For example PHP to drive the web pages and Java as the back end (just examples - you could substitute other languages for each). The point is that you choose the best tool for each part of the job.

But, of course, one consideration is the hosting that you have and that may well drive your decision to use a single language.

This.

And this is what Facebook does. They just don't admit it publicly as for some reason they think propping up the reputation of PHP (almost singlehandedly) is more important. Vested interests can be nasty.
 
Question doesn't make much sense. That's usually the job of some sort of DB.

If it's a load of data in Memory, I'd say use a strongly typed language either compiled or interpreted. Languages with Variants / weak typing are suboptimal.
 
Back
Top Bottom