Many-to-many relationship when one entity is without attributes I'm interesting in mapping many-to-many relationship to relational model.

I understand that the basic approach is to create a third table (associative entity) that connects the entities in many-to-many relationship. But what happens if one of the entities doesn't have attributes? Do we really need a third table?

For example, let's consider entities user and cluster. One user can belong to multiple clusters and one cluster can contain multiple users. And we could create a third table such as "belongs-to". But do we really need that if cluster doesn't have any attributes? Could we, in that case, put the user_id key as foreign key in cluster table and consider that pair (user_id, cluster_id) as a composite key?

I see no gain of creating another table. If cluster had attributes it wouldn't make sense to repeat all the information for each cluster. But if it doesn't have attributes than the same amount of information is saved in both cases, creating a separate table or putting the user_id key in cluster table.

I'm confused, what is the right thing to do?
The 'Right' thing to do depends.

If there's any chance the cluster might end up having attributes in the future, then yes you should have a join table.

Otherwise, if you are trying hard to normalize your data, then you should have a join table, if you are more concerned about minor size/performance boosts then you could skip the extra table. Personally, since I don't have a time machine to see the future, I'd make the extra table anyway.