Chapter 12. Data-driven Web Applications with MySQL and MongoDB

Data is usually stored on a server in a database; in order to do that, our Dart app needs a middle layer called a database driver. We'll review which drivers are already available and then see how you can store and access your data on the server with MySQL and MongoDB. These are two of the most popular databases: MySQL is a typical relational database, and MongoDB is a NoSQL database (according to the following link, http://db-engines.com/en/ranking, MySQL is second in popularity after Oracle, and MongoDB occupies the sixth place). The following are the topics covered in this chapter:

  • Database drivers for Dart
  • Storing the todo data in MySQL
  • Dartlero tasks: a many-to-many model in MySQL and JSON
  • MongoDB: a NoSQL database
  • Using the mongo_dart driver to store the todo data in MongoDB

Database drivers for Dart

The amazing Dart community has already provided a whole spectrum of drivers ((P) means published in the pub repository, pub.dartlang.org).

For the relational databases we have:

For the NoSQL databases, the choice is even greater:

There also exists an Object Relational Mapper (ORM) framework:

  • Dorm: This framework is created by Frank Pepermans. It provides an ORM mapping on the client, and the goal is to hook it up with existing server-side ORM solutions (Hibernate, Entity Framework, and so on) (https://github.com/frankpepermans/dorm).
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.141.27