How to Scale a Mobile App?

What's the best method to scale a Rails app built on Neo4j as its graph database?

  • Neo4j for can be accessed as embedded database in a Rails app or can be accessed over REST API from a separate server. Using embedded Neo4j would hamper horizontal scaling of the Rails app. Can the REST API be used effectively with all ActiveRecord features viz. validation support, dynamic finders, etc.?

  • Answer:

    We've been using the neo4j.rb embedded db in our rails applications. It's great to work with, but the concerns you raise are concerns that I have as well. The REST api can't be easily used as the embedded version. There is a gem that makes it easier: https://github.com/maxdemarzi/neographyBut it's not a drop in replacement like neo4j.rb is. Ideally what would be developed is a way to tell the neo4j.rb embedded gem to persist to an neo4j server over REST or binary on a port. On our horizon is to try out the high availability clustering mode in neo4j.rb: http://neo4j.rubyforge.org/guides/ha_cluster.html this setup relies on having to install and manage zookeeper instances, so there's a bit of overhead work in configuration and set up. The other factor is that since it's embedded, one has to start up more rails instances as well, and can't just create more db instances. Thus in my opinion setting up high availability clustering looks to be the best path to scaling horizontally while still retaining the nice features of neo4j.rb(finders/validations/generators). We currently haven't faced big enough load to warrant scaling the database horizontally. We've found that just by giving the JVM a lot of ram to have helped. Once we do feel the pain we'll be giving HA clustering a try. Neo4j.rb has been quite a pleasure to use inside rails. If you want to get started with using a graph database in rails I highly recommend giving it a try.

Michael Solovyov 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.