What is the best data model and database systems to store social graph?

What would be the main advantages of a (purely?) functional database?

  • This question is related to a) the concept of functional data structures, as well as other such data structures that can be used to store data; and b) a database implemented in a functional language such as Lisp (bytecode) or Clojure (on the JVM). Assuming performance was an issue that could be solved, what would be the inherent benefits of having a relational database written in a functional language using functional data structures? I imagine one of the problems that RethinkDB is trying to solve is hot backups, and such a system would address that. But what else? Apart from AllegroDB, which is a large scale lisp based Graph database, I haven't come across a system that follows the two concepts mentioned above.

  • Answer:

    Concurrency.  A functional database, like most currently popular functional languages, would be highly concurrent.  The elimination of shared state means you can get rid of locks and (probably) have composable transactions that would make writing concurrent applications that access the database a lot easier to write, a lot easier to prove correct, and a lot faster. Replication/backup.  If a database can be represented as a persistent functional object (and is immutable), all you need to do is copy it somewhere and you've backed it up.  There's no chance you'll have corrupted data, apart from possibly some data that hasn't been completely written, but you can of course just ignore this data in the copied file and have no problems.  This means backup is literally one rsync command. Sharding.  This is a little more complicated, but in a well-designed data structure, having it be immutable and have no shared state goes a long way towards the sharding goal.  Of course, a lot of this task falls under the domains of concurrency and replication, so there you go.

Leif Walsh at Quora Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.