SQL Server 2008 r2 或 PostgreSQL
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6473455/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
SQL Server 2008 r2 or PostgreSQL
提问by BrianKE
I am rewriting an application for my company which requires a database. We are currently using SQL Server 8 and I will be updating the database. My question is which database to use. I have been looking at both SQL Server 2008 r2 and PostgreSQL 9.
我正在为我的公司重写一个需要数据库的应用程序。我们目前正在使用 SQL Server 8,我将更新数据库。我的问题是使用哪个数据库。我一直在研究 SQL Server 2008 r2 和 PostgreSQL 9。
The database will be hosted on a Windows Server 2008 box and will be used for both the stand-alone app and an associated website written in .NET.
该数据库将托管在 Windows Server 2008 机器上,并将用于独立应用程序和用 .NET 编写的关联网站。
Some of my points of concern are:
我的一些关注点是:
- Cost (obviously PostgreSQL wins out here).
- Is it ready for primetime? I have read somethings about it being as good as SQL but would like some input from those using it.
- Ease of use. I am very comfortable with SQL Server. I have been experimenting with PostgreSQL and while it is different than SQL Server I am getting the hang of it.
- Speed. Is PostgreSQL as fast as SQL Server?
- Can I use ADO.NET (.NET 4.0) with PostgreSQL and get the same functionality as Using SQL Server (will be using Linq or Entity Framework)?
- 成本(显然 PostgreSQL 在这里胜出)。
- 准备好迎接黄金时段了吗?我读过一些关于它和 SQL 一样好的文章,但希望得到使用它的人的一些意见。
- 便于使用。我对 SQL Server 非常满意。我一直在试验 PostgreSQL,虽然它与 SQL Server 不同,但我已经掌握了它的窍门。
- 速度。PostgreSQL 和 SQL Server 一样快吗?
- 我可以将 ADO.NET (.NET 4.0) 与 PostgreSQL 一起使用并获得与使用 SQL Server 相同的功能(将使用 Linq 或实体框架)吗?
I will NOT be converting our old database in SQL Server 8 to the new database so I am not concerned with any conversion.
我不会将 SQL Server 8 中的旧数据库转换为新数据库,因此我不关心任何转换。
I would be interested in peoples opinion of the two and if PostgreSQL is an acceptable solution for a business application given the above.
我会对人们对两者的看法感兴趣,以及 PostgreSQL 是否是上述业务应用程序的可接受解决方案。
TIA
TIA
Brian
布赖恩
采纳答案by Steve G
This really depends on your DB size and your comfort zone.
这实际上取决于您的数据库大小和您的舒适区。
SQL Server Express edition is a fully functional freedatabase up to 4GB in size; perfectly adequate for most small to mid-sized apps. (aside - IMHO, MS Licensing was the best thing ever to happen to the open source community!!)
SQL Server Express 版是一个功能齐全的免费数据库,最大可达 4GB;完全适合大多数中小型应用程序。(除此之外 - 恕我直言,MS 许可是开源社区有史以来发生的最好的事情!!)
PostgreSQL is a fully functional, free database w/o the 4Gb limitation - however, PostgreSQL follows the Oracle style of SQL and database management. If you're not familiar with that, you can run into some gotchas.
PostgreSQL 是一个功能齐全的免费数据库,没有 4Gb 的限制——但是,PostgreSQL 遵循 Oracle 风格的 SQL 和数据库管理。如果您对此不熟悉,则可能会遇到一些问题。
Throwing Dot Net into the mix adds a not insignificant wrinkle. Can you use .Net with PostgreSQL? Yes, but Dot Net will work better with SQL Server. Are you comfortable writing complex ODBC interface code? If yes, PostgreSQL remains a contender. If not, you'll be better off with SQL Server.
将 Dot Net 加入混合物中会增加一个不明显的皱纹。你可以在 PostgreSQL 中使用 .Net 吗?是的,但 Dot Net 与 SQL Server 配合使用效果更好。您是否愿意编写复杂的 ODBC 接口代码?如果是,PostgreSQL 仍然是一个竞争者。如果没有,使用 SQL Server 会更好。
回答by Stefan Steiger
Necromancing here.
As pointed out by SteveG, SQL-Server Express is probably what you want.
死灵法术在这里。
正如 SteveG 指出的那样,SQL-Server Express 可能就是您想要的。
But I've used SQL-Server, SQL-Server Express and PostgreSQL extensively, and you should be aware that SQL-Server Express has some more nasty limitations other than just the DB size:
但是我已经广泛使用 SQL-Server、SQL-Server Express 和 PostgreSQL,您应该知道 SQL-Server Express 除了数据库大小之外还有一些更严重的限制:
- Installation requires administrator privileges (and system restart)
- ReportingService Express can only connect to a local database,
- ReportingService Express cannot use other data-sources than the local sql server (no ODBC)
- Some ReportingServices features are missing (e.g. graphs and CSV/XML export formats)
- Constrained to the usage of 1GB RAM (Same in 2008/2012)
- Constrained to a single CPU (newspeak: Limited to the lesser of 1 Socket or 4 cores)
- no Table and index partitioning
- no indexed views
- no database mirroring
- no database tuning advisor
- no notification services
- cannot send email (you might be able to do it using CLR-Stored procedures if you absolutely need to)
- cannot use/call Web-Services (newspeak: no HTTP Endpoints)
- no service broker
- no fulltext and no semantic search (requires Express Advanced Services)
- Profiler tool is not included with SQL Server Express editions. (there is SQL Express profileron codeplex)
- Job Scheduling service is not available with SQL Server Express.
- Data import and export feature is not available with SQL Server Express (can/must be downloaded)
- does not come with SSIS
- 安装需要管理员权限(和系统重启)
- ReportingService Express 只能连接到本地数据库,
- ReportingService Express 不能使用本地 sql 服务器以外的其他数据源(无 ODBC)
- 缺少一些 ReportingServices 功能(例如图形和 CSV/XML 导出格式)
- 受限于 1GB RAM 的使用(2008/2012 年相同)
- 受限于单个 CPU(新闻:仅限于 1 个 Socket 或 4 个内核中的较小者)
- 没有表和索引分区
- 没有索引视图
- 没有数据库镜像
- 没有数据库调优顾问
- 没有通知服务
- 无法发送电子邮件(如果您绝对需要,您可以使用 CLR 存储过程来发送电子邮件)
- 不能使用/调用 Web 服务(新闻:没有 HTTP 端点)
- 没有服务经纪人
- 没有全文和语义搜索(需要 Express Advanced Services)
- SQL Server Express 版本不包含探查器工具。(codeplex 上有SQL Express 分析器)
- SQL Server Express 不提供作业调度服务。
- SQL Server Express 不提供数据导入和导出功能(可以/必须下载)
- 不附带 SSIS
and as said
- 4GB database size (raised to 10GB in SQL 2008 R2 and SQL 2012)
并且
如上所述 - 4GB 数据库大小(在 SQL 2008 R2 和 SQL 2012 中提高到 10GB)
Note that the limit of 10GB is neither 10GB nor 10 GiB (10 * 10243), it's actually 10'240 MB (10 * 1'024 MB), which is actually only 95% of the 10 GB that I'd have interpreted as 10GiB (10'240'000'000*100/10'737'418'240)
请注意,10GB 的限制既不是 10GB 也不是 10 GiB (10 * 1024 3),它实际上是 10'240 MB (10 * 1'024 MB),实际上只是我所解释的 10 GB 的 95%作为 10GiB (10'240'000'000*100/10'737'418'240)
Add to this the limitation that Microsoft-SQL-Server will only ever run on Windows (to date, Linux-port of SQL-server is now coming, but only as CTP so far, and without BI).
再加上 Microsoft-SQL-Server 只能在 Windows 上运行的限制(迄今为止,SQL-server 的 Linux 端口现已推出,但到目前为止仅作为 CTP,并且没有 BI)。
So to the other points often overlooked:
所以还有一些经常被忽视的点:
- In Windows 7, you can only have up to 20 concurrent connections but no more.
If you need more, you'll have to put your SQL Server installation onto a Windows Server OS. That means if you use SQL-Server Express in a use case with more than 20 concurrent users, you'll still need a windows server license (the number of connections is not related to SQL Server edition, but to the operating system). You'll probably hit the 1GB RAM barrier before as bottleneck. - If you want to economize, you'll have to run the db engine on the same server as the web server, with all resulting performance penalties.
- 在 Windows 7 中,您最多只能有 20 个并发连接,但不能更多。
如果需要更多,则必须将 SQL Server 安装放到 Windows Server 操作系统上。这意味着如果您在具有 20 个以上并发用户的用例中使用 SQL-Server Express,您仍然需要 Windows 服务器许可证(连接数与 SQL Server 版本无关,而是与操作系统有关)。您之前可能会遇到 1GB RAM 障碍作为瓶颈。 - 如果您想节约,您必须在与 Web 服务器相同的服务器上运行数据库引擎,这会导致性能下降。
So now to your points (in order of importance)
5. Yes, there is Npgsql.dll (MIT license), so there is no need for ODBC
BUT: If your code uses System.Data.SqlClient everywhere (e.g. parameters, especially when copy-pasted all over the code) then you will have to re-write more than just the SQL code (Use the abstract classes in System.Data.Common instead, or or the System.Data.IDB* interfaces).
If your code copy-pastes SqlClient everywhere, it could be argued that it needs rewriting anyway.
所以现在到你的观点(按重要性排序)
5. 是的,有 Npgsql.dll(MIT 许可证),所以不需要 ODBC
但是:如果你的代码到处都使用 System.Data.SqlClient(例如参数,特别是当复制粘贴到所有代码中),那么您将不得不重新编写不仅仅是 SQL 代码(使用 System.Data.Common 中的抽象类,或者 System.Data.IDB* 接口)。
如果您的代码在各处复制粘贴 SqlClient,则可能会认为它无论如何都需要重写。
- Ease of use:
A little more of a learning curve than SQL-Server, but overall, not too different. pgAdmin may not fullfill your requirements if you're used to SSMS, but there are several other management & development tools you can use (e.g. Navicat) that come very close to SSMS or even top it.
- 易用性:
学习曲线比 SQL-Server 多一点,但总的来说,差别不大。如果您习惯了 SSMS,pgAdmin 可能无法满足您的要求,但是您可以使用其他几种管理和开发工具(例如 Navicat),它们非常接近 SSMS,甚至是顶级工具。
4.Speed. Is PostgreSQL as fast as SQL Server?
Yes and no. It can actually be faster. Granted, because SQL-Server has had much work done on the query optimizer, PostgreSQL might be a little slower when compared to the Enterprise Ultimate version of SQL-Server (or whatever the current name of the killer-edition is).
But, who ever has that version ? If you can use all your CPUs with all cores and all the RAM you want with PostgreSQL, you will always be faster than some cut-down Express or Standard version of SQL-Server with 1 CPU and 1 to a few GB of RAM (windows limits you to 64GB in 64-Bit afaik, with Linux you can exceed the 4 GB RAM per application limit even on a 32 bit processor with the bigmem kernel and can get it to address 64 GB RAM on a 32 bit processor, not to mention the 64-Bit limits), no matter how super-over-optimized the query optimizer is on SQL-Server. That said, my personal opinion from using both pg and ms is that PostgreSql has the better query optimizer, but that's just my opinion, I have no data to back that up. Besides, windows (Windows 7) is a slow operating system (again personal opinion, no data to back it up). So when you can let PG run on Linux in headless mode, it will almost certainly be faster than SQL-Server, even the enterprise ultimate edition.
4.速度。PostgreSQL 和 SQL Server 一样快吗?
是和否。它实际上可以更快。诚然,因为 SQL-Server 在查询优化器上做了很多工作,与 SQL-Server 的 Enterprise Ultimate 版本(或任何杀手版的当前名称)相比,PostgreSQL 可能会慢一点。但是,谁有那个版本?如果您可以将所有 CPU 与所有内核和所有您想要的 RAM 与 PostgreSQL 一起使用,那么您将始终比某些精简版的具有 1 个 CPU 和 1 到几 GB RAM(Windows在 64 位 afaik 中将您限制为 64GB,使用 Linux,即使在具有 bigmem 内核的 32 位处理器上,您也可以超过每个应用程序 4 GB RAM 的限制,并且可以让它在 32 位处理器上寻址 64 GB RAM,更不用说64 位限制),无论查询优化器在 SQL-Server 上如何过度优化。那说,我个人认为同时使用 pg 和 ms 是 PostgreSql 具有更好的查询优化器,但这只是我的意见,我没有数据支持。此外,windows(Windows 7)是一个缓慢的操作系统(再次个人意见,没有数据备份)。所以当你可以让 PG 以无头模式在 Linux 上运行时,它几乎肯定会比 SQL-Server 更快,甚至是企业终极版。
Memory footprint
You can totally configure PostgreSQL. You are in charge of the configuration file.
Can be small or large depending on how you adjust your settings. The overall PG memory footprint to achive the same as SQL-Server on Windows at comparative speed will be quite a bit lower, this is especially true when you run it in headless mode on Linux (no server GUI).
Cost
Yes, quite obviously PostgreSQL wins out here.
Do not forget: It's not just the Server licensing costs we talk about, but also the operating system, and remote access (e.g. additional very expensive Citrix licenses on Windows compared to free SSH access on Linux).
And the other thing: PostgreSQL is OpenSource and Free. If you compare it to SQL-Server, you should not compare it to the Ultimate Enterprise Edition of SQL server (and windows server), but with the version you could actually afford. PostgreSQL however will always be the one free ultimate all-inclusive all-free all-opensource BSD license edition. If you compare the features of PostgreSQL to the Sql-Server Ultimate Enterprise Edition, you'll also have to compare the costs to the ultimate enterprise edition as well (and in 99% of cases, you'll find it not worth the price).
2. Is it ready for primetime?
Yes actually Skype and WhatsApp runs its database on PostgreSQL.
You'll find it has some problems (bad error messages - connection disconnected) when you try to run a 50+ MB insert scripts, but Microsoft's SSMS crashes long before that amount.
内存占用
您可以完全配置 PostgreSQL。您负责配置文件。可以小也可以大,具体取决于您如何调整设置。以相对速度在 Windows 上实现与 SQL-Server 相同的整体 PG 内存占用会低很多,当您在 Linux(无服务器 GUI)上以无头模式运行它时尤其如此。
成本
是的,很明显 PostgreSQL 在这里胜出。不要忘记:我们谈论的不仅仅是服务器许可成本,还有操作系统和远程访问(例如,与 Linux 上的免费 SSH 访问相比,Windows 上额外的非常昂贵的 Citrix 许可证)。
另一件事:PostgreSQL 是开源且免费的。如果将其与 SQL-Server 进行比较,则不应将其与 SQL Server(和 Windows Server)的终极企业版进行比较,而应将其与您实际负担得起的版本进行比较。然而,PostgreSQL 将永远是一个免费的终极全包全免费全开源 BSD 许可证版本。如果您将 PostgreSQL 的功能与 Sql-Server Ultimate Enterprise Edition 进行比较,您还必须将成本与 Ultimate Enterprise Edition 进行比较(并且在 99% 的情况下,您会发现它不值这个价) .
2. 准备好迎接黄金时段了吗?
是的,实际上 Skype 和 WhatsApp 在 PostgreSQL 上运行其数据库。
当您尝试运行 50 MB 以上的插入脚本时,您会发现它存在一些问题(错误消息 - 连接断开),但 Microsoft 的 SSMS 早在该数量之前就崩溃了。
Summa summarum, PG probably is more ready for PrimeTime than SQL-Server.
- PG has has had paging for almost 10 years now (MySQL as well as SQL-Standard syntax compliant) , SQL server just got that feature with SQL-2012, only standard-compliant.
Summa summarum,PG 可能比 SQL-Server 更适合 PrimeTime。
- PG 已经有将近 10 年的分页功能(符合 MySQL 以及 SQL-Standard 语法),SQL Server 刚刚在 SQL-2012 中获得了该功能,仅符合标准。
You can simply xcopy deploy PostgreSQL, works perfectly without admin rights
PG has XML support, just like SQL-Server
PG has JSON support, SQL Server? I believe they are still fully invested in thinking that XML is the future - and purposely crippling the web as a platform. (they are adding JSON support now for SQL-Server 2016 CTP, but it stores data as nvarchar, so you won't be able to set (fulltext) indices on specific JSON-fields like you can on PostgreSQL)
PG has HSTORE support (associative array column), SQL-Server doesn't
PG has array columns. Arrays are a core part of programming, except in SQL Server, where they don't exist (try parametrize an IN-clause)...
PG has had spatial support for a long time, SQL-Server's spatial support is relatively new and relies on .NET extensions and is object-oriented (hello RELATIONAL database? )
PG has the better and faster fulltext search (personal opinion, not backed up by data because it's as clear as it's clear that Google-Chrome is faster than IE 8)
PG has companies offering commercial support, just like Microsoft does for SQL-Server; the advantage is that you actually get your bugs/feature-requests fixed for your money on PG support. You probably know Microsoft support, so I'll spare you any further rants of mine ...
PG has IPv6 support, Microsoft ?
PG performs normal under heavy load, with SQL-Server on Windows we've had some strange issues that appear and disappear at random (Heisenbugs ?).
SQL Server still to this day deploys pessimistic concurrency out of the box, PG doesn't
Compression out of the box. In SQL Server, compression is an "Enterprise Edition+" feature which means you are spending the cost of at least 1 dev in order to get the ability to use compression. Once you have paid for that ability, you still have to figure out how to implement it. Postgres does this for you out of the box, automatically and for free.
Concurrent Index Creation. This yet another feature that SQL Server is capable of doing, but only if you are able to afford Enterprise Edition. Postgres has your back on this and you can leave your wallet at home.
Indexable functions – sargability. In Postgres, you can actually index certain functions and maintain sargability. With SQL Server, BOOM - table scans - adios performance
PG employs Unicode (UTF8) by default. No longer can an incompetent predecessor cripple the entire application with horrible varchar and missing N' for string datatype like they do in SQL Server. The N' syntax still works though, so no compatibility problems if you use them.
PG supports recursive cascaded deletes, SQL server doesn't support that at all (though it actively tells you when you want to put the cascade on the referential constraint)
PG supports GREATEST(value [, ...]), LEAST(value [, ...])
Microsoft:CASE WHEN HugeExp1 > HugeExp2 THEN HugeExp1 ELSE HugeExp2 END)
...CASE WHEN N > 2 THEN 'ROYALLY SCREWED'
...
or this very maintainable gemSELECT ( SELECT MIN(Price) FROM ( VALUES (123),(456) ) AS AllPrices(Price) )
PG supports UTF-8 CSV files since ever, SQL server doesn't support UTF-8 CSV files prior to SQL-Server 2014 SP2 (try import the MaxMind GeoIP database - you need to write your own program for SQL-server...).
您可以简单地 xcopy 部署 PostgreSQL,无需管理员权限即可完美运行
PG 有 XML 支持,就像 SQL-Server
PG 有 JSON 支持,SQL Server?我相信他们仍然全力以赴地认为 XML 是未来——并故意削弱作为平台的网络。(他们现在正在为 SQL-Server 2016 CTP 添加 JSON 支持,但它将数据存储为 nvarchar,因此您将无法像在 PostgreSQL 上那样在特定 JSON 字段上设置(全文)索引)
PG 有 HSTORE 支持(关联数组列),SQL-Server 没有
PG 有数组列。数组是编程的核心部分,除了在 SQL Server 中,它们不存在(尝试参数化 IN 子句)...
PG有空间支持很久了,SQL-Server的空间支持比较新,依赖.NET扩展,是面向对象的(你好RELATIONAL数据库?)
PG 有更好更快的全文搜索(个人观点,没有数据支持,因为很清楚 Google-Chrome 比 IE 8 更快)
PG 有公司提供商业支持,就像微软为 SQL-Server 做的一样;优点是您实际上可以通过 PG 支持来解决您的错误/功能请求。你可能知道微软的支持,所以我不会再给你任何我的咆哮......
PG 支持 IPv6,Microsoft ?
PG 在重负载下运行正常,对于 Windows 上的 SQL-Server,我们遇到了一些随机出现和消失的奇怪问题(Heisenbugs ?)。
时至今日,SQL Server 仍然开箱即用地部署悲观并发,PG 没有
压缩开箱即用。在 SQL Server 中,压缩是一项“企业版+”功能,这意味着您至少要花费 1 个开发成本才能获得使用压缩的能力。一旦你为这种能力付出了代价,你仍然需要弄清楚如何实现它。Postgres 为您开箱即用,自动且免费。
并发索引创建。这是 SQL Server 能够提供的另一个功能,但前提是您能够负担得起企业版。Postgres 支持您,您可以将钱包留在家中。
可索引函数 - sargability。在 Postgres 中,您实际上可以索引某些函数并保持可调整性。使用 SQL Server,BOOM - 表扫描 - adios 性能
PG 默认使用 Unicode (UTF8)。一个不称职的前任不再能够像在 SQL Server 中那样使用可怕的 varchar 和缺少字符串数据类型的 N' 来削弱整个应用程序。N' 语法仍然有效,因此如果您使用它们,则不会出现兼容性问题。
PG 支持递归级联删除,SQL 服务器根本不支持(尽管它会主动告诉您何时要将级联放在引用约束上)
PG 支持GREATEST(value [, ...]), LEAST(value [, ...])
Microsoft:CASE WHEN HugeExp1 > HugeExp2 THEN HugeExp1 ELSE HugeExp2 END)
...CASE WHEN N > 2 THEN 'ROYALLY SCREWED'
...
或者这个非常易于维护的 gemSELECT ( SELECT MIN(Price) FROM ( VALUES (123),(456) ) AS AllPrices(Price) )
PG 一直支持 UTF-8 CSV 文件,SQL Server 在 SQL-Server 2014 SP2 之前不支持 UTF-8 CSV 文件(尝试导入 MaxMind GeoIP 数据库 - 您需要为 SQL-server 编写自己的程序... )。
Drawbacks of PG:
PG的缺点:
Windows version ain't as stable & fast as the Linux version
No free BI-tool like SQL-Server-Reporting-Services (ok there is Eclipse BIRT, but it runs on JAVA).
On the other hand, for a bit of money you can get stimulsoft reports, which has more export formats than SSRS, and actually renders fine in browsers other than IE as well as IE > 8, unlike SSRS (2005 - 2012 so far, and so far I read SSRS 2014 is no different than 2012).
Windows 版本不如 Linux 版本稳定和快速
没有像 SQL-Server-Reporting-Services 这样的免费 BI 工具(当然有 Eclipse BIRT,但它在 JAVA 上运行)。
另一方面,花一点钱你就可以得到 stimulsoft 报告,它比 SSRS 有更多的导出格式,并且实际上在 IE 以外的浏览器中呈现良好以及 IE > 8,不像 SSRS(2005 - 2012 到目前为止,和到目前为止,我读到的 SSRS 2014 与 2012 年没有什么不同)。
That said, if your only problem is fulltext-search with SQL-Server Express, you should take a look at Lucene.NET (Apache License).
也就是说,如果您唯一的问题是使用 SQL-Server Express 进行全文搜索,您应该看看 Lucene.NET(Apache 许可)。
Also, be careful if you're thinking about using SQL-Express in production:
另外,如果您考虑在生产中使用 SQL-Express,请小心:
So far we've considered only a few of the most obvious limitations, but the point is that what seemed like a great idea driven by the thought of considerable cost savings could end up being an absolute disaster for your business. Worse, any initial cost savings you gained from using a free product could be easily negated down the road by the cost of disaster recovery and the damage to your business' reputation while an important database is down. So needless to say, despite the appeal of its zero dollar price tag, SQL Server Express is definitely not the right database solution to power your business.
到目前为止,我们只考虑了几个最明显的限制,但重点是,由大量节省成本的想法驱动的看似好主意最终可能对您的业务造成绝对的灾难。更糟糕的是,您从使用免费产品中获得的任何初始成本节省很容易被灾难恢复成本和重要数据库停机时对企业声誉的损害所抵消。因此不用说,尽管其零美元价格标签具有吸引力,但 SQL Server Express 绝对不是为您的业务提供动力的正确数据库解决方案。
回答by Thomas Haller
As some mentioned above, this really relies on how big your DB will have to be.
正如上面提到的,这实际上取决于您的数据库必须有多大。
Especially the difference price of a CPU-core vs the price of the licence for that core is really heavy. CPU costs nothing in this comparision. So if you need 16+ Cores, i would give Postgres a chance. you will be able to buy a lot more cores for your Postgres server with the saved money.
尤其是 CPU 核心与该核心的许可证价格的差价真的很重。在这个比较中,CPU 没有任何成本。因此,如果您需要 16 个以上的内核,我会给 Postgres 一个机会。您将能够用省下的钱为 Postgres 服务器购买更多内核。
I am Software developer, and the customers we have, have to pay much more for the Sql Server License than for all the other things together: softwaredevelopment, Clienthardware, Serverhardware, DB-Administration and so on.
我是软件开发人员,我们拥有的客户必须为 Sql Server 许可证支付比其他所有事情更多的费用:软件开发、客户端硬件、服务器硬件、数据库管理等。
Most of the time its cheaper, to buy new hardware, than to optimize your code. But thats not true for the SQL Server CPU.
大多数情况下,购买新硬件比优化代码更便宜。但对于 SQL Server CPU 而言,情况并非如此。
(however, you can still invest in Ram/HDDs without raising license costs)
(但是,您仍然可以在不提高许可成本的情况下投资 Ram/HDD)
回答by Kenaniah
From my own personal experience, I find that PostgreSQL runs better on a linux box - lose the windows OS. I'm not very familiar with SQL Server, but I have had no issues with speed or flexibility in working with Postgres. While I can't speak to ADO.NET, I have had much success with using Postgres in the real world (under constant load). In your case, the only variable I could see is integration with ADO.NET. http://www.devart.com/dotconnect/postgresql/may be a starting point.
根据我个人的经验,我发现 PostgreSQL 在 linux 机器上运行得更好 - 失去了 windows 操作系统。我对 SQL Server 不是很熟悉,但我在使用 Postgres 时没有遇到速度或灵活性方面的问题。虽然我无法使用 ADO.NET,但我在现实世界中(在恒定负载下)使用 Postgres 取得了很大成功。在您的情况下,我能看到的唯一变量是与 ADO.NET 的集成。http://www.devart.com/dotconnect/postgresql/可能是一个起点。
回答by Eric Petroelje
I haven't tried using PostgreSQL with ADO.NET, but from my experience using it with MySQL, you might be better off sticking with SQL Server if you plan to use LINQ to SQL or Entity Framework.
我还没有尝试将 PostgreSQL 与 ADO.NET 一起使用,但根据我将它与 MySQL 一起使用的经验,如果您打算使用 LINQ to SQL 或实体框架,最好坚持使用 SQL Server。
While there are probably third party libraries that will allow you to integrate those technologies with PostreSQL, I think you'll find that things will go a lot smoother with SQL Server. Pretty much all the nice tools built into Visual Studio that make those technologies so easy to work with will only work with SQL Server.
虽然可能有第三方库允许您将这些技术与 PostreSQL 集成,但我认为您会发现使用 SQL Server 会更顺利。几乎所有内置在 Visual Studio 中的好工具都只能与 SQL Server 一起使用,这些工具使这些技术如此易于使用。