by rheo » Fri Aug 02, 2019 07:46
This is only tangentially related, but the 64ki limit is built in to Lua itself, not minetest.serialize itself. Lua can only process scripts w/ a maximum of 64ki constants in them, and minetest.serialize (like most Lua serializers) encodes its data as a Lua script.
The comment about a table w/ more than 64ki entries indicates "you're doing it wrong" is itself absolutely wrong, but everyone elses suggestions are great.
To further the tangent: you still hit that 64ki limit if you're using other structures (e.g. a binary tree) to store your data; Lua tables perform far better than SQLite and are more suitable many applications w/ medium-sized data; however, you should be aware that LuaJIT can't handle more than 1GiB of memory without enabling an unstable feature, and you should design your mods w/ that limit in mind.