News for hackers. Stuff that matters.
Re:Startup Engineers and Our Mistakes with MongoDB by cmenge on Wednesday July 19, 2017 @01:51PM (#14806307)
Well

1.) It's always a text-based interface. The ORM merely hides the fact. Type safety is weak, as is with JSON, but both aren't un-typed.

2) Yes, they are, and there are a lot of good use cases for relational databases. But if you have a number of services that share nothing (especially not the database), what is the foreign key good for?

3) You can do any style with any database. Overly aggressive normalization in read-heavy environments can be bad, as is de-normalization in write-heavy environments. Choose the tool for the job..

4) Why all over the code? Can't you make it easy to find the model classes? Doesn't seem so hard. Also, is this so different from, say, EF code first? And anyway, doesn't every SQL database in fact, have multiple schemas (the one in the db, the one in the scripts, the one in the ORM and the one in the code?) Is that really so different?

Re:Startup Engineers and Our Mistakes with MongoDB by scarface74 on Wednesday July 19, 2017 @02:14PM (#14806522)
* Type safety is weak, as is with JSON, but both aren't un-typed."

How is type safety "weak" with an ORM? You are using strongly typed objects.

Re:Startup Engineers and Our Mistakes with MongoDB by cmenge on Wednesday July 19, 2017 @04:06PM (#14807453)
Yes, but they don't match the data types your SQL database supports, do they? You're talking to a remote service here., i.e. varchar, decimal, datetime, etc. in SQL aren't the same as in whatever language you're using.

That's true for JSON as well, but you probably need JSON on the other side (the API) as well...

Re:Startup Engineers and Our Mistakes with MongoDB by scarface74 on Wednesday July 19, 2017 @05:17PM (#14808022)
Yes. When you use Entity Franework's generator to map from a database table to a class, it not only maps the types from the database to your class, it also maps constraints like charactr length, nullable fields vs. non nullable fields, etc.

The same for Mongo if you are using the C# driver. If you get a Mongo collection using the standard C# syntax --

var collection = database.GetCollection<Users>("Users");

You will work with a strongly typed "schema". As long as you are working with the "collection" object, you will be working with strongly typed objects and doing type safe Linq queries.