I would first check locks- row/table locks or long transactions (pg_locks, pg_stat_activity) can block inserts.
Also things like connection pool limits, WAL/replication lag, or too many indexes can hurt throughput.
We actually faced this in prod- inserts dropped because pgBouncer wasn't utilizing connections properly, even though the app pool was high.
A small config fix there and throughput improved a lot.
@javarevisited CDN only speeds up cached (mostly static) content π
If the website relies on dynamic APIs, backend processing, or heavy JS, it can still be slow.
Firstly I'd ask - do we need avg of the last 1 minute (sliding window) or avg per fixed minute (tumbling window)?
Then keep it simple β maintain a 1-minute window and just track sum + count (small in-memory state).
For each event β update both, and when the window ends β avg = sum / count.
If traffic grows, just partition and aggregate in parallel.
@SumitM_X Sharding by domain may lead to uneven distribution.
Millions of users might share https://t.co/EwqvuiA9Xw.
Hashing the full email would balance shards better.
@vivoplt Since JWTs are stateless, they stay valid until their exp claim expires.
For logout, systems typically expire access tokens quickly and revoke the refresh token.
@javarevisited Usually based on mutual friends and graph connections.
Social networks run recommendation logic on this graph data.
I demonstrated a similar concept in my Redis video.
https://t.co/q1uEG2Ov9n
@javarevisited Because threads don't run in a fixed order.
The scheduler decides who runs first, so the result can change every time.
I actually demonstrated this in my video on printing 1-N using M threads- shows how important it is to handle this properly.
https://t.co/u5yIrChh4f
K8s is great when different services need different CPU, memory, and scaling policies.
If you put a monolith in K8s, scaling just creates more identical pods of the same monolith, all needing the same resources and carrying the same bottlenecks.
K8s will orchestrate it beautifully- but itβs still one big monolith. π
@SumitM_X Both return the same result for an INNER JOIN.
The first uses explicit JOIN syntax, the second uses the old implicit comma join.
The difference?
One clearly defines the relationshipβ¦ the other just throws the tables together and hopes the WHERE clause behaves. π
@SumitM_X Iterator β sequential traversal.
Spliterator β traversal + ability to split the data source for parallel processing.
In short: Iterator walks the collection, Spliterator divides and conquers.
That's why the Java Stream API uses Spliterators internally for parallel streams.
Kafka durability means the message is safe in the log.
Retries exist because everything after poll() β DB writes, API calls, network hops β can still fail.
Kafka protects the data, retries protect the workflow.
Sharing the in-depth Kafka playlist below, it might help someone-
https://t.co/BzGUTXlCxA
Most people using Kubernetes every day have never seen what their cluster state actually looks like.
But every single object in Kubernetes (Pods, Deployments, Secrets, Servicesβ¦) is stored in etcd.
So what actually happens when you run:
kubectl apply -f pod.yaml
How does that YAML end up inside etcd?
In Part 3 of my ETCD deep dive series, I explain the full flow:
β’ kubectl β API Server
β’ API Server β etcd
β’ How Kubernetes objects are stored
β’ What the stored data actually looks like
β’ Explained step-by-step using real Kubernetes YAML
No slides. Just real examples and Kubernetes internals.
If you want to truly understand how Kubernetes works behind the scenes, this video will help.
π₯ Watch here:
https://t.co/TjuqeTya5N
#Kubernetes #DevOps #ETCD #CloudNative #PlatformEngineering
@brankopetric00 3 seconds locally. 40 minutes in production.
Looks like schema changes mixed with long-running transactions and concurrent writes caused the trouble here.
There was no rollback plan because AI probably has said: This should work. πππ