Moving from Mysql to nosql later. Code requirements?
When switching between a RDMS (MySQL) to a Graph or Document database, does it require much application code changes or a complete re-write of code? I am using MySQL but plan to switch over in about 5-6 months to a NoSQL implementation for certain modules so I want to advise my development team on best practices on development to minimize time later when the switch happens and also minimize code changes. Current platform is PHP codeignitor with MySQL.Website is a user content site.
Plan is to use the graph DB for the friends component and开发者_如何学C document DB for storing mail, profile details and activity streams. Currently we have spent over 2 months on creating the schema in MYSQL which seems like a waste given the switch will happen in few months hence I want to avoid as much code changes as possible later.
For one I may need to remove all the SQL queries from the code for these modules?
You could use OQGraph, which is a plugabble graph engine for MySQL. Could save you some work.
Create a data access module in your code. Changes will be localized to that module. You re-compile ONLY the data access module.
Of course if your code was not compiled to separate dll's to begin with you will have to re-structure and re-compile most of the project.
You must realize this is an interface change, not a mere implementation change. There is no magic best practice in the world that can protect you from interface change. All that you can do is rely on a properly structured code base compiled to separate DLL's to localize code changes and re-compilation.
精彩评论