Discover and read the best of Twitter Threads about #Redis

Most recents (8)

Redis Series Part 4 thread is here!
Today, we're diving into Redis `Hashes`, simple explanations, and real-world example
#redis #series #thread 🧵
If you haven't read the previous thread about the list, check it out
Hash is essentially a collection of field-value pairs, where each field is a unique identifier and each value is the associated data. Just like JSON object or python dictionary. Everything inside the hash is a string.
In this example, we gonna store the user preferences when they want to receive threadletters in nooli.in
HSET: command adds one or more fields-values to key
HSET <KEY> field1 value1 field2 value2
Read 11 tweets
Redis Part 3 is here! Today, we'll be exploring the power of Redis 'Sets'. #redis #thread 🧵
If you haven't read the previous thread about the list, check it out
Redis Sets are a unique way to store your data! They allow for an unordered collection of strings with no duplicates. Perfect for managing sets of items without worrying about repetition
Let's dive in with an example, Say we want to give one lucky user a year of free membership to Nooli. With Redis Sets, users can enroll in the giveaway but only once, preventing duplicates. Easy and efficient!
Read 12 tweets
Excited to teach Redis core concepts in the next few days! 🧵 #Redis #thread 👇 Image
Redis: Open-source, highly-replicated, performant, non-relational, database & caching server. Maps keys to values with the predefined data model. Data stored in-memory data store, It is good for caching, message brokers & streaming engines
Let's start with the string data structure
String: Store and retrieve a string, serialized json, numerical values, and binary data

Syntax:
SET <KEY> <VALUE>
GET <KEY>

MSET & MGET to assign and retreive multiple key valye in single command

Below e.g you can try in redis-cli Image
Read 11 tweets
#Redis
大key影响:因为redis是单线程的,如果自己或者其他上游访问一个大key或自己批量操作mget等操作造成一次性访问过大的数据量成一个大key卡顿,会造成大key的卡顿,卡顿时间长短和key的大小以及对这个大key访问的操作有关。如果redis卡顿,会造成其他所有请求该redis的请求超时报错
在业务侧的表现就是一波抖动报错,如果持续访问大key,会导致整个redis吞吐严重下滑,超时报错持续增多。

大key标准:
string value大小大于 10KB,单位是byte
hash/set/zset/list等 数据结构中 元素个数大于 5000
hash/set/zset/list等 单key整体value大于 10mb
解决思路:
1.大key拆分,结合具体业务场景,将大key进一步拆分为小key
2.对大key进行压缩
3.避免大key全部内容获取等操作,比如hgetall等获取全部内容的命令替换为逐个访问的命令;避免O(n)等开销大的操作
4.批量操作 mget、pipline 等操作控制key 个数在20内并且所有key 大小不要超过100k
Read 4 tweets
Un cliente del ámbito de la energía solar nos propone un reto: llevar a cabo la ingesta de miles de datos por segundo desde múltiples emisores, asumiendo el procesado, almacenamiento y posterior explotación de dichos datos. Lo hemos conseguido y te contamos cómo. Hilo va.
Aunque podríamos pararnos a hablar de las diferentes piezas de este proyecto de #BigData, hoy nos centraremos en mostrarte cómo hemos desplegado más de mil contenedores para la parte de recepción, procesado, caché e inserción en BBDD de todos esos datos.
Empezamos por el principio: Desde el equipo de desarrollo y en coordinación con el equipo de sistemas de Irontec, se diseña una arquitectura con los siguientes elementos: #MQTT, #Redis, #ClusterBBDDRelacional, #Elasticsearch
Read 18 tweets
I'll share 100 Laravel tips on performance, security and reliability over the next 100 days!

Simply follow this thread 👇 to get them daily.

🔥 Laravel Tip #01: Consider adding route caching to your deployment script to speed up your route registration by up to 5x! Image
🔥 Laravel Tip #02:

Did you know that if you have your MySQL database running on your web server, you can improve performance by up to 50% by using Unix sockets instead of TCP ports?

The folks over at @Percona published a benchmark on this.

Link: percona.com/blog/2020/04/1… Image
🔥 Laravel Tip #03:

Whenever your app allows the user to define a filename to be uploaded, make sure you strip out the directory from the input to protect against unrestricted file upload attacks.

Learn more: laravel-enlightn.com/docs/security/… Image
Read 83 tweets
توی پروژه ای الان چند وقتی هست مشغلوشیم بکند کارمونو یکی از بچه ها نوشته و بسیار خشن هرچی دم دستش بوده رو گذاشته توی جیسون و میفرسته سمت #فرانت من و توجیح جالبی هم براش میارن که معماری mvc توی برنامه نویسی قدیمی شده و دیگه هرچی توی بکه توی فرانتم باید باشه :) گذشت تا اینکه دیشب/۱
دیدم جیسونی که برای ادمین میفرسته ۹۹۰۶۴ تا کارکتر داره (مدارکش موجوده) و با اینکه میدونید #مانگو چقدر کنده (توی پیدا کرد از چندتا کالکشنو...) این ریکوست رسیدنش به من ۷ ثانیه طول میکشید دیگه تصمیم گرفتم خودم برای بکش یه کش بنویسم و با استفاده از #redis یه میدل ویر گذاشتم وسط هر/۲
روت که دیتا رو اگر توی دیتابیس ردیس نباشه به مدت یک ساعت کش کنه و از اونجایی که ردیس کی ولوعه سرعتمو رو ۷ برار بیشتر کرد که عالی شد که البته دفعه اولی که یوزر لاگین میکنه حدودا همون ۶ ثانیه بالاخره باید صبر کنه 😕،اما مسئله بعدی ای که هست اینه که وقتی دیتا کش میشه موقتا دسترسی/۳
Read 7 tweets
@georgberky 14/ New trends in Databases

not necessarily for #groovylang, but something everyone needs to know like #jooq #hibernate #postgres #neo4j #tinkerpop #cassandra #redis #mongodb
15/ #groovypuzzlers or a similar interactive session to get people talking about #groovylang
16/ Dynamic vs static programming in #groovylang

- performance differences
- tooling improvements
- etc
Read 15 tweets

Related hashtags

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!