how to monitor +20,000 addresses for new received transactions?
I am basically doing the same thing for bitcoinmonitor.net. I have a database of addresses to monitor and get notifications from bitcoind for any incoming transaction.

I maintain a patchset for bitcoind which allows setting an url which will be called with any incoming unconfirmed transaction, including transaction details in a json object. Also for any new accepted block a (different) url can be set up to be called with details on the new block.

So you will get a notification for any incoming unconfirmed transaction, then you can match this with the monitored addresses in your database.
If you want to trigger actions after a certain number of confirmations you need to hook up to the new block event.

Check https://github.com/TripleSpeeder/bitcoin for my bitcoind fork. I try to keep it more or less in sync with the current stable official client. This is running stable with bitcoinmonitor.net for around 10 months now.