servincloud (@servincloud) header
servincloud (@servincloud) profile picture
San Salvador, El Salvador
Joined September 2013
Photo by servincloud (@servincloud)Photo by servincloud (@servincloud)Photo by servincloud (@servincloud)
Lost in the maze of coding principles? Today, let's decode SOLID, DRY, KISS, YAGNI, WET, and HOLLYWOOD. 1. 𝗦𝗢𝗟𝗜𝗗 - A beacon of good design Single Responsibility: One class, one job. Open-Closed: Open for extension, closed for modification. Sounds like a secret society, doesn't it? Liskov Substitution: Child classes must be substitutable for their base classes. Interface Segregation: Clients shouldn't be forced to depend on interfaces they don't use. Dependency Inversion: High-level modules shouldn't depend on low-level ones. Both should depend on abstractions. 2. 𝗗𝗥𝗬 Don't Repeat Yourself: If you've written it once, don't write it again. Code duplication creates more places for bugs to hide. 3. 𝗞𝗜𝗦𝗦 Keep It Simple, Stupid: Complexity is the enemy of understanding. Keep your code as simple and straightforward as possible. 4. 𝗬𝗔𝗚𝗡𝗜 You Aren't Gonna Need It: Do not add functionality until you absolutely need it. A minimalist approach to code can save time and reduce complexity. 5. 𝗪𝗘𝗧 Write Everything Twice: Contrary to DRY, WET suggests duplicating code can sometimes make sense, especially when the cost of making it reusable outweighs the benefits. 6. 𝗛𝗢𝗟𝗟𝗬𝗪𝗢𝗢𝗗 𝗣𝗿𝗶𝗻𝗰𝗶𝗽𝗹𝗲 Don't Call Us, We'll Call You: This principle encourages low-level components to be passive and to have high-level components decide when they need to act. The beauty of these principles lies in their application. They serve as a compass, guiding us towards cleaner, more efficient code. 📌 𝗣.𝗦:- To learn about C# and .NET join my weekly .NET Newsletter with 𝟲𝟮𝟬𝟬+: lnkd.in/dNHxJGRG. Repost ♻️ to spread the knowledge
6
142
3
572
74,786
servincloud retweeted
Differences between OAuth 2.0 and JWT (JSON Web Token) buff.ly/3PCIrqq
1
82
258
31,140
Did you know that you can visualize YAML, JSON and Data of many other formats in comprehensive and easy to navigate graphs directly in your favorite 𝗜𝗗𝗘 or in an 𝗼𝗻𝗹𝗶𝗻𝗲 𝗲𝗱𝗶𝘁𝗼𝗿? Check out PlantUML. Here is how you can take advantage of the tool: ➡️ Install PlantUML extension in your favorite 𝗜𝗗𝗘 - it supports 𝗣𝘆𝗖𝗵𝗮𝗿𝗺, 𝗜𝗻𝘁𝗲𝗹𝗹𝗶𝗝, 𝗩𝗦𝗖𝗼𝗱𝗲 and many more. ➡️ Create a file with .𝗽𝘂𝗺𝗹 extension. ➡️ Add 𝗬𝗔𝗠𝗟/𝗝𝗦𝗢𝗡 content or one of many other supported formats enclosed in a specific decorators. e.g. @𝘀𝘁𝗮𝗿𝘁𝘆𝗮𝗺𝗹 <𝗰𝗼𝗻𝘁𝗲𝗻𝘁> @𝗲𝗻𝗱𝘆𝗮𝗺𝗹 for yaml. ➡️ See your diagram created and changed in real time as you type! 𝗧𝗵𝗲𝗿𝗲 𝗶𝘀 𝗺𝗼𝗿𝗲: ➡️ The graphs are interactive, each time you press on an object in the graph you get the source code representing the object highlighted and ready to be edited! ➡️ You can style the output graph using code! ➡️ You can save the graph as a picture in different formats making it easy to be used as part of documentation! ➡️ There is an online editor as well, link in the comment section. 𝗡𝗲𝘃𝗲𝗿 𝗴𝗲𝘁 𝗹𝗼𝘀𝘁 𝗶𝗻 𝘁𝗵𝗲 𝗬𝗮𝗺𝗹 𝗝𝘂𝗻𝗴𝗹𝗲 𝗮𝗴𝗮𝗶𝗻! ------- Follow me to upskill in #MLOps, #MachineLearning, #DataEngineering, #DataScience and overall #Data space. Also hit 🔔to stay notified about new content. 𝗗𝗼𝗻’𝘁 𝗳𝗼𝗿𝗴𝗲𝘁 𝘁𝗼 𝗹𝗶𝗸𝗲 💙, 𝘀𝗵𝗮𝗿𝗲 𝗮𝗻𝗱 𝗰𝗼𝗺𝗺𝗲𝗻𝘁! Join a growing community of Data Professionals by subscribing to my 𝗡𝗲𝘄𝘀𝗹𝗲𝘁𝘁𝗲𝗿: newsletter.swirlai.com
12
217
2
982
195,163
If you want to learn DevOps, watch these YouTube videos: 1. Overview 🔗 youtube.com/watch?v=w1-Sgahf… 2. Roadmap 🔗 youtube.com/watch?v=7pT0oviB… 3. Tools 🔗 youtube.com/watch?v=4It0D0Nw… 4. Engineering 🔗 youtube.com/watch?v=j5Zsa_eO… 5. Full Course 🔗 youtube.com/watch?v=5KtRF4Nu…
8
130
2
336
86,809
75 Top YouTube channels for Daily Learning: ❯ Java ➟ Jakob Jenkov ❯ C# ➟ kudvenkat ❯ Python ➟ Corey Schafer ❯ HTML/CSS ➟ Kevin Powell ❯ JavaScript ➟ developedbyed ❯ Golang ➟ Jon Calhoun ❯ Swift ➟ CodeWithChris ❯ Kotlin ➟ PhilippLackner ❯ PHP ➟ ProgramWithGio
50
523
13
1,985
373,675
Regular consumer group rebalances in Kafka can be pretty disruptive... All consumers: 1. Stop consuming in order to give up their partition ownership 2. Re-join the group via the JoinGroup request 3. Receive a brand new partition assignment via the SyncGroup request, only once the rebalance finishes There is a short window of unavailability for the entire consumer group between steps 1) and 3) - a “stop the world” event. The length of this unavailability depends on two things: • happy path: how fast the consumers can join back 🙂 • not-so-happy path: the session_timeout_ms 😕 • worst case: until your consumers stabilize 😥 What do I mean by the worst case? You don’t want to know. If your rebalance doesn’t execute successfully, it will be restarted: • if your consumer doesn’t join the group at all in session_timeout_ms, the group will complete the rebalance without them. When it does catch up and join - a new rebalance will start. ✨ • if your consumer starts the rebalance dance but doesn’t complete it in session_timeout_ms - the group will abort the rebalance, kick them out of the group, and begin a new rebalance. And when it restarts back up and joins - a new rebalance will start again. Besides the trickiness of the timeout during a rebalance, the basic cases that can start a new rebalance are: • if any consumer fails. • if any consumer restarts. • if a new consumer joins the group. So we both have: 1. plenty of common cases that trigger rebalances 2. tricky cases that can disrupt ongoing rebalances It’s not hard to imagine how this process can become very unstable when you have: • 100s of consumers 👨‍👩‍👦‍👦 • running inside your complex multi-threaded application ⚙️ • hosted on iffy cloud networks & VMs 🌥 We call this phenomenon a rebalance storm 🌪️🌩️ The easy thing to do first is to enable static consumer group membership (covered in a previous post). That ensures that your group doesn’t rebalance during a regular consumer restart, which is a good first step. Even with static membership - rebalances are inevitable. It's no silver bullet - restarts are just one cause of rebalances. 🥈 And the problem with rebalances is that it interrupts consumption from ALL of your partitions - a window of unavailability for the whole consumer group. We can try all we want to reduce the NUMBER of rebalances - but that is bound to have diminishing returns. 📉 Edge cases exist where a single rebalance can take a long time purely due to not all consumers being able to cleanly join without timing out. The more important thing is to reduce the disruption DURING a rebalance. i.e. - do not interrupt the app’s consumption during the rebalance. 🧘🏻‍♀️ After all, remember that a consumer group rebalance is nothing more than a partition reassignment between the consumers. 🤔 If at all times there’s only one consumer joining/leaving, how many partitions are actually changing hands? Not many. It, therefore, does not make much sense to pause all the other consumers when they’re bound to get the exact same partitions after the rebalance finishes. 🤔 Thankfully - we have a workaround! Cooperative Incremental Rebalances are exactly that. This feature allows consumers to retain their partition ownership during rebalances! It’s called that way because: • incremental: we always move the minimum number of partitions and require multiple rebalance rounds to complete. 1️⃣ & 2️⃣ • cooperative: each consumer voluntarily needs to release partitions that need to be re-assigned. 🎤👋 Sounds complex, but the changes are very simple 👉 1. have each consumer NOT revoke its partitions and NOT stop consumption during rebalances. 2. ensure the Group Leader computes a “sticky” assignment so that it reassigns the minimum number of partitions on member join/leave. 3. always do 2 rebalances - one to revoke the minimum subset of partitions and one to assign them. Two rebalances are required because: 1. the partition assignment is always sent via the last part of the rebalance dance - the SyncGroup response. 2. you need to revoke & assign it separately to ensure no 2 consumers read the same partition at once. Note that consumer semantics are still at least once. But. At least (pun intended) they aren’t egregiously bad. If Kafka had used just one rebalance, there would exist a delta between the SyncGroup response coming to the two consumers (the one that revoked its partitions and the one that received them) during which both can consume. In any case, this cooperative incremental rebalance trades off time to rebalance (it’s a bit longer) for less disruption. 👌 And it works 🔥 The difference is staggering. Some tests showed that the impact can be: 🔥 ~21x faster to start up 900 Kafka Connect tasks 🔥 ~12.5x faster to shut them down 🔥 at least *double the throughput* during rebalances Because rebalances are a normal occurrence in large groups - the cooperative protocol can be thought to have net better throughput. Another test was performed with Kafka Streams - a rolling bounce/upgrade of 10-instances showed the following consumption pause times due to rebalances: 🐌eager: 37,138ms total pause time with 🔥cooperative: 3,522ms paused (10x less) Both Streams and Connect showcase that cooperative rebalancing is very impactful, especially in cases where state needs to be loaded on a consumer's partition assignment. --- For more concise #ApacheKafka content: 1. As they say in church - hit the 🔔 2. Check the 1-a-week 2-minute-read #Kafka newsletter in my profile (while hitting the 🔔) 3. 💜 like & RT to increment the Twitter algorithm counter. Maybe if enough of us do it at once - we can force their consumer groups to rebalance.
1
33
135
21,222
servincloud retweeted
You want to advance your DevOps knowledge? Here are 15 BEST FREE DevOps Udemy Courses! 1. Free Devops Interview Questions and Answers Prepare for Devops interview with confidence lnkd.in/eSxRiXSs 2. Rudder - Mastering the DevOps Rudder to configure your infrastructure lnkd.in/e-fJwiMN 3. FREE Advanced Jenkins in K8s (Docker in Docker) Learn why you'd want to deploy Jenkins as K8s pod. Intro to Advanced Jenkins in K8s course. lnkd.in/eY68gmPQ 4. DevOps on AWS: Code, Build, and Test (Course 1 of 3) Learn the basic concepts, technology, use cases, and benefits of implementing DevOps on AWS lnkd.in/ep5eEHkZ 5. DevOps on AWS: Release and Deploy (Course 2 of 3) Eliminate the all-hands-on-deck manual process at the end of the development cycle lnkd.in/ew93iB76 6. DevOps on AWS: Operate and Monitor (Course 3 of 3) Track, identify, understand key metrics and resolve application or infrastructure issues in real time lnkd.in/eXb2aZtQ 7. DevOps : Docker UI With DockStation, Portainer, Lazy Docker DevOps, Docker UI For Obsolete beginners with Portainer, LazyDocker, DockStation, & How to run Dockerfile without Docker lnkd.in/eN4tDF7q 8. Learn Devops Kubernetes deployment by kops and terraform Comprehensive Nginx deployment to Kubernetes on AWS by using kops and terraform lnkd.in/efi9xv7V 9. AWS DevOps CI/CD - CodePipeline, Elastic Beanstalk and Mocha AWS DevOps Continuous Integration and Delivery CI/CD for NodeJS using AWS CodePipeline, AWS Elastic Beanstalk and Mocha. lnkd.in/eKVfpNFA 10. Jenkins Introduction for Developer End to End Integration : Selenium - Maven - Git - Jenkins lnkd.in/eQ4FYvzZ 11. Terraform Foundations with Azure Build a Dev Environment with Terraform and Azure lnkd.in/e5Ez5Z7M 12. Hands-on Terraform Foundations Build a Dev Environment with Terraform and AWS lnkd.in/eds7eTbe 13. Learn CI/CD Pipeline With Jenkins, Python, Docker, DockerHub lnkd.in/eFfH_SYa 14. Integrate Jenkins GitHub and AWS In Practice lnkd.in/ePwQ-_Ek 15. Power Platform ALM DevOps Master Class End-to-End Instruction for Power Platform ALM DevOps lnkd.in/e43ggK5Q Follow @ghumare64 for more DevOps content. Retweet for reach 🐦
12
83
1
246
42,341
Aprendo mucho mejor con diagramas que con un texto largo. 📊 Si eres como yo, esta breve guía es para ti.👇 Dibuja diagramas para cualquier tema usando chatGPT : 🧵 HILO 🧵
18
167
4
634
152,846
No tienes que pagar nada para generar imágenes hermosas con la IA. ❌ Adobe ofrece una herramienta gratuita para crear imágenes con IA. ✅ Aquí te explico cómo acceder y usarla 👇 🧵 HILO 🧵
40
398
4
1,466
359,455
5 IA originales que no debes perderte : 🔻Para tus logotipos : @stockimgAI 🔻Animaciones en 1 segundo : @genmoai 🔻Edita tus imágenes a través de un prompt : @playground_ai 🔻Traducir videos : @PapercupAI 🔻Crear memes : @supermeme_ai
2
110
264
19,509
10 sitios web SECRETOS impulsados por IA para terminar horas de trabajo en minutos (No los pierdas). Utiliza estas extensiones además de ChatGPT para aumentar tu productividad🚀📈 🧵 >>> MEGA HILO <<< 🧵
255
7,969
148
36,650
4,952,395
15 cosas increíbles creadas por GPT-4 ↓
44
853
65
4,001
856,688
1. Este usuario de Twitter creó HustleGPT.  Le dio a GPT-4 $100 y le dijo que ganara dinero. Por cierto, ya está generando ingresos. teapawt.net/jacksonfall/status/163…
I gave GPT-4 a budget of $100 and told it to make as much money as possible. I'm acting as its human liaison, buying anything it says to. Do you think it'll be able to make smart investments and build an online business? Follow along 👀
2
22
1
246
121,513
servincloud retweeted
Docker and Kubernetes Expert Free Resources - Part 4 Thread 🧵👇
16
138
2
453
66,329
servincloud retweeted
In today's video, we're diving into the world of computer memory and storage. We will talk about: - The fundamental duo: RAM and ROM - DDR4 and DDR5 - Firmware and BIOS - SRAM and DRAM - HDD, SSD, USB Drive, SD Card - and more Watch the video now: youtu.be/lX4CrbXMsNQ
14
234
2
1,100
108,803
Enroll for the FREE training courses that come with free assessments and digital badges 👇 Architecting (new!): bit.ly/architect23 AWS for Games (new!): go.aws/3l6fYf7 Serverless: go.aws/3UZpFs0 Object Storage: go.aws/3wv&cyx Block Storage: go.aws/3wv8cyx File Storage: go.aws/3wv&cyx Storage Data Migration: go.aws/3wv&cyx Data Protection & Disaster Recovery: go.aws/3wv8cyx
28
350
4
1,092
103,786
Se lanzaron más de 200 herramientas de IA en las últimas 2 semanas. Es hora de aprovechar algunas nuevas herramientas de IA. Aquí hay 11 nuevas herramientas impulsadas por IA que debe probar en 2023:
84
1,179
18
4,309
498,532
5 herramientas de IA para crear diseños impresionantes 👇👇: Experiencia de usuario/interfaz de usuario: @uizard Logotipo: @stockimgAI Marcaje: @lookadesign Maquetas: @flairAI_ Edición de imagen: @DesignifyO
18
224
1
650
52,991
Si quieres destacar en el mercado laboral, necesitas una certificación. Pero la mayoría de los programas de certificación son costosos. Aquí hay 5 sitios web que ofrecen cursos de certificación GRATUITOS que acelerarán su carrera: ↓
4
220
3
723
60,135