Thread: Redis 16 times faster than Postgres?

Redis 16 times faster than Postgres?

From
"Colin 't Hart"
Date:
Hi,

Can someone take a look at this blog post?

Can Redis really be 16 times faster than Postgres? Surely Postgres can get closer to the raw speed of the hardware than 1 order of magnitude?

Thanks,

Colin

Re: Redis 16 times faster than Postgres?

From
Nathan Woodrow
Date:
Redis is a in memory database so I would except it to be always much faster..

On Mon., 30 Sep. 2019, 7:42 am Colin 't Hart, <colinthart@gmail.com> wrote:
Hi,

Can someone take a look at this blog post?

Can Redis really be 16 times faster than Postgres? Surely Postgres can get closer to the raw speed of the hardware than 1 order of magnitude?

Thanks,

Colin

Re: Redis 16 times faster than Postgres?

From
Ron
Date:
On 9/29/19 4:42 PM, Colin 't Hart wrote:
> Hi,
>
> Can someone take a look at this blog post?
> https://www.peterbe.com/plog/redis-vs-postgres-blob-of-json
>
> Can Redis really be 16 times faster than Postgres? Surely Postgres can get 
> closer to the raw speed of the hardware than 1 order of magnitude?

Redis is an in-memory key-value database. PostgreSQL... isn't.


-- 
Angular momentum makes the world go 'round.



Re: Redis 16 times faster than Postgres?

From
Morris de Oryx
Date:
Sigh. I despair of "16x faster" and "20x faster" headlines that ignore the raw numbers. The worst numbers in there are far below the threshold of user perception. Unless these results are compounded by running in a loop, they are meaningless. Not immeasurable, just meaningless. 


That piece is from 1993, but the human nervous system hasn't changed since then.

Re: Redis 16 times faster than Postgres?

From
Ron
Date:
On 9/29/19 7:01 PM, Morris de Oryx wrote:
Sigh. I despair of "16x faster" and "20x faster" headlines that ignore the raw numbers. The worst numbers in there are far below the threshold of user perception. Unless these results are compounded by running in a loop, they are meaningless. Not immeasurable, just meaningless. 


That piece is from 1993, but the human nervous system hasn't changed since then.

Back-end web servers don't have human nervous systems. Faster response time means that a give bit of hardware can support a much higher load, saving you money

--
Angular momentum makes the world go 'round.

Re: Redis 16 times faster than Postgres?

From
Morris de Oryx
Date:
> Back-end web servers don't have human nervous systems. Faster response time means that a give bit of hardware can support
>  a much higher load, saving you money

Fair point, I can't argue against it as stated. Although I have no way of know if this person's site is ever overloaded or has any chance of saving money. Other sites do for sure. Not knocking using in-memory caches, they can be a life-saver.

Like everyone else here, I've been to a lot of meetings down the year that came down to arguing about optimizations that could not pay for themselves before the heat death of the universe. As such, I've developed an allergy to context-free performance comparisons. 

On Mon, Sep 30, 2019 at 10:25 AM Ron <ronljohnsonjr@gmail.com> wrote:
On 9/29/19 7:01 PM, Morris de Oryx wrote:
Sigh. I despair of "16x faster" and "20x faster" headlines that ignore the raw numbers. The worst numbers in there are far below the threshold of user perception. Unless these results are compounded by running in a loop, they are meaningless. Not immeasurable, just meaningless. 


That piece is from 1993, but the human nervous system hasn't changed since then.

Back-end web servers don't have human nervous systems. Faster response time means that a give bit of hardware can support a much higher load, saving you money

--
Angular momentum makes the world go 'round.

Re: Redis 16 times faster than Postgres?

From
Steve Litt
Date:
On Mon, 30 Sep 2019 07:46:14 +1000
Nathan Woodrow <madmanwoo@gmail.com> wrote:

> Redis is a in memory database so I would except it to be always much
> faster..

Is there a way to have Redis periodically update an on-disk backup?
That would be great, but otherwise you're at the mercy of your power
company (here in Central Florida it's routine for power to go down and
stay down for five hours).

SteveT
 
Steve Litt
Author: The Key to Everyday Excellence
http://www.troubleshooters.com/key
Twitter: http://www.twitter.com/stevelitt




Re: Redis 16 times faster than Postgres?

