libSQL Server

a year ago

Description: libSQL is SQLite for modern applications

Category: Other

URL: https://railway.app/template/p121Tx

17 Replies

a year ago

Note: This template does not come with any authentication enabled by default, to set up authentication see their documentation. If you plan to leave the database without authentication please remove the public domain from the service.


Can I pass the following configuration to enable the continuous backup?


a year ago

Simply set a start command on the service -

/usr/local/bin/docker-entrypoint.sh /bin/sqld --enable-bottomless-replication

Though I don't know if the image has built sqld with the -F bottomless flag, so that's something you might need to do.


Regarding your first comment, you can actually set up authentication, see my PR here https://github.com/tursodatabase/libsql/pull/1369/files. I set it up on my service and it works perfectly. In this case, the deploy logs show "Using legacy HTTP basic authentication" and it throws a 401 if no token is passed

(PS: haven't had time to test the replication yet)


a year ago

Awesome! I didn't know that, I will update the template and initial message accordingly.


I setup the bottomless replication and looks to work fine. I didn't have to change the start command and only setup the following env variables LIBSQL_BOTTOMLESS_AWS_ACCESS_KEY_ID, LIBSQL_BOTTOMLESS_AWS_DEFAULT_REGION, LIBSQL_BOTTOMLESS_AWS_SECRET_ACCESS_KEY, LIBSQL_BOTTOMLESS_BUCKET, LIBSQL_BOTTOMLESS_ENDPOINT and SQLD_ENABLE_BOTTOMLESS_REPLICATION. Data gets backup on R2 every time a change occurs on the database


a year ago

I'll make a note of that on the overview too, just haven't had much time to make these changes yet.


danfasciaHOBBY

10 months ago

Thanks for publishing this template, which is really great.

One issue I am having - during specific times (UK afternoon 12:00 into evening) I get a ton of Error 500 from this server, in the form of failed database queries returning that error. I have checked and the root cause is this LibSQL server instance, and I get the same when I directly connect to it with libsqlstudio. It does not happen at other times of day, it is very specifically in that time period every day.Is this a Railway US East capacity thing on the shared service? or should I be looking somewhere else to work this out?


10 months ago

Are you communicating with the libsql server via the private network?

Do you have any kind of logs or metrics that you could share?


danfasciaHOBBY

10 months ago

No, I was using it as a remote db server to an external site. I suppose this could be the issue but when it works the ping time is decent between servers at 70ms max.

There’s absolutely nothing hitting the railway logs.


10 months ago

The template comes without auth, so unless you set that up you should not be communicating to it from outside of Railways private network.


danfasciaHOBBY

10 months ago

I’m not using this as a production system, just trying architectures for now. It works without setting up auth, obviously I understand the security implications and wouldn’t do this for production.

However I don’t think this is anything to do with the cause of Error 500s, unless you can make a connection I wasn’t able to.

I think I will try it purely within railway using the internal networking and see if it makes a difference.


10 months ago

Do you have the edge proxy enabled?


danfasciaHOBBY

10 months ago

Yes I do


10 months ago

These would be 500 responses returned by libsql server then.


danfasciaHOBBY

10 months ago

Thanks for your insight and help. I’ll try switching it off.


keagancodingHOBBY

9 months ago

How would I go about setting up the admin api to enable name spaces? The docs say I need to edits the hosts but im not sure how to do that


libSQL Server - Railway Help Station