Session management by storing recently fetched data at server (node.js)











up vote
2
down vote

favorite
1












We have a scenario where the server and db are far away. So the connection between them is slow.



Hence we are planning a strategy to maintain user sessions at the server memory itself. This means all the user fetched data, from db will reside at server and further changes to this data is kept at the server for a time interval (say 3 hours). The data is then saved to the database after every 3 hours.



Also, when another user requests the same data, it has to be fetched from the server memory if found.



Any ideas/ existing frameworks/ ORM to implement such a design?










share|improve this question
























  • Hi Srimol, could you clarify what's your question?
    – dege
    Nov 8 at 11:47






  • 1




    So when the server, or server process, is restarted all changed to the data from (at most) the last 3 hours is gone? Sounds like you should look into database replication.
    – robertklep
    Nov 8 at 12:55






  • 1




    @robertklep good suggestion. I was unaware of db replication. But have you heard of any frameworks or ORMs that handle this concern including the one problem which you mentioned? Like the server can be safely restarted by saving all the data.
    – Srimol
    Nov 8 at 15:08






  • 1




    Database replication is something that's typically built into databases. MongoDB, MySQL, PostgreSQL, etc. It would mean running a replica of the database on two locations.
    – robertklep
    Nov 8 at 16:03















up vote
2
down vote

favorite
1












We have a scenario where the server and db are far away. So the connection between them is slow.



Hence we are planning a strategy to maintain user sessions at the server memory itself. This means all the user fetched data, from db will reside at server and further changes to this data is kept at the server for a time interval (say 3 hours). The data is then saved to the database after every 3 hours.



Also, when another user requests the same data, it has to be fetched from the server memory if found.



Any ideas/ existing frameworks/ ORM to implement such a design?










share|improve this question
























  • Hi Srimol, could you clarify what's your question?
    – dege
    Nov 8 at 11:47






  • 1




    So when the server, or server process, is restarted all changed to the data from (at most) the last 3 hours is gone? Sounds like you should look into database replication.
    – robertklep
    Nov 8 at 12:55






  • 1




    @robertklep good suggestion. I was unaware of db replication. But have you heard of any frameworks or ORMs that handle this concern including the one problem which you mentioned? Like the server can be safely restarted by saving all the data.
    – Srimol
    Nov 8 at 15:08






  • 1




    Database replication is something that's typically built into databases. MongoDB, MySQL, PostgreSQL, etc. It would mean running a replica of the database on two locations.
    – robertklep
    Nov 8 at 16:03













up vote
2
down vote

favorite
1









up vote
2
down vote

favorite
1






1





We have a scenario where the server and db are far away. So the connection between them is slow.



Hence we are planning a strategy to maintain user sessions at the server memory itself. This means all the user fetched data, from db will reside at server and further changes to this data is kept at the server for a time interval (say 3 hours). The data is then saved to the database after every 3 hours.



Also, when another user requests the same data, it has to be fetched from the server memory if found.



Any ideas/ existing frameworks/ ORM to implement such a design?










share|improve this question















We have a scenario where the server and db are far away. So the connection between them is slow.



Hence we are planning a strategy to maintain user sessions at the server memory itself. This means all the user fetched data, from db will reside at server and further changes to this data is kept at the server for a time interval (say 3 hours). The data is then saved to the database after every 3 hours.



Also, when another user requests the same data, it has to be fetched from the server memory if found.



Any ideas/ existing frameworks/ ORM to implement such a design?







node.js database session server






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 8 at 14:58









anil_pulikoden

359625




359625










asked Nov 8 at 11:29









Srimol

112




112












  • Hi Srimol, could you clarify what's your question?
    – dege
    Nov 8 at 11:47






  • 1




    So when the server, or server process, is restarted all changed to the data from (at most) the last 3 hours is gone? Sounds like you should look into database replication.
    – robertklep
    Nov 8 at 12:55






  • 1




    @robertklep good suggestion. I was unaware of db replication. But have you heard of any frameworks or ORMs that handle this concern including the one problem which you mentioned? Like the server can be safely restarted by saving all the data.
    – Srimol
    Nov 8 at 15:08






  • 1




    Database replication is something that's typically built into databases. MongoDB, MySQL, PostgreSQL, etc. It would mean running a replica of the database on two locations.
    – robertklep
    Nov 8 at 16:03


















  • Hi Srimol, could you clarify what's your question?
    – dege
    Nov 8 at 11:47






  • 1




    So when the server, or server process, is restarted all changed to the data from (at most) the last 3 hours is gone? Sounds like you should look into database replication.
    – robertklep
    Nov 8 at 12:55






  • 1




    @robertklep good suggestion. I was unaware of db replication. But have you heard of any frameworks or ORMs that handle this concern including the one problem which you mentioned? Like the server can be safely restarted by saving all the data.
    – Srimol
    Nov 8 at 15:08






  • 1




    Database replication is something that's typically built into databases. MongoDB, MySQL, PostgreSQL, etc. It would mean running a replica of the database on two locations.
    – robertklep
    Nov 8 at 16:03
















Hi Srimol, could you clarify what's your question?
– dege
Nov 8 at 11:47




Hi Srimol, could you clarify what's your question?
– dege
Nov 8 at 11:47




1




1




So when the server, or server process, is restarted all changed to the data from (at most) the last 3 hours is gone? Sounds like you should look into database replication.
– robertklep
Nov 8 at 12:55




So when the server, or server process, is restarted all changed to the data from (at most) the last 3 hours is gone? Sounds like you should look into database replication.
– robertklep
Nov 8 at 12:55




1




1




@robertklep good suggestion. I was unaware of db replication. But have you heard of any frameworks or ORMs that handle this concern including the one problem which you mentioned? Like the server can be safely restarted by saving all the data.
– Srimol
Nov 8 at 15:08




@robertklep good suggestion. I was unaware of db replication. But have you heard of any frameworks or ORMs that handle this concern including the one problem which you mentioned? Like the server can be safely restarted by saving all the data.
– Srimol
Nov 8 at 15:08




1




1




Database replication is something that's typically built into databases. MongoDB, MySQL, PostgreSQL, etc. It would mean running a replica of the database on two locations.
– robertklep
Nov 8 at 16:03




Database replication is something that's typically built into databases. MongoDB, MySQL, PostgreSQL, etc. It would mean running a replica of the database on two locations.
– robertklep
Nov 8 at 16:03

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53206842%2fsession-management-by-storing-recently-fetched-data-at-server-node-js%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53206842%2fsession-management-by-storing-recently-fetched-data-at-server-node-js%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Schultheiß

Verwaltungsgliederung Dänemarks

Liste der Kulturdenkmale in Wilsdruff