Daprota improves software creation efficiency and software quality by providing free cloud services and presenting ideas for automatic software creation.
Regardless of the dynamic polymorphic nature of the MongoDB data schema, it is a good software engineering practice to first design a data model for your MongoDB application before proceeding with the application code development. There are at least a few reasons to follow this design practice. They include but they are not limited to data consistency, application correctness and performance.
M2 service can also be very useful for a quick creation of disposable schemas (data models) in an agile environment where you want to quickly create data models, generate Java persistence code from it, immediately test it, and repeat this procedure starting over with the current schema update or a completely new schema creation and code generation.
Besides supporting software engineering practices and automatic code generation, Daprota M2 service is also free of charge. We have spent our time and resources investing in Daprota's future by helping you achieve your goals where success is measured not only by the time and resources you spent on your projects but also by the quality and efficiency of your solutions based on Daprota's services.
First, you will think about your data and application read/write patterns. This thinking will help you create a model in M2 that will work for you. You can consult the Daprota MongoDB Modeling Adviser to help you with your data model design and its creation via M2 service.
Second, when you create the first version of your model you will generate code from it. Currently plain Java code is supported. Besides the data persistence code, the code based on the NoSQLUnit to test the generated data persistence code is also generated.
Third, you will run tests based on generated NoSQLUnit-based code to make sure that the persistence code generated by M2 and based on your model works properly.
You will definitely have to go through few iterations before the good model version is finalized and code generated based on it. M2 will save you a lot of time since many time consuming manual steps will be automatically done by M2.