Live data from Hacker News

FerretDB: open-source MongoDB alternative

blog.ferretdb.io

121–130 of 130 posts

Re: FerretDB: open-source MongoDB alternative

#121
post #99

Earlier quoted context omitted.

> AGPL, to my understanding, makes it a requirement if you allow people to use the software via network levels. AGPL requirements do not trigger if you don't modify the source code. The relevant text is in section 13: > […] if you modify the Program, your modified version must prominently offer all users […] See also [1], [2], [3]. > “Program as a Service” seems a lot more limited in scope. AGPL scope: > The "Corresp…

> As noted in another thread, that's not only beyond the scope of the software itself – it is beyond the scope you _can_ relicense and arguably beyond the scope of the copyright terms themselves. This is not true. People who are saying this would have said this about GPL when it first came out.

GPL applies to a single program: https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg00...

Re: FerretDB: open-source MongoDB alternative

#122
post #66

Earlier quoted context omitted.

I'm curious about what makes document databases a good fit for e-commerce. I've never worked in that industry.

Two things off the top of my head: 1. Denormalized data is often a boon. One of your key use cases is "give me all the information about this Product so I can show it to the user." Forget joining a ton of tables, just do 1 read of 1 product and go on your way. 2. A certain amount of more freeform data is expected. Different product categories will have different sets of information. T-shirts and drinkware both have s…

That makes a lot of sense, thanks!

Re: FerretDB: open-source MongoDB alternative

#123
post #7

At one company we had one-off requests to run get some statistics from our mongodb. Writing the proper queries proven pretty tricky whenever GROUP BY/JOINs were involved, so I used online converters between SQL -> mongo query. But then I realized that PostgreSQL has nice JSONB type (supports indices for subfields). So I put all the mongo data into tables with a single JSONB column (or two columns id+data, if you pref…

Since FerretDB is built on top of Postgres, could it be an extension? So that one can mix some FerretDB tables and some general SQL tables in the same database (with proper foreign key constraints between them etc)

Re: FerretDB: open-source MongoDB alternative

#124
post #7

At one company we had one-off requests to run get some statistics from our mongodb. Writing the proper queries proven pretty tricky whenever GROUP BY/JOINs were involved, so I used online converters between SQL -> mongo query. But then I realized that PostgreSQL has nice JSONB type (supports indices for subfields). So I put all the mongo data into tables with a single JSONB column (or two columns id+data, if you pref…

Since FerretDB is built on top of Postgres, could it be an extension? So that one can mix some FerretDB tables and some general SQL tables in the same database (with proper foreign key constraints between them etc)

Yes, building an extension is something we are looking at, and I am glad to hear that you would be interested in this kind of mixed use case. Would definitely make things interesting, and more performant.

Re: FerretDB: open-source MongoDB alternative

#125

Earlier quoted context omitted.

If there were JOINs it may be a sign MongoDB was not the best DB for you. It means the model was relational and a relational DB would be a better fit. MongoDB lookups are discouraged in general, and especially in analytical workloads, which cover a lot of data. MongoDB is better for the scenario, where all you need is already in the document.

Should it be used as a database in the way that Postgres would be used as a database? It seems pretty unfit for that role, with its past durability issues and that writes have to be tailored to how the data will be consumed, due to lack of ad-hoc queries. As something layered on top of the actual source of truth it may be reasonable, writing a materialized version of a costly query that's read very often, sure, but t…

MongoDB has pipeline queries https://www.mongodb.com/docs/manual/core/aggregation-pipelin... that allow for quite ad-hoc queries.

Re: FerretDB: open-source MongoDB alternative

#126

Earlier quoted context omitted.

Since FerretDB is built on top of Postgres, could it be an extension? So that one can mix some FerretDB tables and some general SQL tables in the same database (with proper foreign key constraints between them etc)

Yes, building an extension is something we are looking at, and I am glad to hear that you would be interested in this kind of mixed use case. Would definitely make things interesting, and more performant.

Pretty exciting!

What about optionally validating some columns with jsonschema? Perhaps using https://github.com/supabase/pg_jsonschema - is using other postgres extensions supported in FerretDB? (if not, maybe it's feasible to incorporate the code of pg_jsonschema in FerretDB?)

Re: FerretDB: open-source MongoDB alternative

#127

Earlier quoted context omitted.

Yes, building an extension is something we are looking at, and I am glad to hear that you would be interested in this kind of mixed use case. Would definitely make things interesting, and more performant.

Pretty exciting! What about optionally validating some columns with jsonschema? Perhaps using https://github.com/supabase/pg_jsonschema - is using other postgres extensions supported in FerretDB? (if not, maybe it's feasible to incorporate the code of pg_jsonschema in FerretDB?)

Yeah, that's planned: https://github.com/FerretDB/FerretDB/issues/77

Re: FerretDB: open-source MongoDB alternative

#128

Earlier quoted context omitted.

Curious why you think this? I've found Relational databases pretty powerful, and learned mongo first.

They are powerful. But often their Power is unnecessary and counter productive for domain modeling. Where are they really good is reporting. Analysts love rdbms. When I am on an analyst role, I love them them too. As an engineer I find them redundant. More about domain modeling https://dev.tasubo.com/2022/07/crash-course-domain-driven-de...

1) That article says nothing against using rdms in my quick perusal, in fact it suggests MySQL!

2) In practice having the ability to run reports on your data can be super important and useful.

I'm still confused at the point you're trying to make.

Re: FerretDB: open-source MongoDB alternative

#129
post #19

Earlier quoted context omitted.

It may also mean poor schema design. You can absolutely model relational data in MongoDB without relying on joins. If you want to normalize your data don't pick Mongo.

agreed, you can have reference fields to other collections and filter by them or query related data. But I wouldn't say its designed for relational workloads. Similarly I wouldn't use MongoDB for graph queries, even though it has an operator for just that.

> agreed, you can have reference fields to other collections and filter by them or query related data.

Yes it has that, but that's an anti-pattern. What I'm referring to is schema design. In Mongo you denormalize and store relational data in the same document as references. In SQL you a record might be split up into 3 tables, in Mongo that should all live in the same document. If you can't embed and need lookups, you should avoid Mongo and other nosql DBs

Re: FerretDB: open-source MongoDB alternative

#130
post #121

Earlier quoted context omitted.

> As noted in another thread, that's not only beyond the scope of the software itself – it is beyond the scope you _can_ relicense and arguably beyond the scope of the copyright terms themselves. This is not true. People who are saying this would have said this about GPL when it first came out.

GPL applies to a single program: https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg00...

Because the nature of software development and usage has changed massively since GPL was created. If GPL was created today it would most likely be like SSPL. The fact, GPL states "derivative work" must be released under a similar license shows to me that their intent was if you build anything where this is the core you must share that.
Post reply on HN