If you do anything other than surfing web than the imac 21 4k is a no buy (personal opinion).
You have to put 16gb (you can't put more later in the 21, you can put later in the 27) and change the hdd with a 2tb fusion drive (they standard hdd is a 5400rpm and the 1tb fusiondrive has a 28gb sdd). this will increase the price a lot and it will cost almost like the base imac 27 5k with a 2tb fusion and a R9 M380 (the 21 has only the integrated Iris Pro of the cpu).