This is an automated archive.

The original was posted on /r/golang by /u/dev-porto on 2023-09-01 08:09:30+00:00.


Hi,

I’m building a web application using Go.

For all of the templates rendered, I need to fetch a row from the database, that will contain styling/branding information, to be used in the template.

That information is in a MySQL table. The application also uses a Redis instance, for other purposes.

I’m wondering - would it be better to cache this “get style” that is currently coming from MySQL, in Redis?

What do you think would be cheaper, “Get row by PK ID” in MySQL or a “Get value by key” in Redis?

Thanks