Session management by storing recently fetched data at server (node.js)
up vote
2
down vote
favorite
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
add a comment |
up vote
2
down vote
favorite
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
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
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
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
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
node.js database session server
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
add a comment |
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
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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