I am creating a application with a single database.
1. Multiple stores can use the application & register there clients for billing/subscription. Client e-mailID is used as user name and client can also login in to the system.
Problem:
When the same client goes to a different store in the system, the store owner tries to register him with his e-mail address but this e-mail is already registered into the system with by the other store so registration is not possible with this e-mail address.
Solutions?
Multiple datbase?
Delink e-mail address from user id, I mean use a different user id auto generated by the system or something like that.
Let client choose his user name but if the client is trying to use the same user id then thrown a error.
Windows 8 Professional 64 Bit.
Visual Studio 2012
Sql Server 2012
-------------------------------------
www.HermesWritings.com
I would suggest delink useraccount from store account & include a entity relation table with userid and storeid. When user reregisters just add the user to the other store too.
Please mark as answered if this answer helped you.
Create a new database for each store - This is the most advisable option, but it will need more time in creating new database for each store and maintaining them. Also if you are planning to use data from all the sites, it will become very tough.
Second option is seperate userinfo from storeinfo & permit for duplication where the customer will have multiple accounts, but only one account per store. This is useful when it comes to customer not knowing the backend system.
But I think seperating userinfo and storeinfo will be very useful in the long run.
You can authenticate the customer based on userid, password & the storeid.
Please mark as answered if this answer helped you.
Creating a new database for every store seems more cumbersome kind and i need to figure out a way to automate it. but is this option a better option in long learn? Do most of the enterprise application do this? Have you used Intuit QuickBook online are such
apps created on multiple database or single?
Now the second option. I am using asp.net security class for authencation by default i am making user e-mail as username and username is unique in the database, so if the same user tries to register with different store, how do i create duplicate username?
does security class allow that? during authentication i take care to map the username to store but how do i have the same username for different stores?
Windows 8 Professional 64 Bit.
Visual Studio 2012
Sql Server 2012
-------------------------------------
www.HermesWritings.com
Create GUID for the all store web sites and pass GUID from the website to database.Like as Below:
Store Table
1. Site A GUID1
2.Site B Guid2
3 so on
Every method in BLC will contain a parameter ApplicationID equiavalent to GUID.When you hit DB you can hit the only data which is related to this GUID.
there will be Many to many relationship exists b/w user and store table then create a asscication table to maintain this relation.
Yes, new database is a difficult task, primarily if you are having to change queries etc in the code or fields in the database. Over a period of time it will require dedicated people to manage the database. but it is the best solution both in terms of security
& flexibility.
If you want to go ahead with the multi-tenant model then, It is advisable to have a different unique id instead of emailid.
But if you don't have the option of changing the username, include the storeid also in your query & permit duplicate usernames. So if a username, password & storeid matches, then accept login.
Please mark as answered if this answer helped you.
Is it ok that if they are logged into one store they are also logged into the other stores at the same time because that will be the end result of sharing one database amongst them. Furthermore, if you allow the stores to administer their users they will also
be able to effect the customers of other stores. This raises data protection issues. Whilst technically you can share one database, I think from a business perspective you need to have a separate database for each store.
MCSD, MCPD, MCTS
Marked as answer by bhanu2217 on Mar 30, 2012 05:52 AM
Actually scrub that, are you not using different application ids for each store? If you have different Application IDs for each store that should work around the problem for you.
Why can't each login be unique and then have a lookup with a 1:many relationship for store IDs? This would also be how you could maintain a single database and still span multiple stores and users. I am assuming the database is centerally located and not
some local database with replicated updates or anything to and from each store.
bhanu2217
Member
527 Points
458 Posts
Database Design
Mar 27, 2012 08:22 AM|LINK
I am creating a application with a single database.
1. Multiple stores can use the application & register there clients for billing/subscription. Client e-mailID is used as user name and client can also login in to the system.
Problem:
When the same client goes to a different store in the system, the store owner tries to register him with his e-mail address but this e-mail is already registered into the system with by the other store so registration is not possible with this e-mail address.
Solutions?
Visual Studio 2012
Sql Server 2012
-------------------------------------
www.HermesWritings.com
Shankar_ss
Participant
1270 Points
279 Posts
Re: Database Design
Mar 27, 2012 08:31 AM|LINK
I would suggest delink useraccount from store account & include a entity relation table with userid and storeid. When user reregisters just add the user to the other store too.
Shankar
bhanu2217
Member
527 Points
458 Posts
Re: Database Design
Mar 27, 2012 08:36 AM|LINK
but when user logs in to the system he will log in from the store1 website or store 2 webiste
so which store data to show him will be a problem.
User doesn't know both the store use the same software when he comes to store1 website and logs in he should see store 1 data only.
Though links can vary but the end system is the same
Visual Studio 2012
Sql Server 2012
-------------------------------------
www.HermesWritings.com
Shankar_ss
Participant
1270 Points
279 Posts
Re: Database Design
Mar 27, 2012 10:52 AM|LINK
Yes, you are correct. You have a few options:
Create a new database for each store - This is the most advisable option, but it will need more time in creating new database for each store and maintaining them. Also if you are planning to use data from all the sites, it will become very tough.
Second option is seperate userinfo from storeinfo & permit for duplication where the customer will have multiple accounts, but only one account per store. This is useful when it comes to customer not knowing the backend system.
But I think seperating userinfo and storeinfo will be very useful in the long run.
You can authenticate the customer based on userid, password & the storeid.
Shankar
bhanu2217
Member
527 Points
458 Posts
Re: Database Design
Mar 27, 2012 11:45 AM|LINK
Creating a new database for every store seems more cumbersome kind and i need to figure out a way to automate it. but is this option a better option in long learn? Do most of the enterprise application do this? Have you used Intuit QuickBook online are such apps created on multiple database or single?
Now the second option. I am using asp.net security class for authencation by default i am making user e-mail as username and username is unique in the database, so if the same user tries to register with different store, how do i create duplicate username? does security class allow that? during authentication i take care to map the username to store but how do i have the same username for different stores?
Visual Studio 2012
Sql Server 2012
-------------------------------------
www.HermesWritings.com
paritoshmmec
Participant
1555 Points
304 Posts
Re: Database Design
Mar 27, 2012 12:25 PM|LINK
Create GUID for the all store web sites and pass GUID from the website to database.Like as Below:
Store Table
1. Site A GUID1
2.Site B Guid2
3 so on
Every method in BLC will contain a parameter ApplicationID equiavalent to GUID.When you hit DB you can hit the only data which is related to this GUID.
there will be Many to many relationship exists b/w user and store table then create a asscication table to maintain this relation.
Please let me know in case of more help
Thanks and Regards,
Paritosh
Shankar_ss
Participant
1270 Points
279 Posts
Re: Database Design
Mar 27, 2012 12:32 PM|LINK
Yes, new database is a difficult task, primarily if you are having to change queries etc in the code or fields in the database. Over a period of time it will require dedicated people to manage the database. but it is the best solution both in terms of security & flexibility.
If you want to go ahead with the multi-tenant model then, It is advisable to have a different unique id instead of emailid.
But if you don't have the option of changing the username, include the storeid also in your query & permit duplicate usernames. So if a username, password & storeid matches, then accept login.
Shankar
frez
Contributor
5418 Points
913 Posts
Re: Database Design
Mar 27, 2012 12:34 PM|LINK
frez
Contributor
5418 Points
913 Posts
Re: Database Design
Mar 27, 2012 12:42 PM|LINK
atconway
All-Star
16846 Points
2756 Posts
Re: Database Design
Mar 27, 2012 02:10 PM|LINK
Why can't each login be unique and then have a lookup with a 1:many relationship for store IDs? This would also be how you could maintain a single database and still span multiple stores and users. I am assuming the database is centerally located and not some local database with replicated updates or anything to and from each store.