Hey Matthew, 2011/7/18 Matthew Sherborne <[email protected]>: > I concur, Wt::Dbo is awesome :D > Parvinder, just spend an afternoon going through the tutorial and make the > tutorial app: http://www.webtoolkit.eu/wt/doc/tutorial/dbo/tutorial.html > Then copy and paste bits of that into your app. > > After months of mucking around with the evil mongodb client, I switched to > postgresql and Wt::Dbo yesterday.
Just curious, the evil mongodb client is evil because of tedious API or bugs ? (because I still really would like to integrate mongodb as backend to Wt::Dbo some day !) > Ported over an app and added some features at the same time, all in one > afternoon. > The Wt::Dbo version uses less code, is nicer to program with, more logical, > I dare to say likely less error prone. > The one complaint I have is that my model classes seem to require to have a > default consctructor. I'm probably being a too fussy, but I was initially > worried that it might be trying to create instances of my models left right > and center. Ah yes I believe this is not documented why this is: - A instance of each mapped class is used at the very beginning to "introspect" the mapping. - When loading an object from the database, it starts with a default constructed object, after which it reads the relevant data fields. So, I guess in the first case we do (temporarily) create some instances. Other than that, I believe Wt::Dbo behaves as one would expect. > There's no noticeable performance hit .. still takes a fraction of a second > to import 1000 records; well it's slightly noticeable, I'm not sure if it's > my imagination though .. hard to discern. That's interesting. I would have thought that mongoDB would be noticably faster than Postgres... > I like how the Wt::Dbo model only requires me to map the fields once .. less > scary. > Old mongo model: http://ideone.com/SReFx > New Wt::Dbo model: http://ideone.com/sDrcy It's great to see how you could actually switch to Wt::Dbo without a major redesign. That in itself indicates that a MongoDB backend to Wt::Dbo isn't as far fetched as I would have initially thought. As to your other question about a MongoDB mapping. In my opinion a Document-database, like MongoDB, shines for particular storage problems. One I have in mind is e.g. a hospital record system (which we've designed previously using SQL). Ideally, you would create a single Document per patient. This document would contain all the information for this single patient. Of course, other hospital information (such as room features, appointment schedules, employee information, would also need to be mapped to other documents). But the big benefit of NoSQL would be related to the patient document because you can easily annotate new types of information to a patient without needing a database migration or SQL abuse (with Attribute/AttributeValue tables). Conceptually there is probably also no more efficient method to access all the information of a single patient. Regards, koen ------------------------------------------------------------------------------ AppSumo Presents a FREE Video for the SourceForge Community by Eric Ries, the creator of the Lean Startup Methodology on "Lean Startup Secrets Revealed." This video shows you how to validate your ideas, optimize your ideas and identify your business strategy. http://p.sf.net/sfu/appsumosfdev2dev _______________________________________________ witty-interest mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/witty-interest
