News for hackers. Stuff that matters.
Re:Iris: Fast back-end web framework for Go by Svenskunganka on Tuesday June 21, 2016 @03:38AM (#11944091)
I use Redis as the primary and only database. This results in quite large savings in terms of server infrastructure since memory has never been cheaper than it is today and the minimal amount of resources Redis consume in relation to the massive amount of throughput it provides. Additionally, it has data persistence reliability on par with Postgres and other battle-tested databases[0], so couldn't be happier about that.

The selling point of Redis for me has been its simplicity. It has a fairly small set of features in comparison to other databases, yet extremely powerful.

[0] - http://oldblog.antirez.com/post/redis-persistence-demystifie...

Re:Iris: Fast back-end web framework for Go by qaq on Tuesday June 21, 2016 @08:11AM (#11945085)
"it has data persistence reliability on par with Postgres" if we pretend transactions do not exist and postgres is running in some non-default config then maybe, but we don't need to pretend.
Re:Iris: Fast back-end web framework for Go by calcifer on Tuesday June 21, 2016 @09:31AM (#11945426)
Redis has transactions as well.
Re:Iris: Fast back-end web framework for Go by qaq on Tuesday June 21, 2016 @09:48AM (#11945544)
yes and if you set appendonly yes appendfsync always you will get about +/- PG write performance without all the features Now I know 0 production projects using these Redis settings and I would argue it's not intended use of Redis same way as running PG with fsync = off is not generally what you want to use
Re:Iris: Fast back-end web framework for Go by anarazel on Tuesday June 21, 2016 @03:59PM (#11948957)
My experience is actually that you'll often get a lot worse performance with redis if you enable durability. The reason being that postgres can batch several connection's/session's transaction commit fsyncs together, which IIRC redis can't.

(Disclaimer: Postgres guy, so I'm likely not impartial)

Re:Iris: Fast back-end web framework for Go by mbrock on Tuesday June 21, 2016 @11:14AM (#11946245)
Why isn't it intended use? And are there actual problems with it even if it isn't intended use?
Re:Iris: Fast back-end web framework for Go by jpgvm on Tuesday June 21, 2016 @03:12PM (#11948546)
It's not intended use because fsyncing every write to disk makes it inferior to every datastore designed to fsync every write. See here PostgreSQL.

For read performance if your dataset fits in memory PG is just as fast as Redis.

The main attraction of Redis is in-memory writes with async persistence. Trading durability and availability for the increased performance. If you give up this then there is precisely 0 reasons to choose Redis over PostgreSQL.

Re:Iris: Fast back-end web framework for Go by anarazel on Tuesday June 21, 2016 @03:55PM (#11948928)
> The main attraction of Redis is in-memory writes with async persistence.

FWIW, you can have that in postgres as well, cf. synchronous_commit = off

> Trading durability and availability for the increased performance. If you give up this then there is precisely 0 reasons to choose Redis over PostgreSQL.

As a PostgreSQL developer, I'd say that performance / latency / jitter can still be reasons to choose redis over postgres. The per-read overhead in redis is often a good bit lower than in postgres, and there's less variability in response times.

Re:Iris: Fast back-end web framework for Go by fweespeech on Tuesday June 21, 2016 @09:56AM (#11945589)
https://muut.com/blog/news/april-2014-service-failure.html

https://muut.com/blog/technology/redis-as-primary-datastore-...

Counter point of a real world implementation where they tried to make it the primary data store.

Re:Iris: Fast back-end web framework for Go by Svenskunganka on Tuesday June 21, 2016 @04:00PM (#11948961)
Have you even read the article? This was caused by Mongo running with a wrong flag, and the authors explicitly said that their backup script only contained ONE backup. That's bad engineering, not fault with Redis. Redis is extremely safe if you configure it correctly.
Re:Iris: Fast back-end web framework for Go by fweespeech on Friday June 24, 2016 @02:10PM (#11972069)
Yes, on a small number of nodes it works in a handful of use cases. That isn't the same as it being equal and equivalent in terms of reliability at scale.

They resorted to weird hack-y shit for something I use MySQL or Postgres for on a regular basis. So have most people who built stuff on Redis like this:

> I use Redis as the primary and only database. > Additionally, it has data persistence reliability on par with Postgres and other battle-tested databases[0], so couldn't be happier about that.

Re:Iris: Fast back-end web framework for Go by mtanski on Tuesday June 21, 2016 @11:18PM (#11951335)
redis by default does not fsync every change, instead it syncs every second. So no it's data reliability is not on par with Postgres in the default configuration.