question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there a way to connect to a local redis server when using `@upstash/redis`?

See original GitHub issue

I use @upstash/redis in my vercel serverless functions. I can connect to the databases created in Upstash console.

Looks like the connection API is tailored to work wiht upstash redis server using http REST.

const redis = new Redis({ url: 'UPSTASH_REDIS_REST_URL', token: 'UPSTASH_REDIS_REST_TOKEN' });

I would also like to be able to connect to my local redis server for local development. I don’t really like the idea of sending requests over the network for local development. Using a different client for local development is not great either. So is there a way to run an upstash cluster in my local or connect to my local redis server using @upstash/redis?

Eg. CockroachDB lets run their cluster locally in my machine so I don’t have to build local only abstractions to work with CockroachDB.

It’d be nice to have something similar while working with Upstash.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12

github_iconTop GitHub Comments

1reaction
flexdineshcommented, Nov 5, 2022

Oh man I saw Go in their docs and mistook it for a go client. upstashdis is what I was looking for. Thanks for clearing it up @chronark and sorry about the confusion. 😀

0reactions
chronarkcommented, Nov 5, 2022

As I said above, it is a wrapper around a running redis instance to expose an http server compatible with our API. It’s not just a client.

upstash-redis-rest-server --addr <ADDR> --redis-addr <ADDR> [--api-token <TOKEN>]

But I do see your point. We’ll discuss providing a first party redis wrapper internally.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Connect Your Client | Upstash: Documentation
Probably, the easiest way to connect to your database is to use redis-cli . Because it is already covered in Getting Started, we...
Read more >
Redis by Upstash · Fly Docs - Fly.io
By connecting a database, you can run Redis commands on redis-cli. Update a Redis Database. Upstash Redis instances can't change their primary region...
Read more >
Connecting to Redis and Using The Redis Database - Linode
This tutorial gets you started using Redis. It explains how to connect to a Redis server that is located locally or remotely.
Read more >
Connect to Serverless Redis via GraphQL from wherever you ...
Upstash is a serverless database for Redis. With ... Now connect to the Redis server using the configuration provided by Upstash: ...
Read more >
Caching NextJS Apps with Serverless Redis using Upstash
For the data to move smoothly with zero delays between server and ... You can use Redis locally and connect to it from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found