Slide 1

Slide 1 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Go and Redis, Better Together Abhishek Gupta Principal Developer Advocate Amazon Web Services @abhi_tweter

Slide 2

Slide 2 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. abhirockzz.github.io @abhi_tweter abhirockzz abhirockzz 👋

Slide 3

Slide 3 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter Go and Redis – Intro Go and Redis in action - Common use cases Things you should know – tips, tricks, good practices… Agenda (Keep It Simple)

Slide 4

Slide 4 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter I ❤ Redis

Slide 5

Slide 5 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter Redis: One of THE most ❤ databases out there! DB Engines ranking Stack Overflow survey 2021

Slide 6

Slide 6 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter I ❤

Slide 7

Slide 7 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter Go - Cloud native lingua franca From go.dev Stack Overflow survey 2022

Slide 8

Slide 8 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter Simplicity Redis Commands (data types)

Slide 9

Slide 9 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter Simplicity Video and slides

Slide 10

Slide 10 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter Redis 101

Slide 11

Slide 11 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter Redis: Open Source Key-Value store Not just a cache Streaming, Pub/Sub, Queuing High Availability Redis Cluster: Replication and horizontal scalability Persistent In-memory for fast access, but can also persist writes In-Memory Data Structures Strings, Hashes, Lists, Sets…. Run Anywhere Cloud, Kubernetes, On-prem

Slide 12

Slide 12 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter Flexible: Redis data structures and APIs Data type Description Associated commands String Sequence of bytes APPEND,GET,SET,INCR,DECR,GETSET... List A list of strings LSET,LLEN,LPUSH,LPOP,LTRIM,RPOP... Set Nonrepeating, unordered collection of strings SADD,SCARD,SDIFF,SUNION,SINTER,SMEMBERS... Sorted set Nonrepeating, ordered collection of strings ZADD,ZCARD,ZCOUNT,ZRANK,ZSCORE... Hash Map of key-value pairs HGET,HGETALL,HKEYS,HVALS,HMSET,HMGET... Streams Log data structure XADD,XRANGE,XREAD,XACK,XCLAIM,XLEN... Geospatial Longitude-/latitude-based entries GEOADD,GEODIST,GEOPOS,GEORADIUS... Bitmaps Special usage of string type GETBIT,BITCOUNT,SETBIT,SETRANGE,GETRANGE... HyperLogLogs Probabilistic data structure PFADD,PFCOUNT,PFMERGE

Slide 13

Slide 13 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter Clients for Redis

Slide 14

Slide 14 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter Popular ones… List of Redis Clients

Slide 15

Slide 15 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter go-redis - github.com/redis/go-redis redis.com announcement uptrace.dev announcement redis.uptrace.dev

Slide 16

Slide 16 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter redigo - github.com/gomodule/redigo - Stable - Used in other implementations - API – too generic (?) - No Redis Cluster support 😲

Slide 17

Slide 17 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter rueidis - github.com/rueian/rueidis - (Relatively) New - Lots of features! - Interesting API - Benchmark comparison

Slide 18

Slide 18 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter Redis Client Ecosystem 1 2 3 4 5

Slide 19

Slide 19 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter Time for 🧑💻

Slide 20

Slide 20 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter Tips, tricks and more…

Slide 21

Slide 21 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter First things first…

Slide 22

Slide 22 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter Use the appropriate connection mode

Slide 23

Slide 23 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter Unable to connect to Redis, help! 😢 It’s probably the networking/security configuration Amazon ElastiCache and VPC

Slide 24

Slide 24 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter Redis scalability, Redis Cluster

Slide 25

Slide 25 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter Scaling Redis: Optimize for reads, write, or both? Amazon Elasticache documentation

Slide 26

Slide 26 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter After scaling your cluster, you better use those replicas! READONLY mode

Slide 27

Slide 27 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter Redis cluster: Use Hash Tags to influence how your keys are distributed Note the difference?

Slide 28

Slide 28 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter Sharded Pub/Sub Documentation

Slide 29

Slide 29 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter Bulk operations (cross-cluster)

Slide 30

Slide 30 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter Resources

Slide 31

Slide 31 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter Learn more... Go Redis GitHub repo Discord channel – Interact with the community Documentation Redis docs – great (general) resource Go Redis client – brief, but useful Using Redis on AWS? Op#mize Redis Client Performance for Amazon Elas#Cache and MemoryDB Best prac#ces: Redis clients and Amazon Elas#Cache for Redis Measuring database performance of Amazon MemoryDB for Redis

Slide 32

Slide 32 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter Other content….. Using Redis on Cloud? Manage Redis on AWS from Kubernetes Leaderboard app Getting started

Slide 33

Slide 33 text

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. @abhi_tweter Thank you! © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Abhishek Gupta Principal Developer Advocate Amazon Web Services @abhi_tweter https://pulse.buildon.aws/survey/ATNUMPOQ