How to manage open connections to Redis or any database in general?

This page summarizes the projects mentioned and recommended in the original post on /r/golang

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • Redis

    Redis Go client

  • I have a program in go that will open a new connection for each request. with a massive concurrent requests, redis goes down. I though why not i create a concurrent safe singleton pattern like this https://play.golang.org/p/BYxuXN16HlV. Do you think this approach is good or do u have a different approach. I know in mysql drive they handle the maximum number of open connections but it doesn't seem that's the case for this Redis package https://github.com/go-redis/redis

  • go-dependency-injection-example

    An example to demonstrate the dependency injection pattern in Go

  • IMO you should avoid package level state and use dependency injection to pass the DB reference to your HTTP handlers. I found an example here https://github.com/sohamkamani/go-dependency-injection-example

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts