Relationships in JDL and NoSQL

618 views
Skip to first unread message

Matt Raible

unread,
Dec 10, 2017, 8:28:38 PM12/10/17
to JHipster dev team
Hey all,

I’m creating an example application this week that showcases JHipster’s microservices architecture. I was thinking of creating an online store as one microservice, and a blog as another. I’d like to use a NoSQL database for one of the microservices. I was thinking I could use one of the store examples from the jdl-samples repo, but it doesn’t seem to work. I tried both the “online-shop” and the “simple-online-shop” in the samples repo:


However, both fail with the same error:

± yo jhipster:import-jdl store.jh
The jdl is being parsed.
NoSQLModelingException: NoSQL entities don't have relationships.
Error jhipster:import-jdl store.jh

ERROR!
Error while parsing entities from JDL

Two questions:

1. Is it possible to generate something like an online store or a blog (with relationships b/w entities) with NoSQL?
2. If not, do you think it’s OK to do create a JHipster microservices architecture demo that doesn’t use NoSQL?

This example app will be used in a presentation I’m doing this week, for an online training course. I’d like to showcase what JHipster has to offer, but don’t want to over sell it either.

Thanks!

Matt

Julien Dubois

unread,
Dec 11, 2017, 3:26:55 AM12/11/17
to Matt Raible, JHipster dev team
Matt,

Basically, with NoSQL databases, you don't have relationships. This is why they scale, typically. This is not totally true, you can do "sort of" one-to-many relationships in MongoDB and Cassandra when you don't have too many entities (and probably Couchbase too), you can also manually code something that works like a relationship, or you can just do "full scan" of tables (sorry, "MapReduce"), but all have a lot of drawbacks, and here I'm trying keep things simple.
Without foreign keys and without transactions (again, I'm simplifying), it's very difficult to have a true entity-relationship model like we do in JPA.

We could do better, of course, but at the moment we have like nobody using Cassandra and Couchbase (even less for Couchbase), so it's not really worth the effort with them. With MongoDB, we would need to implement nested entities - I'd like to have this, but we already had tickets for that, and nobody seemed to care that much. I guess it's easy to add manually afterwards, so people don't have that much trouble with it.

Julien



--
You received this message because you are subscribed to the Google Groups "JHipster dev team" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jhipster-dev+unsubscribe@googlegroups.com.
To post to this group, send email to jhipst...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jhipster-dev/D199359C-0736-4E6D-9349-EC93B552990C%40raibledesigns.com.
For more options, visit https://groups.google.com/d/optout.



--
Julien Dubois

Twitter: @juliendubois

Reply all
Reply to author
Forward
0 new messages