Why should a Spring Boot app use ExecutorService instead of new Thread()?
Simple meaning
Unbounded new Thread() under load will exhaust memory and file descriptors.
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.
Unbounded new Thread() under load will exhaust memory and file descriptors.
Open the full page for Why, Steps, Example and Key takeaway.
Runnable.run returns void and cannot throw checked exceptions.
Open the full page for Why, Steps, Example and Key takeaway.
Collections.synchronizedMap locks the entire map on every call.
Open the full page for Why, Steps, Example and Key takeaway.
It is the Java Memory Model rule that says memory writes by thread A become visible to thread B in a defined way.
Open the full page for Why, Steps, Example and Key takeaway.
PUT of the same body to the same URL should leave the resource in the same state no matter how many times you retry.
Open the full page for Why, Steps, Example and Key takeaway.
The client sends a unique Idempotency-Key
Open the full page for Why, Steps, Example and Key takeaway.
OFFSET skips N rows
Open the full page for Why, Steps, Example and Key takeaway.
Create: 201 with Location, or 200 if the body includes the resource.
Open the full page for Why, Steps, Example and Key takeaway.
Almost all expect versioned JSON APIs, nouns as URLs, and correct verbs and statuses.
Open the full page for Why, Steps, Example and Key takeaway.
The key identifies a client intent.
Open the full page for Why, Steps, Example and Key takeaway.
Sessions need a shared store such as Redis once you have more than one app instance, or sticky load balancing which you should avoid.
Open the full page for Why, Steps, Example and Key takeaway.
localStorage is easy for XSS scripts to steal.
Open the full page for Why, Steps, Example and Key takeaway.
The access token is short-lived and sent on every API call.
Open the full page for Why, Steps, Example and Key takeaway.
XSS injects script into a page the user trusts and can steal tokens or act as the user.
Open the full page for Why, Steps, Example and Key takeaway.
The user is redirected to the identity provider, logs in, and the browser comes back with a short-lived code.
Open the full page for Why, Steps, Example and Key takeaway.
The app reads Redis first
Open the full page for Why, Steps, Example and Key takeaway.
A string GET/SET is simple for a blob you always read whole.
Open the full page for Why, Steps, Example and Key takeaway.
Invalidation messages get lost, deploys race, and some keys are never written again.
Open the full page for Why, Steps, Example and Key takeaway.
In-memory sessions die when the instance dies and they force sticky load balancing.
Open the full page for Why, Steps, Example and Key takeaway.
When a hot key expires, thousands of requests miss together and stampede the database.
Open the full page for Why, Steps, Example and Key takeaway.