Share
Embed
Transcript
33 slides
-
© 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 -
© 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 👋 -
© 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) -
© 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 -
© 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 -
© 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 ❤ -
© 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 -
© 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) -
© 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 -
© 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 -
© 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 -
© 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 -
© 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 -
© 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 -
© 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 -
© 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 😲 -
© 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 -
© 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 -
© 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 🧑💻 -
© 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… -
© 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… -
© 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 -
© 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 -
© 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 -
© 2023, Amazon Web Services, Inc. or its affiliates. All
rights reserved. @abhi_tweter Scaling Redis: Optimize for reads, write, or both? Amazon Elasticache documentation -
© 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 -
© 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? -
© 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 -
© 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) -
© 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 -
© 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 -
© 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 -
© 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