node-pg-query-stream | Query results from node-postgres | Runtime Evironment library
kandi X-RAY | node-pg-query-stream Summary
kandi X-RAY | node-pg-query-stream Summary
Query results from node-postgres as a readable (object) stream
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of node-pg-query-stream
node-pg-query-stream Key Features
node-pg-query-stream Examples and Code Snippets
Community Discussions
Trending Discussions on node-pg-query-stream
QUESTION
We'd like to get a response from Redis as a stream, similar to Postgres Streams.
We've got a constraint to use as little server memory as possible. Some of our Lists can be ~10MB and requested simultaneously from multiple users.
Doing this the ol-fashioned way will eventually cause memory problems on our servers.
An alternative solution is to iterate the list and send lrange
commands, each batch returning a portion of the list items but that would be innefficient due to the network roundtrips.
Here's what I have for now, which is the standard way of doing things:
...ANSWER
Answered 2018-Sep-26 at 18:46Streaming is not yet implemented in Redis, so pagination is a good approach. That said, the List data structure does not support that pattern too well as LRANGE
is an expensive (O(N)) operation.
I suggest you consider an alternative data structure like Sorted Sets or the v5 Streams for storing your data.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install node-pg-query-stream
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page