15
gitpush
7y

Store POJOs as json inside a database column so that we have a dynamic relational database!

For those who don't know what a POJO
*POJO: plain old Java object
Technically I was asked to store all data models as json in a single column 🙄

Comments
  • 1
    PostgreSQL lets you store JSON as a column type... Just saying, not implying you should.
  • 1
    @apex it is still better than storing JSON as nvarchar(MAX) which was my case :/
  • 1
    @gitpush Oh yeah, of course it's better!

    Are you updating a legacy system? Or why do they asked you that?
  • 1
    @apex it was a new system I was asked to build, so when I was explaining why I need x amount of time, GM just said: use json and you'll cut half the time
  • 1
    @gitpush Pretty solid arguments I'd say, perfect 5 out of 7.
  • 1
    @apex then say hello to hell of data querying. every time I wanted to dig up something in that JSON data, I end up using "LIKE" and waiting for a long time for it to finish rather than just hitting an '=' and do proper indexing
  • 1
    @gitpush Oh God, that's awful, but well, you can justify the querying timings with a paper where you explain that it's an implementation issue and put who said you should do it that way.

    You know, just in case they try to throw shit at you.
  • 1
    @apex I did justify it, but it was part of my resignation email lol
  • 1
    @gitpush Better leave before the shitstorm xD
  • 1
    @apex exactly :D
Add Comment