Monday, March 19, 2012
Database Schema Designing
A company is involved into e-commerce..hosting multiple websites for different products.
CAse 2:
The above scenario could also be implemented with a single site having multiple products for sale.
For Case 2 one would go for a single database for all the products.
While for CAse 1 ,a separate Database is developed for each Site.
What I fill is CAse2 is a more appropriate choice even if we have multiple sites for different products.
This would help us in rapid development of any ecommerce site...
ANd better ERP management for the Company.
I would appreciate some expert guidelines for the above scenario
Thanx in Advance
Warm Regards
GirijaUnless there is something to do with IIS (or whatever web server you are using) that would benefit from different databases, I would have all the data in one database, and have more than web site access the database.
Having all of your data in one database would allow provide much better information (not just straight forward data entry, but the trends you can find through relations, etc.) and make it easier to manage...in my oppinion. However, make sure that if you use one database (and these are high volume web sites) that you are writing your code carefully to avoid unneccessary record locks.
Just my oppinion...
Tuesday, February 14, 2012
Database Page Counter
I need some comments regarding my Hit Counter that I have created for my sites. Here is my case:
I have developed several websites which I host along with MS SQL server. I created a class that calls a stored procedure to add a count to the database field. The way that I am using it is that every page in the page_load event will call the class indicating which counter to use (i.e. LoginPage, HomePage, ProductPage, etc.). The class in turn will perform the database route to increment the counter. In the Store procedure before incrementing the counter, I first check to see if a record for the current date has been created, if not I add the record with a date stamp with all the different counter values as zero. I then will add 1 to the desired counter for the date.
Is this a good solution?
What I now want to do is create a page that allows the different website owners to access a page with the relevant page counters.
Any ideas will be greatly appreciated.
ThanksIt's hard to offer opinions without seeing the table structure(s) and data.
One of the fields in your table(s) should be something like "CustomerCode". This will enable you to use a WHERE clause to filter the counters appropriate to each customer.
Terri|||I don't think it's a bad way, but what I would do is just create a monthly SQL job to create the records for the next month or so. Currently, you'd only add a record one time per day, but you'd check for its existence perhaps thousands of times throughout the day. Kind of a waste. That way, the record is always there and you're just doing an update for each call rather than a check and then an update.