Batteries in Renewable Energy Systems

What is the roll of a battery bank in renewable energy systems? When are they absolutely required and when are they optional? When they are optional, when are they a good idea? How are battery banks sized? What types and chemistries of batteries are reasonable in different situations? What care is required for different types of batteries? What are the life cycle costs of different types of batteries? What new types of batteries are on the horizon?