I have some confuse with chain_plugin and mongo_plugin, why do we need them? And if I can modify chainbase which can write directly state to disk, Do I can discard mongoDB?
chain_plugin is actually the core part that manages the blockchain data structure in
nodeos. Most of time it is enabled automatically.
mongo_db_plugin is an add-on plugin that aims to replace the previous
history_api_plugin, and is for data access / analysis / reporting purpose only. It is more like a peripheral module attached to the nodeos core and it can not work without
chain_plugin. If you do not need a mongodb database for query, you can definitely disable
mongo_db_plugin and it will save huge amount of system resources.