I know its an old Cliché, but size does matter, the size of the fish, and the size of the tank.
If we take the fish first there are two issues relating to size. Big Fish eat Little Fish", and some little fish grow into big fish.
There are thousands of anecdotes about big fish and little fish living together in perfect harmony. Believe me, there are many, many more where the little fish get eaten and the big fish grows even bigger. The simple fact is, any fish will eat another if it can get it into its mouth. Not only that, but big fish intimidate little fish just by their sheer size. Even where aggression is not obvious it is easy to imagine the smaller fish just waiting for the day when they finally make it onto the menu. As a result they be come timid and hide, often refusing to come out for food in case they themselves enter the food chain.
Again, on fish size, none of those on sale in the shop are fully grown. Typically the Tetra's and Barb's are 50% - 75% of their final size, while some of the Cichlids may by only 25% of adult size, but these are only general guidelines. Many of our customers ask for sucker fish, but few can tell the difference between Ancistris, Plecostomus or Gibbiceps, until its too late. What is the difference I hear you ask?, answer: about 60cm or more!
The reality is, although all members of the same wider family, the common Ancistris gets to about 4-6", the Gibbiceps about 16", and the Plecostomus rarely exceeds 24", so if in doubt about the eventual size of your prospective purchase, ask the assistant.
As to the size of the tank, the bigger, the better. Not only will a big tank support a wider range of fish, but the water quality will be more stable. Very desirable for the long-term health of you fish.
Finally, let me explode one of the oldest myths about fish keeping, "Fish only grow to match the size of their tank". Total and utter rubbish! Fish continue to grow throughout their lives. Most of the growth is in the first couple of years, but they do continue to get get bigger right up to their death. Putting them in too small a tank does not limit their size, it merely stunts and deforms their growth and leads to an early death.