I'm working on a web application with constantly changing requirements. The relationships between entities in the database have mostly remained the same but the attributes of each entity type changes a lot.
I'm using Java, JPA, and Postgres. Postgres has a JSON type. Is it a good design to remove all non-key and foreign-key attributes and just put them in a JSON attribute?
FooTable Columns Old Design
Bar bar /**Foreign key ref*/
FooTable Columns New Design
Bar bar /** Foreign key ref */
The advantages I see of the new design are
- Less overhead converting between POJOs and JSON
- Don't really have to change schema?
- Faster to test new things?
A disadvantage I see is migrating out of date JSON. Are there any potential pitfalls I'm missing of this approach?