How to convert a SQL query into hibernate criteria?

NoSQL: What are the best practices to convert sql based relational data model into no sql model?

  • Kindly let me know what are the best practices to convert an existing SQL based relational data base model into no sql model. The use case is that I have an existing sets of several sql based relational tables connected via several primary and foreign keys which won't be able to scale as per our new requirements. Hence i want to shift my entire data model to no sql and use hosted no sql services. The additional quesion is whether its always possible to convert your existing sql model into no sql or there are some constraints regarding this migration?

  • Answer:

    There aren't any.  NoSQL databases and Relational databases solve very different problems.  It doesn't make sense to take structured relational data and convert it to unstructured non-relational data. Think about how you will have to spend time writing new code.  NoSQL databases are accessed through programming APIs and don't have anywhere near the functionality of SQL databases.  IE, you can't do a SUM in most NoSQL databases. If your problem is performance, you need to scale out your existing SQL solution or use a provider that can scale for you. Open source DB's like MySQL and PostgreSQL can scale to multiple nodes.  Oracle & SQL Server also scale to multiple nodes. Trying to convert from RDBMS to NoSQL will likely cost you a lot in development time and probably not do a very good job of replacing the functionality of your RDBMS.

Chris Schrader at Quora Visit the source

Was this solution helpful to you?

Other answers

I have helped migrate a number of systems from SQL to NoSQL. If your system already has a JSON API, then you may have an easier time of it. In these cases what I've done is essentially store the public JSON API format data in the NoSQL database. This gives a locality of reference optimal for your access patterns. If the type of denormalization that would be entailed by this approach is too radical for you, it can still be a useful exercise to fill up a NoSQL container with that denormalized format. This will give you a relatively cheap opportunity to become familiar with the types of queries and operations your chosen platform supports. You can then dial back from there to find a mix of data normalization and optimized reads and writes. The ultimate solution may not look exactly like your public JSON API, but having experience with that approach will give you a sense of where to start. I wrote a longer blog post on the topic of document modeling for performance here. http://jchrisa.net/drl/_design/sofa/_list/post/post-page?startkey=%5B%22Performance-Oriented-Architecture%22%5D

J Chris Anderson

In addition to what Chris said, you may find a presentation I did for several NoSQL Roadshows last year to help understand where you might use NoSQL: https://confadmin.trifork.com/dl/basho-roadshow-london-2012/Akmal-NoSQ-Roadshow-2012.pdf At the back are about 30 slides of references and some of them point to web sites that provide good advice about choosing a NoSQL product for your use case.

Akmal Chaudhri

In most of the cases RDBMS is capable enough to support your application, but as you have mention you are not able to scale as per new requirements. I have written a blog http://blog.cloudthat.in/migration-from-relational-database-to-nosql-database/ that discuss challenges and tips for moving your backed to NoSQL

Harshal Bulsara

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.