Facebook Pixel

Should microservices share a database?

No. Each service should own its data. Sharing databases couples services and defeats the purpose. If you need data from another service, use an API or event, not a direct query.

Verify This Answer

Cross-check this information using these trusted sources:

More FAQs in Monolith vs Microservices: Interview Questions and Answers

You incrementally replace parts of a monolith with new services. Old code is strangled (removed) as new services take over. Each step is shippable and reversible. It is the safe way to split a monolith.

Use the saga pattern: each service does its part and publishes an event. If a step fails, compensating events undo prior steps. You accept eventual consistency instead of ACID transactions.

A pattern that stops a service from calling a failing downstream service. It trips after N failures, fast-fails subsequent calls, and resets when the downstream recovers. It prevents cascading failures.

Still have questions?

Browse all our FAQs or reach out to our support team

Want to upskill yourself?

Our courses are taking a Coffee break, but your curiosity shouldn't. Stay engaged with namastedev linkedin, youtube, discord and other resources while you wait.

0
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.