轻量级SQL数据库,不需要安装数据库、不需要安装、SQL

2023-09-02 10:26:32 作者:那夜妳很賣力

你能不能推荐一个轻量级的SQL数据库,它不需要在客户端计算机上进行安装工作,并可以从.NET应用程序很容易地访问?只需要基本的SQL功能。

Could you recommend a lightweight SQL database which doesn't require installation on a client computer to work and could be accessed easily from .NET application? Only basic SQL capabilities are needed.

现在我使用的Access数据库的简单的项目和分发的.mdb和.EXE文件一起。寻找其他选择。

Now I am using Access database in simple projects and distribute .MDB and .EXE files together. Looking for any alternatives.

推荐答案

取决于你所说的轻量级的意思。简单的内存?或者更轻的数据库文件?或者更轻的连接器连接到数据库?以上所有更少的文件?我给了我所知道的比较:

Depends on what you mean by lightweight. Easy on Ram? Or lighter db file? Or lighter connector to connect to db? Or fewer files over all? I'll give a comparison of what I know:

                    no of files    cumulative size of files    db size

Firebird 2.5             5                6.82 MB               250 KB

SqlServerCe 4            7                2.08 MB               64 KB

Sqlite 3.7.11.0          1                0.83 MB               15 KB

VistaDb 4.3.3.34         1                1.04 MB               48 KB

no of files - includes the .net connector and excludes the db file

的DB 1表2列2行。以分贝大小与盐DBS可以进一步利用不同的成长的压力。例如 SqlServerCe 虽然最初是在64 KB,它并没有增长都增加几百记录,之后虽然 VistaDB的容易长大,从48到72至140 KB。 SQLite的是最好的,其中从最低开始和长大线性这方面

The dbs are of 1 table with 2 columns and 2 rows. Take the db size with a pinch of salt as dbs could grow differently with further use. For instance SqlServerCe though initially was at 64 KB, it didn't grow at all after adding a few hundred records, while VistaDb grew easily from 48 to 72 to 140 KB. SQLite was the best in that regard which started from the lowest and grew linearly.

很少趣闻:我一直在使用SqlServerCe与出厂设置更好的性能,这意味着它是最容易拿到球开始无任何配置,同时我发现火鸟有点难以得到它开始,由于缺乏在网上材料。火鸟,因为我能读了最广泛的标准SQL达标。虽然VistaDB的是写在全面托管的C#,这意味着它可以与你的应用程序的组件可以合并有一个单一的文件,它似乎最慢的我。所有的人,考虑到性能,易用性和大小,我选择的SQLite。 SqlServerCe将是我的第二选择。

Few anecdotes: I had better performance using SqlServerCe with the factory settings which means its the easiest to get kick started without any configuration, while I found Firebird little bit harder to get it started due to lack of online materials. Firebird as I could read had widest standard sql compliance. While VistaDb is written in fully managed C# which means it can be merged with your application's assembly to have one single file, it seemed slowest to me. Of all, considering performance, ease and size I chose SQLite. SqlServerCe would be my second choice.

总之每个人都有其长处和短处。再次,把我的言论有少许盐,它只是我个人的经验。

In short each has its pluses and minuses. Again, take my rant with a pinch of salt, its just my personal experience.