From
raf
Date:
Steve Litt wrote:

> On Mon, 30 Sep 2019 07:46:14 +1000
> Nathan Woodrow <madmanwoo@gmail.com> wrote:
> 
> > Redis is a in memory database so I would except it to be always much
> > faster..
> 
> Is there a way to have Redis periodically update an on-disk backup?
> That would be great, but otherwise you're at the mercy of your power
> company (here in Central Florida it's routine for power to go down and
> stay down for five hours).
> 
> SteveT
>  
> Steve Litt
> Author: The Key to Everyday Excellence
> http://www.troubleshooters.com/key
> Twitter: http://www.twitter.com/stevelitt

i don't know but voltdb, another in-memory database,
replicates to other instances which can be in different
geographical locations and so not prone to a single
power failure. perhaps all in-memory databases are
aware of the need for this.

cheers,
raf




Re: Redis 16 times faster than Postgres?

From
Ron
Date:
On 9/29/19 8:09 PM, Steve Litt wrote:
> On Mon, 30 Sep 2019 07:46:14 +1000
> Nathan Woodrow <madmanwoo@gmail.com> wrote:
>
>> Redis is a in memory database so I would except it to be always much
>> faster..
> Is there a way to have Redis periodically update an on-disk backup?
> That would be great, but otherwise you're at the mercy of your power
> company (here in Central Florida it's routine for power to go down and
> stay down for five hours).

It would be criminal for it not to have an async writer process flushing 
modified pages to disk.  And to not have a UPS that you've tested.

-- 
Angular momentum makes the world go 'round.



Re: Redis 16 times faster than Postgres?

From
Michael Paquier
Date:
On Sun, Sep 29, 2019 at 04:52:15PM -0500, Ron wrote:
> On 9/29/19 4:42 PM, Colin 't Hart wrote:
> Redis is an in-memory key-value database. PostgreSQL... isn't.

Well, I think that you have never heard about the urban legend of
running Postgres on scissors then and this reminds me of this blog
post:
http://www.databasesoup.com/2015/02/running-with-scissors-mode.html

Note that sometimes I have run Postgres on a tmpfs as well to test
some specific patches.  So that can be done, and of course that's
unsafe.
--
Michael

Attachment

Re: Redis 16 times faster than Postgres?

From
Ben Chobot
Date:
On Sep 29, 2019, at 8:44 PM, Ron <ronljohnsonjr@gmail.com> wrote:
>
> On 9/29/19 8:09 PM, Steve Litt wrote:
>> On Mon, 30 Sep 2019 07:46:14 +1000
>> Nathan Woodrow <madmanwoo@gmail.com> wrote:
>>
>>> Redis is a in memory database so I would except it to be always much
>>> faster..
>> Is there a way to have Redis periodically update an on-disk backup?
>> That would be great, but otherwise you're at the mercy of your power
>> company (here in Central Florida it's routine for power to go down and
>> stay down for five hours).
>
> It would be criminal for it not to have an async writer process flushing modified pages to disk.  And to not have a
UPSthat you've tested. 

It's perfectly reasonable to use Redis as a caching layer without any persistence at all. In such cases, flushing state
todisk is a waste of resources.  

(For other use cases, yes, Redis allows you to flush state to disk.)


Re: Redis 16 times faster than Postgres?

From
Imre Samu
Date:
from the original article:
> For example, the PostgreSQL speeds depend on the Django ORM code 
> that makes the SQL and sends the query and then turns it into the model instance.
> I don't know what the proportions are between that and 
> the actual bytes-from-PG's-disk times. But I'm not sure I care either. 

imho:   the "Django ORM" is not so fast.
according to "TechEmpower Web Framework Benchmarks" ...  
it has only  ~3% performance  -  compare to the best rust+pg (100%) results.

example:
the "django-postgresql" performance = 766   - only 3.0% of the best pg + rust results
checking the other test types (  "Single query" ;" Multiple queries" ) has a similar results.

the Django implementation of the test: 

Imre


Colin 't Hart <colinthart@gmail.com> ezt írta (időpont: 2019. szept. 29., V, 23:42):
Hi,

Can someone take a look at this blog post?

Can Redis really be 16 times faster than Postgres? Surely Postgres can get closer to the raw speed of the hardware than 1 order of magnitude?

Thanks,

Colin