When modeling a typical chat application (with infinite chats), should each message be treated as an aggregate instance?
Aggregates should be kept small, and can not think of some other decent and small candidate to contain user messages. But at the same time, I just wonder I should use an aggregate concept for such a small object of the system.
should each message be treated as an aggregate instance?
This is a good question, but asked to wrong group of people, as we don't know your business :)
Aggregate is a synonym for the boundary of a transactional consistency. [...] Properly designed Aggregate is the one, that can be modified in the way business needs to modify it, while providing business rules to be consistent as part of a single transaction. [...] Aggregates are mostly about consistency boundaries, and their design should not controlled by the need to create object graphs. [...] ~ Implementing Domain-Driven Design, Vaughn Vernon
Aggregates are mostly about transactional consistency in business rules. You should ask business if there are any rules regarding a single chat message. In a typical chat application probably not, but you have to ask business.
In a simplest chat application I can imagine, my chat message would rather be a Value Object. Or I would not even use DDD as Tseng mentioned. I can't think of any business rules I would need and it would definitly be immutable.