Given that YugaByte offers client drivers for Redis and Postgres, I was wondering about performance differences between the two if used in similar fashion.
For example, assume a Postgres table with 2 columns, 1 VARCHAR as the primary key and 1 TEXT column for the data. The only queries executed against this table are INSERT INTO
, UPDATE
, SELECT val
,SELECT EXISTS(...)
, DELETE FROM
all with a WHERE primary_key_constraint = val
condition.
Usage is analog to Redis operations SET
, GET
, EXISTS
, DEL
.
Does the Postgres driver add overhead to those operations compared to the Redis driver?
These should be in a similar ballpark-- but to be more precise, the performance via the YCQL/YEDIS APIs is expected to be faster than the YSQL API primarily because the client drivers for YCQL/YEDIS are cluster/partitioning aware and can route the query directly to the correct node in the cluster that owns key. In contrast, the vanilla Postgres client drivers, which were designed to talk to a single-instance database historically, are not aware of how the tables are sharded across multiple nodes - and so potentially incur an extra node hop to process the request.
Also, for YSQL, YugaByte DB doesn’t currently special case operations that only related to a single-shard/single-row, but that’s on the near term roadmap. So this gap should be bridged pretty soon.