Get Advice Icon

Need advice about which tool to choose?Ask the StackShare community!

Bookshelf.js

6
21
+ 1
3
Doctrine 2

278
207
+ 1
31
Add tool

Doctrine 2 vs Bookshelf.js: What are the differences?

Developers describe Doctrine 2 as "An object-relational mapper (ORM) for PHP 5.3.2+ that provides transparent persistence for PHP objects". Doctrine 2 sits on top of a powerful database abstraction layer (DBAL). One of its key features is the option to write database queries in a proprietary object oriented SQL dialect called Doctrine Query Language (DQL), inspired by Hibernates HQL. On the other hand, Bookshelf.js is detailed as "Aims to provide a simple library for common tasks when querying databases in JavaScript". It stems from the Knex.js, which is a flexible query builder that works with PostgreSQL, MySQL and SQLite3. Bookshelf.js builds on top of this by providing functionality for creating data models, forming relations between these models, and other common tasks needed when querying a database.

Doctrine 2 and Bookshelf.js can be primarily classified as "Object Relational Mapper (ORM)" tools.

Manage your open source components, licenses, and vulnerabilities
Learn More
Pros of Bookshelf.js
Pros of Doctrine 2
  • 3
    Uses both promises and callback methods
  • 14
    Great abstraction, easy to use, good docs
  • 10
    Object-Oriented
  • 7
    Easy setup

Sign up to add or upvote prosMake informed product decisions

46
4
568

What is Bookshelf.js?

It stems from the Knex.js, which is a flexible query builder that works with PostgreSQL, MySQL and SQLite3. Bookshelf.js builds on top of this by providing functionality for creating data models, forming relations between these models, and other common tasks needed when querying a database.

What is Doctrine 2?

Doctrine 2 sits on top of a powerful database abstraction layer (DBAL). One of its key features is the option to write database queries in a proprietary object oriented SQL dialect called Doctrine Query Language (DQL), inspired by Hibernates HQL.

Need advice about which tool to choose?Ask the StackShare community!

What companies use Bookshelf.js?
What companies use Doctrine 2?
Manage your open source components, licenses, and vulnerabilities
Learn More

Sign up to get full access to all the companiesMake informed product decisions

What tools integrate with Bookshelf.js?
What tools integrate with Doctrine 2?

Sign up to get full access to all the tool integrationsMake informed product decisions

What are some alternatives to Bookshelf.js and Doctrine 2?
Objection.js
It aims to stay out of your way and make it as easy as possible to use the full power of SQL and the underlying database engine while still making the common stuff easy and enjoyable.
MySQL
The MySQL software delivers a very fast, multi-threaded, multi-user, and robust SQL (Structured Query Language) database server. MySQL Server is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software.
PostgreSQL
PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions.
MongoDB
MongoDB stores data in JSON-like documents that can vary in structure, offering a dynamic, flexible schema. MongoDB was also designed for high availability and scalability, with built-in replication and auto-sharding.
Redis
Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker. Redis provides data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes, and streams.
See all alternatives