JSON (client-side) <-> Java (server-side) <-> JSON (NoSQL DB) -
i looking @ using document-oriented nosql database application.
the primary motivations me think of move :
- my server-side emits json clients.
- my server-side java based.
- going relational database means need convert relational data in db -> object data in java code -> json document client consumption (and vice-versa).
- the orm overheads involved in step 3, seem significant enough avoided.
- my database schema undergo changes , want accommodate them easily.
- caching (say using redis or nosql db itself) maps underlying nosql database.
- scaling , distribution feel natural nosql database.
so, given background in decision making, end following data conversions:
json (to/from client side) <-> java (on server-side) <-> json documents in nosql database.
my question is, possible minimize these conversions (for java server-side) ? (may if using node.js on server-side work json thru, cant change java on server-side).
is doing usual way go or there optimizations possible (with respect data conversions) ?
though there may libraries/packages conversion of java object json document in nosql db (like morphia, ektorp, mongolink etc), question if there possibility of avoiding such conversions in first place.
one possible optimization comes mind:
for 'reads' of db performed return json clients, there no need convert json document specialized java object , json send client. may dbobject (which generic java object holding json document retrieved nosql db) sufficient @ java server-side, such read operations.
the other reads need manipulate data retrieved db, , hence need cast domain specific object types. conversion kind of inevitable according me.
Comments
Post a Comment