From my understanding, to get all the transaction records related to a certain address, you have to scan the whole blockchain and examine every transaction, which could take a loooong time. However it seems Etherscan.io can show all the transaction records related to an address almost instantly. So how did they accomplish that? Did they scan and store the transaction records in a centralized database? Does that mean the transaction records shown in Etherscan.io are not fetched in real-time from the blockchain, thus not really reliable (as centralized database is susceptible to hacks and abuse, which is exactly what blockchain tries to avoid)?
Yes, Etherscan.io creates a centralized database which represents the past and present state of the Ethereum blockchain.
However, given any specific piece of data from Etherscan, it should be very trivial and quick to verify that data using an Ethereum node directly.
I think it is important to remember that not everything can be 'replaced' by a blockchain. Things like quickly searching for single piece of data in a large data set is probably better done on a central database versus a blockchain. As long as Etherscan itself is not verifying transactions on the Ethereum blockchain, there should not really be much to worry about.