【数据库--db4o 介绍】
一、db4o?簡介
db4o (database for objects) was an embeddable open source object database for Java and .NET developers. It was developed, commercially licensed and supported by Actian. In October 2014, Actian declined to continue to actively pursue and promote the commercial db4o product offering for new customers
?
db4o 是一個開源的純面向?qū)ο髷?shù)據(jù)庫引擎,對于 Java 與 .NET 開發(fā)者來說都是一個簡單易用的對象持久化工具。db4o 的目標是提供一個功能強大的,適合嵌入的數(shù)據(jù)庫引擎,可以工作在設(shè)備,移動產(chǎn)品,桌面以及服務(wù)器等各種平臺。本系列文章將給我們帶來一場面向?qū)ο髷?shù)據(jù)庫的風(fēng)暴。
?
二、特性
db4o 的目標是提供一個功能強大的,適合嵌入的數(shù)據(jù)庫引擎,可以工作在設(shè)備,移動產(chǎn)品,桌面以及服務(wù)器等各種平臺。主要特性如下:
開源模式。與其他 ODBMS 不同,db4o 為開源軟件,通過開源社區(qū)的力量驅(qū)動開發(fā) db4o 產(chǎn)品。
原生數(shù)據(jù)庫。db4o 是 100% 原生的面向?qū)ο髷?shù)據(jù)庫,直接使用編程語言來操作數(shù)據(jù)庫。程序員無需進行 OR 映射來存儲對象,大大節(jié)省了程序員在存儲數(shù)據(jù)的開發(fā)時間。
高性能。 db4o 比采用 Hibernate/MySQL 方案在某些測試線路上速度高出 44 倍之多!并且安裝簡單,僅僅需要 400Kb 左右的 .jar 或 .dll 庫文件。
易嵌入。使用 db4o 僅需引入 400 多 k 的 jar 文件或是 dll 文件,內(nèi)存消耗極小。
零管理。使用 db4o 無需 DBA,實現(xiàn)零管理。
支持多種平臺。db4o 支持從 Java 1.1 到 Java 5.0,此外還支持 .NET 、 CompactFramework 、 Mono 等 .NET 平臺,也可以運行在 CDC 、 PersonalProfile 、 Symbian 、 Savaje 以及 Zaurus 這種支持反射的 J2ME 方言環(huán)境中,還可以運行在 CLDC 、 MIDP 、 RIM/Blackberry 、 Palm OS 這種不支持反射的 J2ME 環(huán)境中。
Features
One-line-of-code database?
db4o contains a function to store any object:
?
objectContainer.store(new SomeClass());
SomeClass here does not require any interface implementations, annotations or attributes added. It can be any application class including third-party classes contained in referenced libraries.
?
All field objects (including collections) are saved automatically. Special cases can be handled through writing custom type handlers.[2]
?
Embeddable
db4o is designed to be embedded in clients or other software components invisible to the end user. Thus, db4o needs no separate installation mechanism, but comes as a single library file with a footprint of around 670kB in the .NET version and around 1MB in the Java version.
?
Client-server mode
Client/server version allows db4o to communicate between client and server-side applications. It uses TCP/IP for client-server communication and allows to configure port number. Communication is implemented through messaging.
?
Due to a feature referred to as "Generic Reflection", db4o can work without implementing persistent classes on the server. However, this mode has limitations.[3]
?
Dynamic schema evolution
db4o supports automatic object schema evolution for the basic class model changes (field name deletion/addition). More complex class model modifications, like field name change, field type change, hierarchy move are not automated out-of-the box, but can be automated by writing small utility update program (see documentation).
?
This feature can be viewed as an advantage over relational model, where any change in the schema results in mostly manual code review and upgrade to match the schema changes.
?
Native queries
Rather than using string-based APIs (such as SQL, OQL, JDOQL, EJB QL, and SODA), Native Queries (NQ) allow developers to simply use the programming language itself (e.g., Java, C#, or VB.NET) to access the database and thus avoid a constant, productivity-reducing context switch between programming language and data access API. Native Queries also provide type safety, as well as remove the need to sanitize against code injection (see SQL Injection).
?
LINQ
LINQ support is fully integrated in db4o for .NET version 3.5. LINQ allows the creation of object-oriented queries of any complexity with the benefit of compile-time checking, IDE Intellisense integration and automated refactoring.
?
Due to integration with some open-source libraries db4o also allows optimized LINQ queries on Compact Framework.
?
LINQ can be used both against relational and object data storage, thus providing a bridge between them. It can also be used as an abstraction layer, allowing to easily switch the underlying database technology.
總結(jié)
以上是生活随笔為你收集整理的【数据库--db4o 介绍】的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: sql函数能判断字段是否包含英文
- 下一篇: 关于用同一个Form写编辑和添加的VUE