如何为 WPF 应用程序创建内置数据库
我计划使用 PostgreSQL 数据库构建一个 C# WPF 桌面应用程序(用于存储使用设置和一些文本框数据)。
此应用程序的用户的计算机上不会有数据库服务器。我可以使用 WPF 应用程序构建“内置”/“运行时”数据库(无论其名称如何)吗?
我是数据库应用程序的新手,我的问题是:
我可以使用 PostgreSQL 部署 WPF 应用程序,并且用户可以在没有 SQL Server 的情况下安装并仍然使用该应用程序吗?
部署用户拥有 SQL Server 的应用程序与部署用户没有 SQL Server 的应用程序有什么区别吗?
部署
我需要一些高性能的东西。我有多达 50 个并发插入,每个插入数据的速度为 10 毫秒,并且我在几秒钟内将数千个数据存储到数据库中。我认为 SQLite 或 SQL Compact 无法完成这项工作。我需要嵌入数据库
I am planning on building a C# WPF desktop application with a PostgreSQL database (to store using settings and some textbox data).
The user of this application will NOT have a database server on their computer. Can I build a "built-in"/"run-time" database (whichever it's called) with WPF application?
I'm new to database application, and my question is:
Can I deploy a WPF application with PostgreSQL, and user can install and still use the application without a SQL server?
Is deploying an application where user has a SQL server would have any difference to deploying an application where user does not have a SQL server?
I need something of high performance. I have up to 50 concurrent insertion each inserting data in speed of 10 milliseconds, and I'm storing thousands of data in seconds to the database. I don't think SQLite or SQL compact would do that job. I needed the database to be embedded though
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
查看SQL Server Compact Edition。
编辑*
Sql Server Express 怎么样,请查看嵌入 SQL Server Express 融入自定义应用程序
Take a look at SQL Server Compact Edition.
Edit*
What about Sql Server Express, Check this out Embedding SQL Server Express into Custom Applications
看起来您实际上并不需要 SQL 本身,所以请查看 LevelDB
并查看键值存储是否可以满足您的需求。
它是用 C++ 编写的,速度非常快:
It looks like you don't really need SQL per se, so take a look at LevelDB
and see if a Key-Value store can fit your needs.
It is written in C++ and very fast:
如果用户尝试安装应用程序并且无法访问保存设置和文本框数据的数据库,则应用程序将无法运行。您还需要让安装程序部署数据库。我会研究像 sqlite 这样的东西与您的应用程序一起安装。
If the user tries to install the application and has no access to the database holding settings and textbox data the application will not work. You will need to have your installer deploy the database as well. I would look into something like sqlite for installation alongside your application.
为此,我建议您使用 Firebird,它在使用本地或远程数据库方面没有任何区别
For that purpose I can suggest you to use Firebird which doesn't have any difference in working with local or remote db
请考虑使用 VelocityDB,根据我的测试,它是嵌入式数据库解决方案的价格和性能之间的最佳折衷方案。这是一种 NoSQL 方法。它支持 Linq 查询。不需要 ORM,只需要实现一个通用存储库来模拟 EF 类型的行为。在 8 秒 150 毫秒内插入 600000k 条记录,以从该子集中过滤 3k 条记录。快速地。
RavenDB 稍快一些,但其每个数据库的 Mb 占用量比 VelocityDB 大 3 倍以上。 RavenDB 的 TCO 也有所提高。
Plesase consider using VelocityDB which is by mine test the best compromise between price and performance for the embedded db solution. It is a NoSQL approach. It supports Linq queries. ORM is not needed just need to implement a generic repository to emulate EF kind of behaviour. 600000k records inserted in 8s 150ms to filter 3k from that subset. Fast.
RavenDB is slightly faster but its footprint in terms of Mb per database is more than 3x bigger than VelocityDB ones. Also RavenDB TCO are elevated.