Hi @tbhargava18 ,
Keep in mind that the topic is just metadata on the event which the broker can use for intelligent routing purposes. There is no need to " create number of topics for each user" as topics don’t actually exist on the broker. So by using a topic hierarchy which includes the information you want to filter on in each topic this is what allows you to filter in a simple and performant way.
Otherwise if you publish everything to one topic you then have to filter based on something else which isn’t as performant. This could mean you still have the broker doing it by using user properties / selectors or your app has to receive all messages, look into the payload and throw away what they don’t want.
If it’s a privacy concern maybe instead of userid you could use something like a browser session identifier? I’m not sure what’s available that you could use?