Тёмный

Run SQLite As A Server with LibSQL Step By Step 

Stephen Blum
Подписаться 1,5 тыс.
Просмотров 2,7 тыс.
50% 1

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.

Наука

Опубликовано:

 

7 мар 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 24   
@BentleyThomas
@BentleyThomas 7 дней назад
love your delivery😊
@StephenBlum
@StephenBlum 7 дней назад
Thank you!! 😊 looking forward to continue planning more videos. Lots of great software engineering topics 😄🙌
@weiSane
@weiSane 3 месяца назад
Thanks Stephen. Now I can use this for my side project. Learned a lot and my previous confusion of libsql and sqld is gone .
@StephenBlum
@StephenBlum 3 месяца назад
Nice! It's a great DB and will be fantastic for your side project 😄
@HideBuz
@HideBuz День назад
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!
@StephenBlum
@StephenBlum День назад
that sounds amazing! 🤩 minio + libsql + WAL mode + VFS as a distributed database. WAL mode should allow for this. You point the database-file.db to a mounted directory VFS connected to minio bucket. That should do it I think. Definitely needs testing. Great idea! Add your idea to the planned videos list 😄
@iatheman
@iatheman Месяц назад
Dude this is so high quality. I hope the channel keeps growing.
@StephenBlum
@StephenBlum Месяц назад
Your comment is great to hear! Thank you 😊🎉🙌 more videos planned
@HomeEngineer-wm5fg
@HomeEngineer-wm5fg 3 месяца назад
@8:11 This Sir is my DREAM skill to learn! It is a core feature in a hypothetical app I want to produce.
@StephenBlum
@StephenBlum 3 месяца назад
That sounds exciting! A powerful skill 😄🚀
@HomeEngineer-wm5fg
@HomeEngineer-wm5fg 3 месяца назад
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.
@StephenBlum
@StephenBlum 3 месяца назад
Nice! Do you prefer the HTTP API or the embedded API? The HTTP API allows you to host the DB on a remote server that multiple application workloads can access. The embedded API only works locally.
@HomeEngineer-wm5fg
@HomeEngineer-wm5fg 3 месяца назад
@@StephenBlum I don't know the tradeoff, admittedly I am going to be running this locally, a "star network" mirroring a database on a shared drive with the option to have concurrent updates from multiple users inputs.
@StephenBlum
@StephenBlum 3 месяца назад
That is awesome! Using the docker container for LibSQL and the sqld server allows you to share database easily with concurrent user access 🎉🚀
@ricko13
@ricko13 3 дня назад
lol 😁 i've never seen a guy that excited about a database...
@StephenBlum
@StephenBlum 3 дня назад
😄 🙌 it's exciting because it's powerful. And you can start businesses. The potential is exciting 🎉
@tutkodev
@tutkodev 3 месяца назад
Any opinions about how Astro implemented the LibSQL in their "Astro DB" offering?
@StephenBlum
@StephenBlum 3 месяца назад
I took a look at astro.build/db/ and it looks like a solid implementation. They use the standard features by reading the docs it looks like they could have used standard SQLite as well. Based on their prices, writes are 1000x more expensive. It looks like they really are using the replication capabilities of libSQL 🚀
@jsward17
@jsward17 Месяц назад
Is redis no longer necessary? Turso has no redis option
@StephenBlum
@StephenBlum Месяц назад
Good question! Even though SQLite/Turso doesn't have Redis, that is okay. And for the most part Redis isn't needed. You can simplify your stack by using 100% SQLite/Turso. There are some future considerations: Redis vs SQLite these have different architectures. SQLite will have more SQL capabilities than Redis, which sets you up for future query needs. And Redis is built specifically for speed and simple queries. You'd ideally use both for their strengths. Redis will be faster for simple get/list/fetch items, and faster changing items. SQLite will be best for more complex joins and aggregations.
@makasiparsad
@makasiparsad 3 месяца назад
Surely bottomless implies a paid service, yes?
@StephenBlum
@StephenBlum 3 месяца назад
It's actually 100% open source!
@minor12828
@minor12828 Месяц назад
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.
@StephenBlum
@StephenBlum Месяц назад
That's a great idea! Yes that will also work very well. Your approach is excellent because of the simplicity and idempotent nature. Great comment I love to hear this feedback. Thank you!
Далее
Production SQLite with Turso and libSQL
1:02:53
Просмотров 6 тыс.
Life After SQL (EdgeDB Is Fascinating)
15:40
Просмотров 54 тыс.
24 часа Я МИСТЕР БИСТ челлендж
1:12:42
SQLite vs PostgreSQL or MySQL
15:07
Просмотров 7 тыс.
Supabase just shipped a LOT of cool stuff...
15:31
Просмотров 3,3 тыс.
SQLite in Production - Master Course
6:37
Просмотров 3,1 тыс.
Add extra server to Coolify
10:34
Просмотров 4 тыс.
AstroDB might be the easiest SQL setup you can get
9:15
DHH discusses SQLite (and Stoicism)
54:00
Просмотров 51 тыс.
Local-First is the Future, Here’s Why
14:51
Просмотров 16 тыс.
David Crawshaw   SQLite and Go
32:03
Просмотров 34 тыс.
Syncing SQLite and Postgres?
24:14
Просмотров 8 тыс.
iPhone 12 socket cleaning #fixit
0:30
Просмотров 49 млн
Купил этот ваш VR.
37:21
Просмотров 292 тыс.