Zabbix-in-Telegram
Zabbix-in-Telegram copied to clipboard
Cache: txt -> sqlite3
Hard to support text files, better to move to sqlite
I do not know why you want to make such a big dependence. In my opinion, it is necessary to introduce appropriate abstractions. Then all operations will be simple. Cache should not be too large to constantly read the entire file, so you do not need indexes from a regular database.
@ad-m , if we are talking about interactive bot, there are too many things to store, messages id, updates id, etc... It's not right to read a bunch of files every time you need some historical info (about previous notifications, messages or graphs).
Of course, for interactive bots there are more data.
But I wonder if there is enough data to make such a dependency, or just serialize the state to plain JSON file. This allows for a flexible approach to the data schema like NoSQL.
@ad-m , I will think about it, thanks! Maybe having option to enable/disable sqlite/txt is better.