Hacker News new | ask | show | jobs
by nartz 1834 days ago
Very interesting. I like the idea of "virtualizing" the hard schema with views to abstract away some things.

View performance can be a thing at larger scale for OLTP workloads, also, the solution you propose also adds complexity since you have two schemas now instead of one, and as you rightly point out, complexity with views themselves. The question becomes when is this added complexity worth it?

2 comments

I think you hit the nail on the head regarding complexity. I'm experimenting with creating a migration tool which handles all the views for you. I believe some of the process can be automated and the complexity reduced but remains to be seen how well it works!
Views are equivalent to "query templates" unless for example they do operations on subquery aggregate columns (for example group by sum().)

So views don't add complexity relative to giving the query explicitly. It might even help since the incoming queries can be smaller, thus less parsing/processing.