Gemini can turn any book into an interactive mindmaps
You can do it for books of hundreds of pages thanks to the massive context window and with a single prompt.
Perfect for those who memorize better visually (demo and prompt below):
After years of building event-driven systems.
Here are the top 4 mistakes I have seen:
1. Duplication
Events often get re-delivered due to retries or system failures. Without proper handling, duplicate events can:
• Charge a customer twice for the same transaction.
• Cause duplicate inventory updates, messing up stock levels.
• Create inconsistent or broken system states.
Solution:
• Assign unique IDs to every event so consumers can track and ignore duplicates.
• Design event processing to be idempotent, ensuring repeated actions don't cause harm.
2. Not Guaranteeing Order
Events can arrive out of order when distributed across partitions or queues. This can lead to:
• Processing a refund before the payment.
• Breaking logic that relies on correct sequence.
Solution:
• Use brokers that support ordering guarantees (e.g., Kafka).
• Add sequence numbers or timestamps to events so consumers can detect and reorder them if needed.
3. The Dual Write Problem
When writing to a database and publishing an event, one might succeed while the other fails. This can:
• Lose events, leaving downstream systems uninformed.
• Cause mismatched states between the database and event consumers.
Solution:
• Use the Transactional Outbox Pattern: Store events in the database as part of the same transaction, then publish them separately.
• Adopt Change Data Capture (CDC) tools to track and publish database changes as events automatically.
4. Non-Backward-Compatible Changes
Changing event schemas without considering existing consumers can break systems. For example:
• Removing a field might cause missing data for consumers.
• Renaming or changing field types can trigger runtime errors.
Solution:
2. Not Guaranteeing Order
• Maintain versioned schemas to allow smooth migration for consumers.
• Use formats like Avro or Protobuf that support schema evolution.
• Add adapters to translate new schema versions into older ones for compatibility.
Every schema change is a test of your system's resilience—don't fail it.
What other mistakes have you seen out there?
I don't think people are ready for the complete revolution of the advertising and model industry that is about to come.
This is a model trained on Birkenstock shoes with @everartai and FLUX, using ONLY pictures of the object.
The results are instagram ready.
People seem to be really confused about the "right way" to fetch data in React, specifically "fetch on render" vs "render as you fetch". I tried my best to diagram the difference
Screenity est un enregistreur d'écran open-source écrit en JS. Il permet aussi d'annoter les captures, zoomer, matérialiser le curseur de la souris, exporter en mp4, ... ⬇️
https://t.co/1fAO3ro64N
I discovered a nice, easy-to-use feature on n8n that allows you to retry your failed workflows from the last point in case of an error.
With this it is a matter of retrying the last execution with either the last workflow or a new modified version
Life comes with a great game pre-installed.
It’s called Walking.
All you have to do to start is go for a walk outside.
Then it’s somewhat random, but every few thousand steps or so you will find yourself reliably rewarded with a great idea.
It’s free to play, forever.
@0FJAKE
I couldn't understand "Low coupling, high cohesion" until I saw this picture.
Let's explain these two in simple terms.
High Cohesion
The idea is to make components or modules within a system responsible for a single/related task or data.
Think of a well-organized toolbox where each drawer is dedicated to a specific type of tool - one drawer for screwdrivers, another for hammers, etc.
Each drawer (module or class) is cohesive because it focuses on a specific group of related tools (functions or data).
This way, you can easily find the tools you need for a job.
High cohesion makes software components easy to understand, maintain, and reuse.
Low Coupling
Low Coupling is about reducing dependencies between different modules or components.
So, changes in one module need minimal changes in others; this makes your system easy to maintain.
Imagine a train; you can attach or replace individual cars with minimal effort.
The same applies to modules to be modified or replaced with minimal impact on other system parts.
Combining high cohesion within components with low Coupling produces:
- Modular
- Flexible
- Maintainable system
Components can be easy to understand and worked on alone, thanks to high cohesion.
Components can easily be combined in different ways or replaced thanks to low Coupling.
Keep coding! (In a modular way)
🚀 Architecture Antipatterns 🚀
Discover common architecture antipatterns, learn how to avoid them and overcome design pitfalls! 🔥
https://t.co/QC1aLRnpGp
Caching 101: The Must-Know Caching Strategies
Fetching data is slow. Caching speeds things up by storing frequently accessed data for quick reads. But how do you populate and update the cache? That's where strategies come in.
🔍 Read Strategies:
Cache Aside (Lazy Loading)
- How it works: Tries cache first, then fetches from DB on cache miss
- Usage: When cache misses are rare or the latency of a cache miss + DB read is acceptable
Read Through
- How it works: Cache handles DB reads, transparently fetching missing data on cache miss
- Usage: Abstracts DB logic from app code. Keeps cache consistently populated by handling misses automatically
📝 Write Strategies:
Write Around
- How it works: Writes bypass the cache and go directly to the DB
- Usage: When written data won't immediately be read back from cache
Write Back (Delayed Write)
- How it works: Writes to cache first, async write to DB later
- Usage: In write-heavy environments where slight data loss is tolerable
Write Through
- How it works: Immediate write to both cache and DB
- Usage: When data consistency is critical
🚀 Real-Life Usage:
Cache Aside + Write Through
This ensures consistent cache/DB sync while allowing fine-grained cache population control during reads. Immediate database writes might strain the DB.
Read Through + Write Back
This abstracts the DB and handles bursting write traffic well by delaying sync. However, it risks larger data loss if the cache goes down before syncing the buffered writes to the database.
–
Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): https://t.co/kNfv0DVDdf
How can you enforce your software architecture?
When deadlines are tight, and you start cutting corners, that beautiful software architecture you built crumbles like a house of cards.
But you can write Architecture Tests to fix this.
Here's how: https://t.co/ALsM4lLrsQ
No-JS hamburger menu w/the popover API:
Browser handles:
- clicks on hamburger & close btns
- esc key to exit
- tab nav
- spacebar + enter key toggle (open & close)
- light dismiss (click away) close
How:
<btn popovertarget="menu">..</>
<div popover role="menu" id="menu">..</>
"The 12 Factor App is a methodology for building SAAS applications by Adam Wiggins. We cover how they have since evolved, what we can learn from them today and how they changed the status quo of yesteryear." https://t.co/0kNKYCyRMe (via @arcnotes and @myusuf3)