SQLite 和 DISQLite 为什么我要选择其中一个?
我的上下文是,我正在处理一个大型数据库(可能高达 10 GB),其中的关键部分位于一个非常简单的表中,其中包含一个索引字段和一个大小最多为几 KB 的文本字段。我的开发工具是Delphi 2009,数据库将嵌入到我的.exe中。
我的主要标准是速度。这适用于在典型 Windows 计算机(例如 Windows 7 和 4 GB RAM)上运行的软件应用程序。
如果您想推荐另一个数据库工具,请告诉我为什么它比这两个工具更适合我的应用程序,特别是在速度方面。
What are the differences between SQLite and DISQLite and why would I want to pick one over the other?
My context is that I am dealing with a large database (could be up to 10 GB), the critical part of which is in one very simple table with a single indexed field and one text field up to a few KB in size. My development tool is Delphi 2009 and the database will be embedded in my .exe.
My main criteria is speed. This would be for a software application running on a typical Windows computer, say with Windows 7 and 4 GB of RAM.
If you want to suggest another database tool, please tell me why it would be better than these two for my application, especially on the speed frontier.
发布评论
评论(5)
AFAIR,DISQLite使用Sqlite的obj文件,并用Delphi编译它们并产生比原始文件更多的功能,并且使用相同的sqlite DB格式,因此您可以通过支持Sqlite的其他语言读取DISQLite数据库文件司机。
DISQLite 的另一项功能是您无需分发 Sqlite DLL。
DISQLite 支持高达 2TB 的数据库大小,因此它可以毫无问题地满足您的需求。
我会考虑的另一个选择是 FireBird 嵌入式版本,如果您想进一步扩展它,您可以轻松更改为完整的 FireBird 服务器。
但我认为 Sqlite 和DISQLite 的性能会比 Firebird 更好。
我使用Audcom Sqlite组件来访问Sqlite数据库,你可以用Sqlite objs编译它文件,这样你就不会部署 sqlite dll。
AFAIR, DISQLite uses the obj files of Sqlite, and compile them with Delphi and produce more features than the original one, and using the same sqlite DB format, hence you can read the DISQLite database file by it by other languages that has support for Sqlite drivers.
Also one more feature with DISQLite you don't have to distribute the Sqlite DLL.
DISQLite support database size up to 2TB, so it could handle your requires without problems.
Another options I would consider is FireBird embedded version,and if you would like to scale it more, you can change to full FireBird server without much effort.
But I think both Sqlite & DISQLite will perform better than Firebird.
I use Audcom Sqlite components to access Sqlite databases, and you can compile it with Sqlite objs file so you will not have deploy sqlite dll.
我可以建议您编写自己的实现。如果不需要复杂的 SQL 查询,最简单(也可能是最快)的实现是基于文件的存储。
I can suggest you writing your own implementation. If you don't need complex SQL queries, the simplest (and probably the fastest) implementation is file-based storage.
DISQLLite 有两个版本,免费版本仅限个人和非商业用途。因此,这可能是决定因素之一,因为 SQLite 是免费的开源实现,没有免费/付费版本。
这两个数据库都能够处理 GB 级的数据。 SQLite 以预编译的二进制文件(即 DLL)形式提供,可以随您的应用程序一起分发。但是,有了可用的源代码,您还可以在应用程序中对其进行编译并使用它,而无需 DLL。
使用 DLL 模块(有时)的优点是,当某些错误得到解决时,您只需在客户端计算机上替换 DLL,而不用重新编译整个应用程序。
我觉得 SQLite 将是满足您需求的更好选择。数据库的速度并不完全取决于数据库的类型。硬盘访问速度、可用处理能力、RAM 等硬件在加速数据库方面也发挥着重要作用。
DISQLLite has two versions with the free one limited to personal and non-commerical usage. So this could be one of the deciding factor as SQLite is free opensource implementation without free/paid versions.
Both of the database would be able to handle data ranging in GBs. SQLite is available in pre-compiled binary i.e. DLL which can be distributed along your application. However, with the source code available you can also compile it within your application and use it without the need for DLL.
The advantage of using the DLL module (at times) is when some of the bugs are resolved you would simply be required to replace the DLL at the client machine instead of recompiling the whole application.
I feel SQLite would be a better option for yor requirement. Speed of database is not entirely based on the type of database. Hardware like harddisk access speed, available processing power, RAM etc also play an important role in speeding up database.
请注意,DISQLLite 个人版本有一些限制,而且我认为当任何人都可以免费实现 SQLite 包装器时,专业版本的价格(149.99 欧元,无源)是不值得的。
我使用 DISQLite 个人版作为免费软件产品,并且必须在新版本发布中实施数据库更改。个人版本不支持“ALTER”,因此我不得不购买完整版本。所以我放弃了 DISQLite,只使用了一个好的 SQLite 包装器。仅当您准备支付完整版本时才选择 DISQLite。
SQLite4Delphi 可能是一个更好的选择,或者至少为您指明了一个更具成本效益的解决方案。
Note that the DISQLLite personal version has some limitations and I don't think that the price for the professional version (Euro 149.99 without source) is worth it when anyone can just implement a SQLite wrapper for free.
I was using DISQLite personal for a freeware product and had to implement a database change in a new version release. The personal version does not support 'ALTER' so I was faced with having to purchase the full version. So I ditched DISQLite and just went with a good SQLite wrapper. Only go for DISQLite if you're prepared to pay for the full version.
SQLite4Delphi might be a better option, or at least point you to a more cost-effective solution.
看看我们的 SynBigTable 单元。它将比 SQLite 快得多,并且似乎完全符合您的目的。
如果您需要本机 SQLite 实现,请查看我们的 SQLite3 框架< /a>:它是免费且开源的,无需任何外部 dll。并且比封闭的 DiSQLite 有更多的功能(比如用于实现 SQL 函数或虚拟表的 Delphi 原生类)。
对于性能 POV,瓶颈不是您使用的包装器,而是磁盘访问以及您如何设置数据库。不要忘记使用索引来尽快检索数据。那么,无论您使用什么包装器,即使 10 GB 的数据对于 SQLite 来说也不是问题。
Take a look at our SynBigTable unit. It's will be much faster than SQLite, and seems to fit exactly your purpose.
And if you need a native SQLite implementation, take a look at our SQLite3 framework: it's free and OpenSource, without any external dll. And has some more features than the closed DiSQLite (like Delphi native classes for implementing SQL functions or Virtual tables).
For the performance POV, the bottleneck won't be the wrapper you're using, but the disk access, and how you set up your database. Don't forget to use indexes to retrieve your data as fast as possible. Then even 10 GB of data won't be a problem for SQLite, whatever wrapper you are using.