Multiple nopCommerce sites on 1 database

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 years ago
yes very interested in this option - would use the multiple shops on one sql straight away
14 years ago
"As far as I know, the only other OS project that does this is Magento."

Magento and their multiple store fronts on one database feature is precisely why one database is not a great idea.  Try deleting a store front (or anything else) from Magento and watch the sparks fly.  I spent an entire week testing out Magento and had so many "404 page not found" errors after making routine additions and deletions. I can't understand how anyone can keep that platform running consistently.

DNN is another example of using one database with multiple sites (portals).  Think about your customers clicking, adding, and deleting at will and then ask yourself, "will this effect my other customers or store fronts who are using the same database"?  ehhh.

It is an understandable need for a customer who has multiple store fronts to want to manage everything from one location, but unless you really know what your doing and trust your customers won't 'break' anything, one site/one db is probably the safest way to go.  Build a separate front end to run reports/inventory/etc.  

Just my 2 cents.
14 years ago
I've actually turned nopCommerce into a multiple ecommerce store, this is 1 customer with 2 websites using the same database, same backend etc etc.  This took about a month to complete with some other integration stuff along the way.  Unforunately I can't share any of the code at present but if anyone has any specific questions please ask.

In summary what I have done is:

I created a store table in the database.
Everything time we need to get stuff related to one particular store we do something like
string currentUrl = HttpContext.Current.Request.ServerVariables["SERVER_NAME"];  which then compares the records in our store table in the database.
we have 1 website in IIS with 2 host headers.
14 years ago
1 database vs multiple databases.

This is a no brainer as I see it.

You must provide a customer with a way to backup their BUSINESS.
That is, you need to provide the shop owner with a backup of his database somehow.
If you go bust, then how are you going to separate all your customers data into separate
databases.

Would you really start a business online where your entire future is dependant on a one man band
working from home, who could not afford to even buy his own copy of SQL Server!

Each customer MUST have his own database AND a way to keep his own backup.
Otherwise he could sue the operator for loss of business etc.
I am not sure if you could even get liability insurance to operate your commerce hosting business
without mitigating this risk.

Take legal advice before designing your solutions with cost saving as a driver.
Simply buy a copy of SQL Server, get a good deployment tool, and NEVER create architecture to overcome
a cost saving issue.

Regards
Steve
14 years ago
@msargius

In your post from October 20 you proposed changing MembershipHttpModules.cs in order to insert Store identification code.
IMO it would be better to create a new Class that implements IHTTPModule and handles HttpApplication.BeginRequest event. The new module can then be registered with the application in web.config (lines 175 & 200).
The reason is that such change would be much more resilient against nopCommerce updates.

Btw, does someone knows a way to register the module in the database or on the runtime? That way it would be completely independent from updates.
14 years ago
Maybe create a new Database, and create view for some table on original database table?
14 years ago
Hi Skiltz
You said that you successfully managed to implement multiple stores, so I'd have few questions (more or less on the topic) if this doesn't bother you:
1. I assume that each store would have it's own pricing for it's products, if yes do you have any advice on the things to take into account - if I'm too vague please let me know.
2. More of curiosity (I already asked this on a separate thread but not really happy with the answer), since you've done quite a few changes on DB, DAL and BL, did you do all these changes manually - for example adding a new column to a table?

Thanks
14 years ago
Prices are same on all stores.  If we need a different price we add a new product.  Sounds limiting but works fine for us.  We have the ability to choose which products appear on which store.

All changes to everything were done manually. If there is another way please let me know :)
14 years ago
I would recommend writing SQL Scripts for all changes on DB. I have them all packed in one sql file, and have created an aspx page that is similar to nopCommerce install page. When this page is called it executes the sql scripts the same way the original install page does.
14 years ago
Hi
Thank you to all of you.
I'll try to explain you why I asked that (the automatic code generation).
Some time ago I used DashCommerce - similar ECommerce (not as better though :) ) - and it had the DAL/BL generated using Subsonic - hence, when you changed something in the DB you just ran some commands and the DAL/BL was updated.

Thanks again,
Tudor
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.