sqlite用mysql统一_sqlite或mysql用于大型数据集

I am working with large datasets (10s of millions of records, at times, 100s of millions), and want to use a database program that links well with R. I am trying to decide between mysql and sqlite. The data is static, but there are lot of queries that I need to do.

In this link to sqlite help, it states that:

"With the default page size of 1024 bytes, an SQLite database is limited in size to 2 terabytes (241 bytes). And even if it could handle larger databases, SQLite stores the entire database in a single disk file and many filesystems limit the maximum size of files to something less than this. So if you are contemplating databases of this magnitude, you would do well to consider using a client/server database engine that spreads its content across multiple disk files, and perhaps across multiple volumes."

Im not sure what this means. When I have experimented with mysql and sqlite, it seems that mysql is faster, but I havent constructed very rigorous speed tests. Im wondering if mysql is a better choice for me than sqlite due to the size of my dataset. The description above seems to suggest that this might be the case, but my data is no where near 2TB.

Id appreciate any insights into understanding this constraint of maximum file size from the filesystem and how this could affect speed for indexing tables and running queries. This could really help me in my decision of which database to use for my analysis.

解决方案

The SQLite database engine stores the entire database into a single file. This may not be very efficient for incredibly large files (SQLites limit is 2TB, as youve found in the help). In addition, SQLite is limited to one user at a time. If your application is web based or might end up being multi-threaded (like an AsyncTask on Android), mysql is probably the way to go.

Personally, since youve done tests and mysql is faster, Id just go with mysql. It will be more scalable going into the future and will allow you to do more.

I am working with large datasets (10s of millions of records, at times, 100s of millions), and want to use a database program that links well with R. I am trying to decide between mysql and sqlite. The data is static, but there are lot of queries that I need to do. In this link to sqlite help, it states that: "With the default page size of 1024 bytes, an SQLite database is limited in size to 2 terabytes (241 bytes). And even if it could handle larger databases, SQLite stores the entire database in a single disk file and many filesystems limit the maximum size of files to something less than this. So if you are contemplating databases of this magnitude, you would do well to consider using a client/server database engine that spreads its content across multiple disk files, and perhaps across multiple volumes." Im not sure what this means. When I have experimented with mysql and sqlite, it seems that mysql is faster, but I havent constructed very rigorous speed tests. Im wondering if mysql is a better choice for me than sqlite due to the size of my dataset. The description above seems to suggest that this might be the case, but my data is no where near 2TB. Id appreciate any insights into understanding this constraint of maximum file size from the filesystem and how this could affect speed for indexing tables and running queries. This could really help me in my decision of which database to use for my analysis. 解决方案 The SQLite database engine stores the entire database into a single file. This may not be very efficient for incredibly large files (SQLites limit is 2TB, as youve found in the help). In addition, SQLite is limited to one user at a time. If your application is web based or might end up being multi-threaded (like an AsyncTask on Android), mysql is probably the way to go. Personally, since youve done tests and mysql is faster, Id just go with mysql. It will be more scalable going into the future and will allow you to do more.
经验分享 程序员 微信小程序 职场和发展