VB_
VB_

Reputation: 45732

Mirror table vs materialized view

From this excellent video "Microservices Evolution: How to break your monolithic database by Edson Yanaga" I know that there are different ways to split chunk of data as separate db for microservice:

Could you please explain me the difference between mirrored table and materialized view?

I'm confused due to both of them are stored on disk...

Upvotes: 0

Views: 527

Answers (1)

Mr Slim
Mr Slim

Reputation: 1458

My understanding is :-

  1. Mirrored tables Mirrored tables are generally an exact copy of the another, source table. Same structure and the same data. Some database platforms allow triggers to be created on the source table which will perform updates on the source table to the mirror table. If the database platform does not provide this functionality, or if the Use Case dictates, you may perform the update in transactional code instead of a trigger.

  2. Materialized Views A Materialized View contains the result of a query. With a regular database view, when the underlying table data changes, querying the view reflects those changes. However, with a materialized view the data is current only at the point in time of creation (or refresh) of the Materialized view. In simple terms, a materialized view is a snapshot of data at a point in time.

Upvotes: 0

Related Questions