5
jassole
2y

Do people still use redis when you already use postgres? How is pg perf if you are writing like 10,000s of row data/second. I am slightly outdated....

Comments
  • 2
    I have not compared performance but redis is a completely different type of db and I would be surprised if redis is not faster for the areas it specializes in.

    And Redis also have some special features.
  • 1
    Redis will always outperform any rdbms in write performance, by orders of magnitude. (You are usually more limited by available bandwidth).

    However, as @Voxera said, they are completely different paradigms, and in the end it all depends on what you want to do with that data and what guarantees you want to have.
  • 1
    Sure, I agree about redis always outperforming. The thing I want to avoid is bringing in additional complexity. Data should always be written to db eventually, and the read side query on my data is usually time series queries which I am not sure redis will help much, as afaik I understand it to be mostly oriented to key-vals.
  • 0
    @jassole

    Redis is actually a very valid use case for timeseries data. There are even specific modules for it.
  • 0
    Really depends on your needs. For our solution we need to do about 8k/s reads/writes on data that can't be batched in a single query. These are really hard to do in postgresql because of the connection/worker per query execution model.
    We also use postgresql for other needs (like filling up the pipeline that do these individual queries). If part of the data in redis gets lost it's not a big deal but if a large part gets lost systems get a lot of unnecessary load. So we don't have an eventually need to write to relational database situation like you seem to have.
  • 0
    @CoreFusionX im using influx for these cases.
    Edi:t typo
  • 0
    @stop

    Don't know it, and quick Google didn't show anything relevant.

    I, myself, since clients are happy fielding the bills, I use AWS timestream 😂
  • 0
    @CoreFusionX its an self hostable timeseries db. Its the only thing i can use in my environment since the relevant programs have only 2 in common and both of the are influx in the two different major versions.

    Here is the site of tge company behind it:
    https://influxdata.com/products/...
  • 0
    https://redis.io/docs/stack/...

    Yes, Redis has an extension that can be used for timeseries.

    Though I'd ask wether it makes sense to use Redis extension with its own DSL for timeseries when you either can use SQL (PostgreSQL) or - imho even a better choice - just use Prometheus.

    I'm not a huge fan of InfluxDb...

    https://github.com/VictoriaMetrics/...

    Is an interesting project, which seems to be the most competitive alternative, though I never played with it by myself.

    Never the less worth a look.

    Imho Prometheus / InfluxDb / Victoria make more sense, as they offer more "bang" (features, etc).
  • 0
    @stop

    My bad. I inadvertently typed "imflux" and was like "plastic injection molding... Wut?" 😂
  • 0
    @CoreFusionX it was my error i mistyped it the first place
  • 1
    If your use case does not require the redis performance or features by all means go with just postgress, no need to add the complexity of multiple DB’s.

    And I would not use only redis if you need persistent storage even if redis @can” do that also.

    But if you find your living on the edge of performance with only sql then looking at redis before you hit said limit is probably worth it.
Add Comment