Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL vs. NO-SQL for web development with Clojure

I recently started to learn Clojure and my intention is to build a simple CMS using it for practice. Since Clojure is a purely functional language and it requires a new way of thinking it just came up for me that what if I use a NO-SQL database for my application like MongoDB?

Do you have any comparison in this topic? I searched on google but I failed to dig up any usable data regarding this matter. What are the pros and the cons?

edit: I mentioned clojure and web development to put things in context. For example with clojure it is easier to write a domain-specific language than for example using java.

like image 981
Adam Arold Avatar asked Sep 04 '26 06:09

Adam Arold


1 Answers

Whatever the language, you will gain a lot from using a no-sql database if you observe some OOP principles that Domain Driven Design brings to the table. The idea of an Aggregate and the Aggregate Root allow you to form organization in a more document-centric way. Since no-sql data manipulation is tailored to key-value pairs, aggregates and aggregate roots are something to investigate.

Also if you feel like learning more on how to organize your architecture to involve both sql and no-sql, take a look at the CQRS "pattern". You can tailor the write side to use no-sql but keep traditional SQL or RDBMS on the read side.

CQRS: http://martinfowler.com/bliki/CQRS.html

DDD: http://domaindrivendesign.org/

Let me know if you have any questions.

like image 158
Adam Dymitruk Avatar answered Sep 06 '26 17:09

Adam Dymitruk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!