項目使用了MariaDB,是不是必須開源?

MariaDB使用的是GPL協議,而GPL協議規定只要使用了它的項目都必須開源,不管是否在銷售。
是不是可以這樣理解:MySQL同時使用了GPL和商業授權,你不想開源就可以付費購買商業授權;而使用了MariaDB,就只能開源了?


GPL 什麼時候說過只要使用就必須開源了?題主,你還是認真閱讀一下 GPL 協議正文吧。公司不可能請不起一個能讀懂 GPL 原文的人,哪怕是一個英語過硬的碼農也成啊。

一般情況下,使用資料庫並不需要將資料庫的代碼嵌入到主程序。資料庫通常是獨立的進程,可以獨立的運行,只是通過通用的介面與各種應用進行通訊。所以資料庫的開源與你的主程序並無關係。


Connectors are released under LGPL.

備註:目前公認的 GPL 傳染隔離有兩種:

  • Address space isolation:提到這個大家可能都會想到 process isolation,以及 kernel/userspace isolation。其實 address space 並不限制於此。比如 JVM 本身的 address space 和其上 Java byte code 的 address space 在邏輯上也是兩個。所以運行在 GPL VM 上的 byte code 不用開源。
  • System exception:為 GPL 軟體運行提供系統支持的底層系統不用開源。比如 GCC 運行在 商業 Unix 上肯定要連結這個 Unix 的 C runtime。但是這裡的 C runtime 不必開源。

首先, @馮東是正確的,mariaDB的客戶端程序是LGPL的,所以不存在一定要開源的問題。

然後, @pansz 也是對的,通過網路埠於GPL程序通信,並不被認為是GPL的衍生程序,因此使用GPL的資料庫服務,也不存在一定要開源的問題。

接下來,我想解釋一個普遍的誤解,就是用了GPL,就一定要開源。事實上,且不談技術上有繞過這個限制的手段,但至少就WEB應用程序而言,大多數情況下GPL本身都是安全的協議。

GPL協議的要求是,如果你將基於GPL的衍生程序二進位文件交付給用戶,那麼用戶有權取得所有的衍生代碼。

好了,對於web程序,我們通常不會將我們的二進位程序「交付」給用戶,我們交付給我們自己,發布在自己的伺服器上,然後打開80埠,坐等客戶上門。這裡就已經很明確了,即使我們的web程序是完全在GPL基礎上構建的,也沒有義務交付源代碼給用戶。這裡的用戶,是指二進位文件的使用者,而不是該文件的服務使用者,一定要區分這個。注意,程序生成的HTML是我們跟客戶進行網路通信的協議的一部分,因此,即使事實上HTML就是我們的程序的一部分,也不能將我們發送給客戶端的HTML代碼視作程序源代碼的分發或者進一步的程序編譯後的「二進位」文件的分發。

因此,對於web開發者來說,GPL本身是一個完全安全的協議。

再強調一點就是,有權取得代碼的只能是二進位文件交付的對象,而不是任意的不特定的第三者,因此,如果我們為客戶開發了一個web系統,這裡就需要注意一點,如果你的程序引用了GPL的library,你就不能向你的客戶保留任何自有知識產權的代碼,你的所有代碼都會因此受到GPL的感染而自動授權給客戶。但是,記住一點,即使如此,除了你的客戶之外的第三者,是無權要求衍生代碼的,因為他們不是你的二進位文件的交付對象。當然,在很多企業系統開發中,合同都要求代碼知識產權屬於客戶,所以,其實這裡一般來說也不會有問題。

(後文我略有有點沒有把握,還需要再細讀協議,沒時間去看,有興趣的讀者可以去研究一下)

最後,這兩天在炒小米的GPL的問題,其實,小米完全可以將源代碼打包放在手機固件中,然後用圖片的方式來展現,只要手機用戶能夠看到代碼,其實就是不算違背GPL協議了,並不是一定要向全世界公開一個download鏈接這樣子。


說白了就是說你想投機取巧,利用現成的MariaDB為基礎,自己又做一個資料庫拿出去賣錢,這是不行的。

但是你有一個客戶,你單獨為客戶開發了一套進銷存系統,資料庫方面你給他裝了MariaDB。你開發的進銷存系統不用開源,可以照樣賣客戶。


自己寫產品還是用postgresql最好


Linking [name of your program] statically or dynamically with
other modules is making a combined work based on [name of your
program]. Thus, the terms and conditions of the GNU General Public
License cover the whole combination.

If a library is released under the GPL
(not the LGPL), does that mean that any software which uses it
has to be under the GPL or a GPL-compatible license?
(#IfLibraryIsGPL)


Yes, because the software as it is actually run includes the
library.

You have a GPL"ed program that I"d like
to link with my code to build a proprietary program. Does the fact
that I link with your program mean I have to GPL my program?
(#LinkingWithGPL)


Not exactly. It means you must release your program under a license
compatible with the GPL (more precisely, compatible with one or more GPL
versions accepted by all the rest of the code in the combination that you
link). The combination itself is then available under those GPL
versions.

What does it mean to say a license is
「compatible with the GPL?」
(#WhatDoesCompatMean)


It means that the other license and the GNU GPL are compatible; you can
combine code released under the other license with code released under the
GNU GPL in one larger program.

All GNU GPL versions permit such combinations privately; they also
permit distribution of such combinations provided the combination is
released under the same GNU GPL version. The other license is
compatible with the GPL if it permits this too.

GPLv3 is compatible with more licenses than GPLv2: it allows you to make
combinations with code that has specific kinds of additional requirements
that are not in GPLv3 itself. Section 7 has more information about this,
including the list of additional requirements that are permitted.

翻了一早上,GPL官方權威說明。
按這個意思,你用我的資料庫,總要在代碼里使用我的驅動吧?只要用了,你就必須用GPL發布。
誰來解釋一下?


我對這個問題也一直很困惑。
按照我的理解,只要鏈接了任何GPL軟體的相關lib,就需要開源自己的代碼,這樣一來,但凡是使用了Mysql(MariaDB)驅動程序的應用,都需要開源。

但是又有一個問題,比如說Java(其它語言應該也有類似的機制),Java提供了JDBC API,應用調用的是JDBC API,而不是直接驅動程序的API,那是不是意味著就不用開源了?


推薦閱讀:

GPL 協議的適用對象還包括哪些?

TAG:開源 | 開源許可證 | GPL | MariaDB |