I am modelling UserAggregate using DDD concepts. I know that two separate users should be independent, but when creating a new user, I need to validate, that there is no other user with the same username. How do I approach such a situation?
The search term for this sort of problem is set validation.
Some common answers
1) You investigate, and discover that the "rule" really isn't all that important to the business, and so you make a best effort at avoiding collisions, and have incident / exception reports that detect possible conflicts for human resolution. "If that name wasn't in use a second ago, good enough -- we'll deal with the data races by hand."
2) You punt, and put the burden of maintaining the business rule on the storage appliance. Which is to say, you store all of the users in a relational database, and enforce the uniqueness constraint there. This doesn't fit all storage options -- NoSQL storage will likely have a problem here.
3) You update your model, so that the set that needs to be valid is an aggregate unto itself. For a case like this one, the "set" would probably be something like a map of user names onto user identifiers.
4) You update your process, so that all requests for a given user name are routed to the same user aggregate - analogous to using the user name as the user identifier.
5) You recognize that user management is not a concern unique to your business, and you find an off the shelf solution, and adapt your processes to it. If users aren't your core business, this is often the right way to go.