balderdashy / balderdashy/sails
Table data not reflected in read data store after update in write data store
- Dominant language
- JavaScript
- Stars
- 22.8k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
**Node version**: 12.x
**Sails version** _(sails)_:1.0.x
**ORM hook version** _(sails-hook-orm)_: 3.1.0
**DB adapter & version** _(e.g. sails-mysql@5.55.5)_: sails-mysql@1.0.1
**Skipper adapter & version** _(e.g. skipper-s3@5.55.5)_: skipper-s3@0.6.0
We using two data stores for database operations. One connection is used for reading data from read database. Another one used for Create/Update/Delete mysql operations. What's the issue we faced is we can't able to get updated data in read data store immediately after certain time periods or request calls. We have to restart the sails app in order to get latest data from read data store. Is that anything we missed to configure with multi data store configurations ?
Mysql Used : AWS RDS
Server: EC2 Instance
Sample connection string:
This is the sample connection string we used
default: {
adapter: 'sails-mysql',
user: 'root',
password: '',
host: 'localhost', // RDS database
database: 'test',
multipleStatements: true,
port: 3306,
pool: true,
// ssl: true,
url: 'mysql://root@localhost:3306/test'
},
writeSqlserver: {
adapter: 'sails-mysql',
user: 'root',
password: '',
host: 'localhost', // RDS database
database: 'test',
multipleStatements: true,
port: 3306,
pool: true,
// ssl: true,
url: 'mysql://root@localhost:3306/test },
Sample Find query:
await Users.findOne({userId:1})
Contributor guide
Research direction
Start by reviewing the multi-datastore configuration and the Users.findOne({userId:1}) query against the listed Sails, ORM hook, Node.js, and MySQL versions. Reproduce the delayed visibility after a write and determine whether configuration or read/write routing causes it; done means updated rows are returned without restarting the app.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, mysql, node.js
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100