views:

398

answers:

9

I am developing a big application using PHP. Is MySQL or SQL Server the best one to use?

+2  A: 

MySQL and PHP work well together. I'd recommend that combination.

I'd much rather choose an open-source solution rather than rely on MS. That said, you can go with PostgreSQL as well if you need to, or your requirements gear you toward it. We would need more details to know what you truly require.

Sev
yes, PHP/MySQL works well tgt. somehow i also see apps developed using PHP/MSSQL or ASP/MySQL ... i feel the "logical" pairs are PHP/MySQL or ASP.NET/MSSQL
iceangel89
I don't see how they work together better than PHP/MSSQL. The only thing I can think of is there are less tutorials and less support around for using MSSQL with PHP, but that's not a big deal if the OP knows what he's doing.
musicfreak
+1  A: 

While this is a bit subjective, I would suggest going with MySQL.

The reason I say this is because traditionally you see people go with a LAMP setup. LAMP of course being Linux + Apache + MySQL + PHP

PHP has some great build in functionality for dealing with MySQL Databases, therefore it may be easier for you. Then you'll also have the ability to do some web based work with PhpMyAdmin tying a web interface to your Database

PSU_Kardi
+6  A: 

Neither. Use PostgreSQL. :)

Honestly though, PostgreSQL scales much better than MySQL. I don't know what you mean by "enterprise", but I figure scaling is important for a "big" web application, as you put it, and PostgreSQL does that very well. MySQL can't handle too many concurrent connections. (Though if that isn't an issue for you, go with MySQL for ease of use.)

musicfreak
A: 

For most IT directors a big decision is going to be which can you get the best support for in your area / online / already have in-house and which can you get the most uptime for. Ongoing costs are usually higher than deployment costs so its probably not worth worrying about license costs; unless you are into ia64 or better type systems anyway when the CPU count starts to make SQL look eye-wateringly expensive.

u07ch
A: 

It will depend on your application's needs. I'm not especially well researched on the differences between the various SQL engines, but as far as I know, MySQL is faster for SELECT queries (if you have a predominantly read-only type app). On the other hand, MSSQL and PostgreSQL both have better support for transactions, and perhaps also better performance if you have lots of inserts/updates happening. Also, MSSQL and PostgreSQL are said to scale better, but there are various successful applications that seem to do fine with MySQL (Facebook and Flickr as examples).

Jimmy
+1  A: 

Use the one you and your team has most experience in terms of both development and administration.

If you start from scratch, I would go with PostgreSQL.

Between your choices I would go for SQL Server, especially if you are working in Windows environment.

van
+1  A: 

MySQL and SQL Server Express are free for production use. In my view the best advice is to try them both and decide for yourself. A lot of folks can live quite happily with a lightweight RDBMS where solutions like MySQL/Express may be appropriate.

From a purely technical point of view all of the major RDBMS vendors (Oracle, Sybase, DB2, SQL Server et al.) are significantly more capable than MySQL is currently or can reasonably be expected to be in the foreseeable future.

This does not mean you should not use MySQL for a particular job. A good analogy is continuing to use a version of Microsoft office released years ago. For most people the old version does everything they would ever want even though the newer version is "better" and has more features.

Einstein
A: 

It's like deciding what computer to get, they are by now pretty much the same no matter what brand you pick. It's pretty much the same for databases, they all support most of the things that you need for lightweight webapplications.

I have used MySQL to all my php applications so far and had no problems whatsoever. I have wanted to test out PostgreSQL several times but never got to it, but I have heard very good things about it. I never touch MS products however, so no opinion (Not that I am allergic, I'm just stingy.).

The Fairy
+1  A: 

MySQL is certainly better to work with PHP. But MS is putting a huge effort in better supporting PHP on Windows platforms.

SQL Server is DEFINITELY the better choice for large enterprise solutions since there's better cluster and management support. We use MySQL for cost reasons, but i would really like some easier management and cluster support.

On the other hand it's like with computers: many features you need to compare if they suit your needs - and your purse.

If you are doing a one-man-show: Step away from SQL Server. It is only suitable for enterprises. Take MySQL or PostgreSQL.

Structed
Would you say that SQL Server Express is only good for enterprises?
John Saunders
Nope. I did speak about SQL Server, not SQL Server Express - sorry for not making that clear. MS SQL Server Express is good for beginners and hobby programmers. But if you like to manage huge amounts of data, use multi-cpu systems and so on, you need to go for a "full scale" DB-system like SQL Server, MySQL or PostgreSQL.
Structed