且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

您会将 Sql Server Compact 用于桌面应用程序吗?

更新时间:2023-02-06 22:48:10

我当然愿意(并且愿意).SQL Compact (SQLCE) 在某些情况下具有明显的优势.现在它绝不意味着要替代 SQL Server.它不能扩展,不能运行数千个并发连接,也不能用于报告服务等.

I certainly would (and do). SQL Compact (SQLCE) has a distinct advantage in some scenarios. Now it's in no way meant to be a replacement for SQL Server. It doesn't scale, it isn't made to run thousands of concurrent connections, it's not designed for reporting services, etc, etc.

但它有一个微小的足迹.安装只是复制 DLL 的问题.备份它是一个简单的文件副本.如果您使用 table direct 或 BCP,它的存储和检索速度可能会很快.哦,它是免费的.如果您只需要一个应用程序的本地数据存储,那么部署和配置 SQL Server 会很麻烦.SQLCE 很简单.此外,它可以在与完整 SQL Server 相同的沙箱中作为复制订阅者运行(大多数其他小型数据库不能).

But it has a tiny footprint. Installing is a matter of just copying over DLLs. Backing it up is a simple file copy. And it can be wicked fast for storage and retrieval if you're using table direct or BCP. Oh, and it's free. If you just need a local data store for an app, SQL Server is a pain to deploy and configure. SQLCE is simple. Plus it can play in the same sandbox as a full SQL Server as a replication subscriber (which most other small DBs can't).

忘记回答您的具体问题:

Forgot to answer your specific questions:

  • 它能处理多少数据?在什么方面?数据库大小?吞吐量?桌子大小?行大小?我的经验是,我已经将数据库运行到几百 MB 没有问题.我认为它可以容纳 4GB(从 4.0 开始).吞吐量与您输入或取出数据的方式直接相关.我们在一个解决方案中使用它,我们可以毫无问题地每秒捕获 1k 行.您可以有 1024 列,最大行大小为 8k.
  • 多个用户?好吧,它可以处理多个同时连接(从 3.5 开始),所以是的,应该可以.我使用过来自一个用户的多个连接,从未使用过多个连接.
  • 损坏的数据库?定义破碎".发动机有压缩和修复"的方法.它是一个像任何其他文件一样的文件 - 如何修复损坏的可执行文件?如果这就是您要问的,我在现场没有看到任何损坏(我们在一台存储卡损坏的 CE 设备上做到了,但这不是引擎的错).