Run SQLite As A Server with LibSQL Step By Step

preview_player
Показать описание
Terso has created an open source core engine, LibSQL, which is based on SQLite, the most used database in the world. SQLite is generally built into applications, like web browsers, where you need to access a database, typically locally. Terso has expanded its capabilities.

Now, you're not limited to accessing the database in one location, you can do it from multiple places. This can even involve accessing an embedded database from afar. This was made possible by adding a server layer and a replication layer.

SQLite wins over alternatives like Postgres and MySQL due to its ease of use, powerful speed, and cost-effectiveness. Now, you can do most of what you need with the addition of SQLite, but at a lower cost and higher scale. If you haven't already, I recommend checking out LibSQL by Terso.

SQLite finds its base in many applications, including the web browser I'm using right now. Terso has developed a fork, LibSQL, from the original SQLite code and made it open source. They even added a server mode to it.

These databases can prove very useful in a variety of use cases. Sometimes, you might want to operate your database like a server, and they've made it simple to do that. What's cooler is that you can create local clones with read access to in-memory data which leads to a powerful, efficient serverless operation.

This is possibly the most efficient method and it can't be outperformed. Thousands of extensions are supported. You can also link it with limitless replication, which is very powerful.

You simply point it towards an S3 bucket and get unlimited data copies, back-ups, and syncs. Now, let's test it and see it run locally. Let's operate our own SQLite server using Terso's fork, named LibSQL. The easiest way is to copy the Docker image by clicking once.

After copying and pasting the command and witnessing some output, we have SQLD up and running. All we have to do now is test it with a SQL statement against it. Once we have ensured everything is running correctly, we can access our SQLite database from anywhere remotely, as long as we can connect to our server via an IP address.

This addition by Terso has been transformative. We have a running container and can access it easily. Now, any code can be executed with a request library like HTTP in your desired language.

You'll want to be careful when using this system as it's not intended as a full hosted system right out of the box. It doesn't afford the same permissions that MySQL or Postgres do. the trade-off is its outstanding performance. You can also run it in read replica mode, which lets the database be distributed globally and offers a faster user experience.

Finally, we will examine the addition of replication capabilities. This is a real game changer.
Рекомендации по теме
Комментарии
Автор

Thanks Stephen. Now I can use this for my side project. Learned a lot and my previous confusion of libsql and sqld is gone .

weiSane
Автор

Bro, not exactly new news, but good lord, I love libsql! Wait, now I realize this is 3 months old, hell yeah Turso

JeremyAndersonBoise
Автор

Thank you a lot for covering libsql. Can you do a whole project with libsql, setting up sqld daemon server, setting up multiple minio storage buckets, then connect to it and enabling embedded replication in libsql, for a simple edge hosted project? I think that the libsql docs are not really good in explaining how it really works, so it needs guys like you that put it all together for beginners like us. Thank you a lot for your content! Subbed!

HideBuz
Автор

Thanks so much for this! I would love to see more libSQL content. All kinds of CRUD applications I could produce from a decent framework using it.

HomeEngineer-wmfg
Автор

Dude this is so high quality. I hope the channel keeps growing.

iatheman
Автор

@8:11 This Sir is my DREAM skill to learn! It is a core feature in a hypothetical app I want to produce.

HomeEngineer-wmfg
Автор

lol 😁 i've never seen a guy that excited about a database...

ricko
Автор

Any opinions about how Astro implemented the LibSQL in their "Astro DB" offering?

tutkodev
Автор

Is redis no longer necessary? Turso has no redis option

jsward
Автор

Surely bottomless implies a paid service, yes?

makasiparsad
Автор

This is nothing new and in fact it is a bad idea the fact that you can acces it remote. Just set a cron job with ssh access and a rsync config and you'll be good.

minor
visit shbcf.ru