Laravel and Sqlite database

Asked

Viewed 226 times

2

Think of me, you have server Laravel with a Sqlite database configured, access to this database in thesis is to be faster, since it is on the server itself. Follow the example:

user -> server (the database is already on the server, so it is less a request)

user -> server -> database

Would be 3 paths with an external server, type a Mysql, Firebird, as the Sqlite is already in Laravel, is to pull the data faster, right?

What would be the problem when using Sqlite?

  • Check the number of people (estimates) that would use the system made in Laravel, the system is basically for what type of purpose. If the system is for a costly job it is not recommended to use Sqlite, basically need this question to bring us a focus, ie a study scenario, I think I have failed to report this information. Basically I would use Mysql which is a very good server and in all the hosting and web services has ... as it is with Laravel would create all Migrations which is a facilitator at the time of creating your database in the hosts.

  • 1

    It would be an application of few uses, so I thought about Sqlite, but I think I will standardize myself in a Firebird or Mysql. Because they are more suitable to use when there is a huge data band

2 answers

4


This presumption that Sqlite is on the server or that another is not and that this is faster is incorrect. Whether the database is on the server or not depends. Nor is it certain that Sqlite is, but usually it is. Others have a better chance of not being, but almost always is and if you want to be then you will be, because you think that?

Nor am I going to go into the question that this whole gain you think you’ll get isn’t always true.

Maybe you’re using wrong terms, or even don’t understand how things work, but to make the right decisions you need to understand all this, otherwise you’ll have to rely on a random person on the internet telling you what’s good for you.

The normal is Sqlite be in the same process, but it is a database and if you have to do this sketch that made the Sqlite is also usuario -> servidor -> banco de dados, though it doesn’t even make sense.

I don’t know if Sqlite is already on Laravel, but I’ll trust you. So what? What does that change except the fact that you don’t have to pick it up somewhere else to go? No, it doesn’t make it faster, it changes anything, your presumption is quite wrong.

And what this matters is that there are numerous other factors that will influence performance much more than that, including most of them having to do with your ability to use the right database and make proper code.

The fact of already having a server is much easier to use Sqlite.

I already answered about using Sqlite. Sqlite can not be used in all scenarios, but can be used in much more than people think, if they know what they are doing and are willing to solve some issues that has in it as quoted in link.

  • 1

    In addition, access to Sqlite in PHP is done from the php-sqlite3 extension. The extension already does everything, so we have the impression that we don’t need to install anything else, and Laravel makes it easier to exchange the database server for different purposes. One use case is to use in-memory sqlite for automated testing, for example. In this scenario it is faster than a traditional database because there is no persistence on the disk, but you do not want a database that is not persistent, right? :)

-1

Actually the speed is not only in the jumps between resources, but in their structuring of the models as well, in the wood as we save the indexes and etc.

Sqlite is very good for many things, but if you start having multiple relationships and more complex types of data, it doesn’t support, it only supports simple primitives.

Otherwise it is blocking by default, IE, if you are inserting something in a table it will lock in that table, you can take this, even to increase the speed, but just to take it out it loses the atomicity.

You can have a Mysql running on the same server as the Windows server for example, to decrease the latency between your application and the database, but it is often unnoticeable.

The choice of the bank goes much than you expect from the bank, speed, complex relationships, flexibility and etc.

  • 1

    I haven’t denied the answer yet, but you could explain better what it is se você começar a ter vários relacionamentos e tipos mais complexos de dados, ele não suporta, ele somente suporta primitivos simples? And se vc tá inserindo algo em uma tabela ele vai dar lock naquela tabela the general idea is even right, but without better explanation it gives to understand wrong thing, and it is not table locking no, this is wrong. você pode tirar isso, até pra aumentar a velocidade, mas só de tirar ele perde a atomicidade Are you sure?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.