asp.net - Multiple domains, same application but different result on each subdomain. how to keep track of which account for the subdomain? -
I have a web application where users can register, each user will get a subdomain in their account and each subdomain will be unique But use the same web application as every one.
This application is .net and I run it on iis 2003 or 2008 (it is not yet valid) and I'm targeting (1000 subdomains) for approximately 1000 users
For example:
user1.mydomain.com user2.mydomain.com user3.mydomain.com alias sub.something.com domain aliases Due to getting an account id in subdomain name is not always possible.
So I was thinking about various methods 1: There is a database lookup display for each page request and the account ID is back. Drawbacks? Additional database communication and table and e-text search for all users with all domain names are not always good ideas in the database every time a page is requested.
2: Session as the number 1, but the account is saved as the account ID. But what happens with 1 thousend accounts, and each account has 1000 viewers, large amount of memory is used ??
3: I do not know if this is possible, but I think it's a good one ... I was thinking about making all subdomains .. User1., User2., User3 .. ..and the surname for each subdomain is saved within the IIS. Within each folder for all the domains, I create an ID file. Just as the User ID contains:
id.aspx ----- accountID = ##; ----- And after that I want to add all the files for the application to each subdomain. Explanation: Each subdomain contains the following files: web.mydomain.com from the web.mydomain.com file2.aspx virtual file from the id.aspx file1.aspx virtual file from web.mydomain.com File3.aspx Virtual file ...
. And the file is elsewhere on the IIS3 ... 3. Is this possible?
So please, is there anyone who can help me with this problem? What should I do? I think this is a common "problem" that many people have solved in a well.
Thank you for your reading.
Best Regards Matte
For me, challenge from the # 3 management perspective I would like to go with the same approach as # 2- Your mapping is stored in the database when the user logs in, the view is displayed and the account id is cached in the session state. If you are already using session status for something, then adding this bit information is not really an overhead. Otherwise, you can consider other options to cache this information - for example, it can be put in a cookie (to make sure you avoid encryption / check-in part of user identification You can also create an account ID (Push it into the authentication cookie, which is proof of tampered with ASP.NET Runtime).
Keeping in mind that you have access to 1000 uses I will select the most Memory Look up Table (Store A Dictionary in ASP.Net Cache or Static Variables), considering 10 aliens per user, this will not be more than 10000 entries - start the application and Create a table at the time of each request, take a look and get the account ID and store it in HttpContext so that it is available, so go ahead
Comments
Post a Comment