I live in Tokyo: there's no dumpsters here either, nor alleys. Trash is left on the curb for the trash trucks to take on the appropriate day. Until then, the trash is kept inside usually; condo buildings for instance have trash rooms on the ground floor for storing and sorting trash. There are almost no rats.
I think the issue is just basic cleanliness. NYC doesn't have it. There's trash everywhere, so that breeds rats.