My current POJOs have Collection attributes instantiated when defined which is mainly for convenience, as we do not worry about checking for null or instantiating elsewhere in the code.
private List<Report> reports = new ArrayList<Report>();
The majority of these POJOs contain only a couple of these collection properties, and most are List type. However this results in an empty array persisted in Mongo.
My question is, are there any performance or throughput pitfalls to be concerned with, or potential data access issues? There are requirements to find items by value within these collections.
Here is an example for scale:
- Example POJO contains 2 lists
- Estimate 5 million persisted / year
- Guessing ~75% will be empty
7.5 million empty lists potentially