{"id":25828603,"url":"https://github.com/bbcho/shiny_redis_example","last_synced_at":"2026-06-11T11:31:12.816Z","repository":{"id":170808738,"uuid":"448749962","full_name":"bbcho/shiny_redis_example","owner":"bbcho","description":null,"archived":false,"fork":false,"pushed_at":"2022-01-18T06:31:31.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T21:32:08.496Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bbcho.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-17T04:09:31.000Z","updated_at":"2022-01-17T04:47:14.000Z","dependencies_parsed_at":"2023-07-23T14:15:56.213Z","dependency_job_id":null,"html_url":"https://github.com/bbcho/shiny_redis_example","commit_stats":null,"previous_names":["bbcho/shiny_redis_example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bbcho/shiny_redis_example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbcho%2Fshiny_redis_example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbcho%2Fshiny_redis_example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbcho%2Fshiny_redis_example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbcho%2Fshiny_redis_example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbcho","download_url":"https://codeload.github.com/bbcho/shiny_redis_example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbcho%2Fshiny_redis_example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34197393,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-28T17:48:40.480Z","updated_at":"2026-06-11T11:31:12.810Z","avatar_url":"https://github.com/bbcho.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shiny_redis_example\n\n## Redis Cluster Notes\n\n- https://redis.io/topics/cluster-tutorial\n- https://www.containiq.com/post/deploy-redis-cluster-on-kubernetes \\*\\* best one\n- https://medium.com/swlh/production-checklist-for-redis-on-kubernetes-60173d5a5325\n\n### Redis Cluster and Docker\n\nCurrently Redis Cluster does not support NATted environments and in general environments where IP addresses or TCP ports are remapped.\n\nDocker uses a technique called port mapping: programs running inside Docker containers may be exposed with a different port compared to the one the program believes to be using. This is useful in order to run multiple containers using the same ports, at the same time, in the same server.\n\nIn order to make Docker compatible with Redis Cluster you need to use the host networking mode of Docker. Please check the --net=host option in the [Docker documentation](https://docs.docker.com/engine/userguide/networking/dockernetworks/) for more information.\n\n### Logging into Redis Kubernetes Cluster\n\n`kubectl -n redis exec -it redis-0 -- sh # master`\nor\n`kubectl -n redis exec -it redis-1 -- sh # a slave`\n\n```\nredis-cli\nauth \u003cpassword\u003e\nexit # to exit, do twice\n```\n\n### Accessing the Redis Cluster\n\n```{python}\nimport redis\nr = redis.Redis(\n    host='redis-0.redis.redis.svc.cluster.local',\n    port=6379,\n    password='password')\nr.set('foo', 'bar')\nr.get('foo')\n\n# to store dataframes\n# https://stackoverflow.com/questions/57949871/how-to-set-get-pandas-dataframes-into-redis-using-pyarrow/57986261#57986261\n\nimport pyarrow as pa\nimport redis\n\npool = redis.ConnectionPool(host='localhost', port=6379, db=0)\nr = redis.Redis(connection_pool=pool)\n\ndef storeInRedis(alias, df):\n    df_compressed = pa.serialize(df).to_buffer().to_pybytes()\n    res = r.set(alias,df_compressed)\n    if res == True:\n        print(f'{alias} cached')\n\ndef loadFromRedis(alias):\n    data = r.get(alias)\n    try:\n        return pa.deserialize(data)\n    except:\n        print(\"No data\")\n\n\nstoreInRedis('locations', locdf)\nloadFromRedis('locations')\n```\n\n## More complex objects\n\nhttps://stackoverflow.com/questions/15219858/how-to-store-a-complex-object-in-redis-using-redis-py\n\nuse json\n\n```{r}\nlibrary(rredis)\nrredis::redisConnect(\n    host='redis-0.redis.redis.svc.cluster.local',\n    port=6379,\n    password='password'\n    )\nredisSet('test','value')\nredisGet('test')\n\ndata \u003c- data.frame(a = 1:3, b = letters[1:3], c = Sys.Date() - 1:3)\ndf \u003c- as_tibble(data)\nredisSet(\"df\", df)\nredisGet(\"df\")\n\n# for faster performance for 10,000 writes per second use:\nlibrary(\"rredis\")\nredisConnect()\nredisConnect(nodelay=TRUE)\nfor(j in 1:100) redisSet(\"x\", j)\n\n# or pipelining\nlibrary(\"rredis\")\nredisConnect()\nredisSetPipeline(TRUE)\nfor(j in 1:100) redisSet(\"x\", j)\nresp \u003c- redisGetResponse()\n```\n\nhttps://stackoverflow.com/questions/56334974/connect-to-kubernetes-mongo-db-in-different-namespace\n\n# Rstudio\n\nhttps://stackoverflow.com/questions/70591310/deploy-rstudio-web-ide-on-kubernetes-via-helm\nhttps://artifacthub.io/packages/helm/dsri-helm-charts/rstudio\n\n# Juptyer\n\nhttps://towardsdatascience.com/jupyter-notebook-spark-on-kubernetes-880af7e06351\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbcho%2Fshiny_redis_example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbcho%2Fshiny_redis_example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbcho%2Fshiny_redis_example/lists"}