Click here to Skip to main content
14,267,437 members
   

Database

 
PinnedHOW TO ANSWER A QUESTION PinPopular
Chris Maunder16-Jul-09 3:10
adminChris Maunder16-Jul-09 3:10 
PinnedHow to get an answer to your question PinPopular
Chris Maunder10-Nov-05 16:30
adminChris Maunder10-Nov-05 16:30 
QuestionSQL Remote Connection Problem Pin
Kevin Marois11hrs 20mins ago
professionalKevin Marois11hrs 20mins ago 
AnswerRe: SQL Remote Connection Problem Pin
Richard Deeming10hrs 27mins ago
mveRichard Deeming10hrs 27mins ago 
GeneralRe: SQL Remote Connection Problem Pin
Kevin Marois9hrs 51mins ago
professionalKevin Marois9hrs 51mins ago 
GeneralRe: SQL Remote Connection Problem Pin
Richard Deeming9hrs 44mins ago
mveRichard Deeming9hrs 44mins ago 
GeneralRe: SQL Remote Connection Problem Pin
Kevin Marois9hrs 30mins ago
professionalKevin Marois9hrs 30mins ago 
QuestionDate format in SQL Database export to Excel 23/01/1990 00:00:00 instat of 23/01/1990 Pin
jan Meeling20hrs 57mins ago
memberjan Meeling20hrs 57mins ago 
QuestionRe: Date format in SQL Database export to Excel 23/01/1990 00:00:00 instat of 23/01/1990 Pin
Richard MacCutchan20hrs 18mins ago
protectorRichard MacCutchan20hrs 18mins ago 
AnswerRe: Date format in SQL Database export to Excel 23/01/1990 00:00:00 instat of 23/01/1990 Pin
jan Meeling17hrs 33mins ago
memberjan Meeling17hrs 33mins ago 
GeneralRe: Date format in SQL Database export to Excel 23/01/1990 00:00:00 instat of 23/01/1990 Pin
Victor Nijegorodov15hrs 52mins ago
memberVictor Nijegorodov15hrs 52mins ago 
GeneralRe: Date format in SQL Database export to Excel 23/01/1990 00:00:00 instat of 23/01/1990 Pin
Richard MacCutchan14hrs 49mins ago
protectorRichard MacCutchan14hrs 49mins ago 
AnswerRe: Date format in SQL Database export to Excel 23/01/1990 00:00:00 instat of 23/01/1990 Pin
Victor Nijegorodov18hrs 53mins ago
memberVictor Nijegorodov18hrs 53mins ago 
GeneralRe: Date format in SQL Database export to Excel 23/01/1990 00:00:00 instat of 23/01/1990 Pin
jan Meeling17hrs 29mins ago
memberjan Meeling17hrs 29mins ago 
AnswerRe: Date format in SQL Database export to Excel 23/01/1990 00:00:00 instat of 23/01/1990 Pin
Eddy Vluggen18hrs ago
mveEddy Vluggen18hrs ago 
GeneralRe: Date format in SQL Database export to Excel 23/01/1990 00:00:00 instat of 23/01/1990 Pin
jan Meeling17hrs 17mins ago
memberjan Meeling17hrs 17mins ago 
GeneralRe: Date format in SQL Database export to Excel 23/01/1990 00:00:00 instat of 23/01/1990 Pin
Eddy Vluggen17hrs 9mins ago
mveEddy Vluggen17hrs 9mins ago 
QuestionProduct Architecture Pin
Chiranjana13-Aug-19 0:50
memberChiranjana13-Aug-19 0:50 
AnswerRe: Product Architecture Pin
David Mujica13-Aug-19 3:50
memberDavid Mujica13-Aug-19 3:50 
GeneralRe: Product Architecture Pin
Chiranjana13-Aug-19 5:05
memberChiranjana13-Aug-19 5:05 
AnswerRe: Product Architecture Pin
Mycroft Holmes13-Aug-19 12:50
memberMycroft Holmes13-Aug-19 12:50 
Questioncookies vs sessions for storing users id for ecommerce site Pin
djtrixy2-Aug-19 21:48
memberdjtrixy2-Aug-19 21:48 
AnswerRe: cookies vs sessions for storing users id for ecommerce site Pin
Afzaal Ahmad Zeeshan3-Aug-19 4:02
mveAfzaal Ahmad Zeeshan3-Aug-19 4:02 
Let's discuss this in a bit proper detail with the application of performance, security and regulations.

You can store anything that is publicly available on your website, and does not contain any personal or identifying information in a cookie. The reason for this is, that a user might be accessing your website from a public machine or PC and that data might be tracked or stored. Next, for a session you can use this storage to store any information that might identify (because, hey, that is what a session is about, right?) the user and help your website perform an operation quickly—without having to query the database again just to find out their user id, or email address. Do remember that on most frameworks (if not all), session data is sent to the client too.

Now as per regulations, make sure you are requesting permissions from the users to store the cookies on their machines—European regulations require you do that, and then there is GDPR, and etc. etc.

Now as for the database part, this space is expensive and filling it with the content that does not help you in anyway—let us for a moment ignore the analytics, user studies, machine learning for recommender systems, etc.—and they will only take away the space that you should pay for the content that helps you generate some business profits.

What I would recommend here is, store the cart information in the cookies, just reference the URLs of the items they want to purchase. This way, the cart information will be stored locally. This will decrease the overall load on your web servers, and will not cause extra charges in the database storage as well since your users will be storing their interests locally and won't add a cart option in database, and forget it leaving there forever.

One tip I can provide here is to use localStorage APIs, instead of cookies, because cookies also have a round trip from and back to server, adding an overhead on the HTTP request.

Window.localStorage - Web APIs | MDN

In this approach, of course you will end up showing what John wanted to purchase to Johanna as well, and that can be fixed by storing the session id(! Remember, store only the session id not the user id and then verify that the sessions are same for the user—which can be done by some backend algorithm to check if user ids of the sessions are the same Laugh | :laugh: )
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~

QuestionI didn't design it but I need to get data out of it. Pin
rnbergren2-Aug-19 4:23
memberrnbergren2-Aug-19 4:23 
AnswerRe: I didn't design it but I need to get data out of it. Pin
Richard Deeming2-Aug-19 4:51
mveRichard Deeming2-Aug-19 4:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.