Database-like searching/querying with BigMap/BigSearch

@lastmjs Here is a port of SQLite to the Internet Computer IC_sqlite. It’s a simple canister that allows you to create a database and to run SQL updates and queries. SQLite is probably the easier port of a legacy application to the IC you can find. I think it is nearly impossible to do this for the most popular database software like MYSQL or PostgreSQL. Running a SQLite on the IC has its advantages compared to running it on an OS. SQLite does not have any specific user management functionality and hence is not suitable for multiple user access. SQLite does not have an inbuilt authentication mechanism. However, your can add to your canister an authentication layer, and the ability of having multiple users access multiple databases hosted on the same canister.

Note that the wasm is not optimized at all. 2/3 of the wasm code is probably dead code. Many settings that make sense on a traditional OS are not needed on the IC. So there are a lot of things to like about it despite its limitations. It’s probably not too difficult to extract the core BTreeMap logic and throw away most of the rest of the code. This way you can take advantage of years of optimizations put into SQLite.

I’d like to echo what @enzo and others have said though. Building applications and services on the IC is as much about simplification as it is about taking advantage of the fact that messaging is reliable, persistence is orthogonal, and computation is trusted. So I think we might be threatened by a great opportunity to innovate here.

25 Likes