I know DDNS is translating Dynamic IP (IP which always changes in a device) to a Domain, but I don't know how the story behind it or I don't know how does it work.
I'm using bind9 as DNS server, we know in bind9, there file contain record file. Then what the difference if I program zone file like mydomain.com.db
which contain many records where program modified (read/write) that file?
Basically my program is like how We manually change record when using text editor (nano or vim) to record files.
Also what is difference of Dynamic DNS and Dynamic Zone in bind9?
First of all, you do not want to manipulate the content of the zone files. That's a Bad Way of doing it, because Bind has a API for doing it.
Set up a key for managing DNS information, and use RFC 2136 style DNS Updates. This can be done without reloading zone files, on the fly, and even remotely by anyone possessing the cryptographic secrets required.
In addition this will work fine with things such as DNSSEC if configured; bind will resign the zone when it's updated.
https://bind9.readthedocs.io/en/v9_16_5/advanced.html#dynamic-update has relevant information for bind. In addition, libraries for doing updates are available for most languages, e.g. this for python. Googling RFC2136 dns update <language> will give you libraries for your language of choice.