4 ms·
They're not identical concepts, but both relational schemas and statically typed programming languages provide assurances about basic structure. Mongo, and Pyth
by MaxBarraclough 7y ago
They're not identical concepts, but both relational schemas and statically typed programming languages provide assurances about basic structure. Mongo, and Python, offer no such assurances, and leave it to the developer to get it right.
Agree that SQL's syntax is rather bad.
- MaBeuLux88 7y agoMongoDB supports Schema Validation since MongoDB 3.2 (Dec. 2015) and JSON Schema since MongoDB 3.6 (Nov. 2017) so MongoDB can enforce types strictly if you want to at the collection level. NoSQL doesn't mean NoSchema or NoTypes. https://docs.mongodb.com/manual/core/schema-validation/#json-schema https://docs.mongodb.com/manual/core/schema-validation/#json...
- MaxBarraclough 7y agoSo they bolted it on eventually then. The relational databases went the other way and bolted-on schemaless data [0] [1]. We can still compare the schema-based and schemaless approaches. [0] https://www.postgresql.org/docs/10/datatype-json.html https://www.postgresql.org/docs/10/datatype-json.html [1] https://docs.microsoft.com/en-us/sql/t-sql/functions/json-query-transact-sql?view=sql-server-ver15 https://docs.microsoft.com/en-us/sql/t-sql/functions/json-qu...
- andybak 7y ago> both relational schemas and statically typed programming languages provide assurances about basic structure. Yes I get that but I was trying to make the point that there's more to the relational model than just assurances. It offers a richly entwined semantic structure and an elegant route to reducing duplication and the risk on inconsistency that comes with it. None of this is in tension with dynamic typing. (Also - dynamic languages aren't just for sloppy thinkers and cowboy coders. There's actual value that is lost in moving to static typing even if you think the trade-off is well worth it)