Database engines with Laravel

Published 2 years ago by Martha

what are the database engines I can use with laravel 5 and later? also what is the criteria I would use to choose the best engine for my project ?

Best Answer (As Selected By Martha)
gregrobson

[Advance warning - contains biased views]

I've used both MySQL and PostgreSQL, they are similar in quite a few ways:

  • Similar syntax
  • Similar feature set
  • Both will scale perfectly well for general purpose usage for a typical workload (e.g. room booking system, e-learning, bug tracking system, forum etc) [lots of emphasis there!]

@Martha - either will work fine for your purpose. I have a slight preference for PostgreSQL these days since someone showed some of its strengths to me:

PostgreSQL has more consistent date/time implementation (this is a big point for my uses).

Here's a really big point for me. In 2010 Oracle bought Sun Microsystems who run the MySQL project. At that point the lead developer forked MySQL to make MariaDB and took senior developers with him. Some say Oracle has a history of buying products and then milking them for every penny in professional support fees - but that's just what I've heard. FYI: MariaDB promises 100% compatibility with MySQL. PostgreSQL however has no owner. It's a 100% Open Source project, with no multi-national super-company overseeing it. Some of the major companies that use PostgreSQL allow their developers to spend some/all of their time on PostgreSQL development - partly so they can add features they need. New features are not as frequent (although in the last year they seem to have upped the pace), but what you get with PostgreSQL is a DBMS that is rock-solid reliable and very battle-tested. Every decision on date/time types, function names etc looks like it has been agonised over in the same way that @TaylorOtwell agonises over Laravel's code. That swings it for me!

There's more info here. https://www.wikivs.com/wiki/MySQL_vs_PostgreSQL

On the flip side, some of the software for managing MySQL is a bit nicer, I will give them that. There are also more online resources if you're new to databases in general.

tisuchi
tisuchi
2 years ago (337,635 XP)

Currently, Laravel supports four databases:

  • MySQL
  • Postgres
  • SQLite
  • SQL Server

https://laravel.com/docs/5.3/database

Choosing the best DB engine, depends on your project type...

Martha

thanks @tisuchi I know that it depends on my project type , but are there any guidelines to choose between them ?

tisuchi
tisuchi
2 years ago (337,635 XP)

well... may be this link help you to choose http://www.laravelbestpractices.com/#right-database-choice

Hamelraj

Check this => http://db-engines.com/en/ranking

my sugestion MySql it is easy to use :)

RomainLanz

It all depends on your application specification. Personally I recommend you to use PostgreSQL.

Here's a good podcast about it Full Stack Radio 40: Edd Mann - You Should Switch to Postgres

Martha

@tisuchi I am confused by last link because is it MongoDB a different DB engine from the ones that Laravel support ? I am a beginner in DB engine field . @Hamelraj I am already using MySql now and it's good but is it the best for my project ? that what I am investigating now .

Martha

thanks @RomainLanz I am listening it

tisuchi
tisuchi
2 years ago (337,635 XP)

@Martha

To be honest, from laravel list, MySql should be the best choose...

RomainLanz

but is it the best for my project ?

As we said, it all depends on your application specifications.

  • MongoDB is a document-oriented (NoSQL) database engine.
  • MySQL is a relational database engine.
  • PostegreSQL is a object-relational database engine.

Think that PostegreSQL can do what MongoDB and what MySQL do and a lot of more things.

Martha

according to what I read I think that MySQL or PostegreSQL is the best for me as , my application is more like e-learning website , so there is student , teachers , courses... etc , relations between them . if I want to use database producers instead writing "sql queries" in my laravel code , which is better ( MySQL or PostegreSQL) in that now ? Thanks a lot guys (Y)

RomainLanz

You can use the Eloquent ORM to have fluent "sql queries" with both of them.

ArchStanton
TadasPaplauskas

Honestly, you will not see or feel the difference if you are asking this question. All of DBMS mentioned here offer the same basic features (queries, relationships, indexes, transactions, ect.). The differences only become visible once you start using advanced features or your project grows in scale - you probably should not worry about any of that right now.

Your best bet is to go with the "default" database MySQL/MariaDB (those two are very similar and interchangeable, without getting into too much detail). Since you seem to be just starting out, it will be easiest to get support when you encounter problems. Sqlite is also great, but it has some quirks and is fundamentally different from other solutions, as it is not a database management system (DBMS), but a library.

My advice is to use MySQL/MariaDB for the best introduction into SQL databases. After you become more familiar with SQL concepts, you will be able to make a better, more informed decision on your next project :). But really, you cannot go wrong with any of the alternatives too.

gregrobson

[Advance warning - contains biased views]

I've used both MySQL and PostgreSQL, they are similar in quite a few ways:

  • Similar syntax
  • Similar feature set
  • Both will scale perfectly well for general purpose usage for a typical workload (e.g. room booking system, e-learning, bug tracking system, forum etc) [lots of emphasis there!]

@Martha - either will work fine for your purpose. I have a slight preference for PostgreSQL these days since someone showed some of its strengths to me:

PostgreSQL has more consistent date/time implementation (this is a big point for my uses).

Here's a really big point for me. In 2010 Oracle bought Sun Microsystems who run the MySQL project. At that point the lead developer forked MySQL to make MariaDB and took senior developers with him. Some say Oracle has a history of buying products and then milking them for every penny in professional support fees - but that's just what I've heard. FYI: MariaDB promises 100% compatibility with MySQL. PostgreSQL however has no owner. It's a 100% Open Source project, with no multi-national super-company overseeing it. Some of the major companies that use PostgreSQL allow their developers to spend some/all of their time on PostgreSQL development - partly so they can add features they need. New features are not as frequent (although in the last year they seem to have upped the pace), but what you get with PostgreSQL is a DBMS that is rock-solid reliable and very battle-tested. Every decision on date/time types, function names etc looks like it has been agonised over in the same way that @TaylorOtwell agonises over Laravel's code. That swings it for me!

There's more info here. https://www.wikivs.com/wiki/MySQL_vs_PostgreSQL

On the flip side, some of the software for managing MySQL is a bit nicer, I will give them that. There are also more online resources if you're new to databases in general.

Martha

@TadasPaplauskas your comment is really valuable @gregrobson the wikivs link is really helpful Thank you guys (Y)

Please sign in or create an account to participate in this conversation.