4 ms·
> Is a shared database in microservices actually an anti-pattern? No, unless you dont want (or care about having) a single source of truth. If state is distrib
by barrystaes 8y ago
> Is a shared database in microservices actually an anti-pattern?
No, unless you dont want (or care about having) a single source of truth. If state is distributed its harder to backup/restore/rewind or even query atomically and reproducibly.
You could still make the single database sharded and duplicated though, but still: in most cases its still one shared database. Even storing Files outside of a DB is just sharding, important thing is the DB refers to the file and still is the single source of truth.
And when you want vertical segmentation see designs like multi-tenant, but its still not a database per microsevice: quite the opposite.
When you dont want a single source of truth you could do without it ofcourse.