Explain CAP theorem with PostgreSQL versus a multi-region DynamoDB-style store.
Simple meaning
On a network partition you cannot have both linearizable consistency and availability.
Open the full page for Why, Steps, Example and Key takeaway.
Panel-ready Java Specialist questions for freshers and experienced developers. Practice at Coding Cadre in Faridabad, or Online from Delhi NCR.
On a network partition you cannot have both linearizable consistency and availability.
Open the full page for Why, Steps, Example and Key takeaway.
L4 (TCP) balances connections without reading HTTP, which is simple and fast.
Open the full page for Why, Steps, Example and Key takeaway.
Stickiness pins a user to one instance so in-memory session state works, which defeats even load and complicates deploys.
Open the full page for Why, Steps, Example and Key takeaway.
Do not start a global XA transaction across services.
Open the full page for Why, Steps, Example and Key takeaway.
Choreography: OrderPlaced triggers Inventory to reserve
Open the full page for Why, Steps, Example and Key takeaway.
You write the business row and an outbox row in the same database transaction, then a publisher streams outbox events to Kafka.
Open the full page for Why, Steps, Example and Key takeaway.
The place-order API commits the order as CREATED and returns quickly
Open the full page for Why, Steps, Example and Key takeaway.
Each client key has a bucket of tokens that refill at a constant rate
Open the full page for Why, Steps, Example and Key takeaway.
The merchant sends a unique merchant transaction id
Open the full page for Why, Steps, Example and Key takeaway.
SET key token NX EX seconds so only one caller wins and the lock expires if the process dies.
Open the full page for Why, Steps, Example and Key takeaway.
Idempotent producers prevent duplicate writes of the same produce batch to a partition after retries, using sequence numbers.
Open the full page for Why, Steps, Example and Key takeaway.
Check processing time versus poll interval, stop-the-world GC, downstream DB pool exhaustion, and whether one hot partition has a skewed key.
Open the full page for Why, Steps, Example and Key takeaway.
G1 is the common default: good throughput with pause goals in tens of milliseconds at moderate heaps.
Open the full page for Why, Steps, Example and Key takeaway.
A heap leak shows old-gen occupancy rising across GC cycles and retained objects in a heap dump, often caches without bounds.
Open the full page for Why, Steps, Example and Key takeaway.
Thread dump if requests hang, CPU is high on a few threads, or you suspect deadlock: you see stack traces and lock owners.
Open the full page for Why, Steps, Example and Key takeaway.
Many threads blocking on the same monitor or striped lock serialize work and burn CPU on context switches.
Open the full page for Why, Steps, Example and Key takeaway.
parallel streams steal from the common ForkJoinPool and can starve the whole JVM under load.
Open the full page for Why, Steps, Example and Key takeaway.
Always lock accounts in a total order, for example by ascending account id, so two transfers cannot wait on each other.
Open the full page for Why, Steps, Example and Key takeaway.
They are proxy-based AOP.
Open the full page for Why, Steps, Example and Key takeaway.
A method that catches nothing and throws IOException can still commit partial JDBC work.
Open the full page for Why, Steps, Example and Key takeaway.