Architecture Overview

This section explains how all the different parts of the driver fit together. From the different language runtimes, through the extension and to the PHP libraries on top. This new architecture has replaced the old mongo extension. We refer to the new one as the mongodb extension.

Architecture Diagram

At the top of this stack sits a pure » PHP library, which we will distribute as a Composer package. This library will provide an API similar to what users have come to expect from the old mongo driver (e.g. CRUD methods, database and collection objects, command helpers) and we expect it to be a common dependency for most applications built with MongoDB. This library will also implement common » specifications, in the interest of improving API consistency across all of the » drivers maintained by MongoDB (and hopefully some community drivers, too).

Sitting below that library we have the lower level driver. This extension will effectively form the glue between PHP and our system libraries (» libmongoc and » libbson). This extension will expose an identical public API for the most essential and performance-sensitive functionality:

  • Connection management
  • BSON encoding and decoding
  • Object document serialization (to support ODM libraries)
  • Executing commands and write operations
  • Handling queries and cursors

By decoupling the driver internals and a high-level API into an extension and PHP libraries, respectively, we hope to reduce our maintainence burden and allow for faster iteration on new features. As a welcome side effect, this also makes it easier for anyone to contribute to the driver. Additionally, an identical public API will make it that much easier to port an application across PHP runtimes, whether the application uses the low-level driver directly or a higher-level PHP library.

» GridFS is a great example of why we chose this direction. Although we implemented GridFS in C for our old mongo driver, it is actually quite a high-level specification. Its API is just an abstraction for accessing two collections: files (i.e. metadata) and chunks (i.e. blocks of data). Likewise, all of the syntactic sugar found in the old mongo driver, such as processing uploaded files or exposing GridFS files as PHP streams, can be implemented in pure PHP. Provided we have performant methods for reading from and writing to GridFS' collections – and thanks to our low level extensions, we will – shifting this API to PHP is win-win.

Earlier I mentioned that we expect the PHP library to be a common dependency for most applications, but not all. Some users may prefer to stick to the no-frills API offered by the extensions, or create their own high-level abstraction (akin to » Doctrine MongoDB for the old mongo driver). Future libraries could include a PHP library geared for MongoDB administration, which provides an API for various user management and ops commands. The next major version of » Doctrine MongoDB ODM will likely also sit directly atop the extensions.

While we will continue to maintain and support the old mongo driver and its users for the foreseeable future, we invite everyone to use the next-generation driver and consider it for any new projects going forward. You can find all of the essential components across GitHub and JIRA:

Driver Source Code and JIRA Locations
Project GitHub JIRA
PHP Library » mongodb/mongo-php-library » PHPLIB
PHP 5 and PHP 7 Driver (phongo) » mongodb/mongo-php-driver » PHPC

The existing » PHP project in JIRA will remain open for reporting bugs against the old mongo driver, but we would ask that you use the new projects above for anything pertaining to our next-generation drivers.

Hier Kannst Du einen Kommentar verfassen


Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

Midjourney Tutorial - Anleitung für Anfänger

Über Midjourney, dem Tool zur Erstellung digitaler Bilder mithilfe von künstlicher Intelligenz, gibt es ein informatives Video mit dem Titel "Midjourney Tutorial auf Deutsch - Anleitung für Anfänger" ...

Mike94

Autor : Mike94
Kategorie: KI Tutorials

Grundlagen von Views in MySQL

Views in einer MySQL-Datenbank bieten die Möglichkeit, eine virtuelle Tabelle basierend auf dem Ergebnis einer SQL-Abfrage zu erstellen. ...

admin

Autor : admin
Kategorie: mySQL-Tutorials

Definition von Stored Procedures - eine Einführung

Stored Procedures sind vordefinierte SQL-Codeblöcke, die in einer Datenbank gespeichert sind und bei Bedarf aufgerufen werden können. ...

Bernie

Autor : ebiz-consult GmbH & Co. KG
Kategorie: mySQL-Tutorials

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

Spielplan für 4 Gruppen zu je 6 Teams auf 2 Feldern

Hey, hallöchen! Du musst die Spiele so durchgehen, dass die Platzierung kontrolliert wechseln, dass jedes Team auf den Plätzen spielt. Hier ist ...

Geschrieben von Nico_Schubert am 14.05.2024 07:17:28
Forum: PHP Developer Forum
Bild drehen

Hallo, Du hast den Drehwinkel und den Pfad zum Bild bereits richtig im Post-Array. Hier ist ein vollständiges Beispiel, wie du das Bild drehst u ...

Geschrieben von Nico_Schubert am 14.05.2024 06:55:15
Forum: PHP Developer Forum
Berechnungen durchführen

Hallo Matze, gerne helfe ich dir bei deinem Projekt. Lass uns deine Fragen Schritt für Schritt angehen: Erste Frage: Ist das Konstrukt so richt ...

Geschrieben von Nico_Schubert am 14.05.2024 06:43:13
Forum: PHP Developer Forum
Bild drehen

Ich denke, dass die Aussage von scatello richtig ist und stimme ihm zu.

Geschrieben von LucyCoffee am 10.05.2024 12:04:18
Forum: PHP Developer Forum