balderdashy / balderdashy/sails
Sails-Redis Adapter - More direction/information around upgrading
- Dominant language
- JavaScript
- Stars
- 22.8k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
**Node version**: In process of upgrading to 14, but seeing it on 6-12.
**Sails version** _(sails)_: In process of upgrading from Sails 0.12 to Sails 1.x
**ORM hook version** _(sails-hook-orm)_: In process of upgrading from Sails 0.12 to Sails 1.x
**Sockets hook version** _(sails-hook-sockets)_: In process of upgrading from Sails 0.12 to Sails 1.x
**Organics hook version** _(sails-hook-organics)_: In process of upgrading from Sails 0.12 to Sails 1.x
**Grunt hook version** _(sails-hook-grunt)_: In process of upgrading from Sails 0.12 to Sails 1.x
**Uploads hook version** _(sails-hook-uploads)_: In process of upgrading from Sails 0.12 to Sails 1.x
**DB adapter & version** _(e.g. sails-mysql@5.55.5)_: In process of upgrading from Sails 0.12 to Sails 1.x
**Skipper adapter & version** _(e.g. skipper-s3@5.55.5)_: In process of upgrading from Sails 0.12 to Sails 1.x
I know that I am not giving all the "right" version information and I apologize if this isn't the right place for this sort of issue. This is more of a "where do we go from here"-type issue since I'm not seeing anything in the upgrade documentation around how to go about upgrading to the latest sails-redis connector (https://github.com/balderdashy/sails-redis).
We are currently in the process of upgrading from Sails 0.12 to Sail 1.x. However, we are running into a problem with sails-redis which has been discussed here before: that library has removed support for the previously available semantic and queryable interface(s).
In our 0.12 workflow, we currently operate something like this:
1) User starts a screen (a.k.a user-led session, but didn't want it confused with Sails/Socket.io Sessions)
```
// Data is stored in Redis
Screen.create({//my session data})
```
2) User runs the session and updates are made
```
// Data is updated in Redis
Screen.update({//data to be updated})
```
or
```
// Data returned lives in Redis
Screen.find({//query data}})
```
3) User ends session
```
// Data returned lives in Redis
const session = Screen.find({//unique session data});
// Using available MySQL adapter
PermanentSession.create({//data we wish to retain from non-permanent session});
```
At a high level, we create the object in redis and when the screen/session is complete, we write the data we want to retain into our database.
When going through the process of upgrading, I am lost as to what this would look like in the new sails-redis adapter. I understand I cannot use `Session.create({}), Session.find({}), Session.destroy({}), etc` since they have been removed. However, I'm not sure how I would go about creating that object so I could store it to Redis myself.
Would I simply remove the "redis" connection from the model and set it to be local, and manage the data in redis myself?
Should I first create the object in our MySQL connector and then delete it at the end when grabbing out the data we wish to be actually be permanently written?
Most of all, I feel a bit lost since the sails-redis library explicitly mentions they are doing away with the queryable and semantic interface, but there is no information I can find about how to actually upgrade my existing code to utilize the new sails-redis adapter.
Contributor guide
Research direction
Start with the Sails 0.12-to-1.x upgrade documentation and the linked sails-redis repository, focusing on the removal of semantic and queryable interfaces. Trace the existing Screen.create, Screen.update, Screen.find, and session-retention workflow described here. Done means the upgrade guidance explains a supported Redis storage and retrieval path for this use case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js, redis
- Domain
- backend, databases, documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100