4

I'm new to database design. As I have learned, we use Entity-Relationship Diagram to help design a relational database.

If formal design approach to relational database is ERD, what is the approach for NOSQL database?

1
  • Entity Relationship Diagrams are ONE tool that can be used for designing relational databases. They are not the ONLY method or even necessarily the best. Relational databases were invented long before ER modelling and ER diagrams.
    – nvogel
    Jan 10, 2011 at 17:28

3 Answers 3

5

I think you might well use a Entity-Relationship diagram. Just because your DB doesn't handle relationships between your data entities in the way that an RDBMS does doesn't mean your data doesn't have relationships, it's just that those relations are implemented in the application rather than the (non-R)DBMS. I think understanding the information you're going to store in each entry in your DB is still worthwhile.

If you want something more tailored, then the problem is that "NoSQL" is an umbrella term for a lot of different DB architectures. You probably need to determine what kind of NoSQL database you expect to be using before determining the best design approach. I think in pretty much any of them you're going to want to understand what attributes your entities have, however, even if the DB youy are using allows more flexibility than the classic SQL DB (e.g. variable sets of key/value pairs)

5
  • Actually, there are plenty of relational NoSQL databases. Graph databases, for example, can pretty much only store relations. Jan 10, 2011 at 17:31
  • 1
    Jörg, A graph database is not a relational database. They are very different things. Graph databases in general don't support relations whereas relational databases don't allow navigation or "links" between data items. In fact the graph model is less general than the relational model.
    – nvogel
    Jan 10, 2011 at 17:36
  • @dportas: If an edge isn't a relation between vertices, then what is it? Jan 10, 2011 at 17:45
  • 4
    @Jörg, An edge might represent a relationship but it certainly isn't a relation. Relations are what make a relational database, not relationships. mathworld.wolfram.com/Relation.html A graph can be represented by a relation of degree 2 or greater but that isn't the representation actually used by graph databases and therefore they are not relational.
    – nvogel
    Jan 10, 2011 at 17:56
  • @dportas: I see this everyday on SO i.e. saying "relation" when they mean "relationship" :(
    – onedaywhen
    Jan 13, 2011 at 16:13
1

For graph databases, entity-relationship models (or their object-oriented cousin, class-association models) are a very good match: the match is so good that I think of a graph database as executing such a model natively.

All other kinds of databases (relational included), require the developer to "do extra stuff" for mapping the model to the database. E.g. for SQL databases, the extra stuff is relatively small (e.g. mapping N-N relationships to extra tables, workarounds for inheritance). On the opposite, the extra stuff for hash tables is fairly large (serializing of properties, manual management of relationships etc.)

Of course, different graph databases also differ how seamless the connection is. I'm involved in a graph database called InfoGrid where the step from high-level model to code is automatic through a code generator.

0

For key-value stores use hashmaps, for graph dbs use graphs... Those models should be pretty straightforward, but it is questionable if they are as useful as er model.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.