Back

Help deploying to multiple local servers

  • 0
  • General
  • Tools
Ponguta_
13 Feb, 2023, 17:45

Hello again. I have this situation.

I want to create a system where I will store data collected from gas sensors. At this point I'm creating and deploying all the functions that this implies. But here is the thing.

I want to install sensors in different locations. So I will going to connect a local server for every location (that has sensors in it)

Those sensors are going to save the data locally on the local server in appwrite! But something like, every 10 records, it will write to my cloud server which has appwrite as well. I have to make emphasis in those local servers have poor internet connection, really unstable.

The question is. Imagine I have deployed the cloud server and 4 local servers on different locations. And I want to make an update in the structure of a collection.

What is the best way to do that.

The 4 local servers are going to have all the same schema. Only id and name is gonna change between them, and of course the data collected from sensors.

The remote (cloud server) is going to save part of the data of every local server.

TL;DR
The user wants to deploy multiple local servers and test Appwrite on them. They have poor internet connection on the local servers. They want to know how to update the structure of a collection on multiple local servers. Suggestions given include using a queue system, maintaining migration scripts, and using a VPN. The user also plans to connect everything on a VPN and add a front-end for users to check sensor status.
Drake
13 Feb, 2023, 18:11

This is a really interesting use case! I think using Appwrite on the local servers might be overkill since all you need on the local servers is a queue of data that needs to be sent to your main Appwrite server

Ponguta_
13 Feb, 2023, 18:39

Thank you Steven. Not actually a queue of data.

Because the poor internet connection, I will host on those local servers, a front end, so users can check status of sensors, and even a way to export data. Appwrite seems to me like a good option. (I mean, I love appwrite haha)

The backup on remote server will be just a way to access partially to data.

I was even planning to connect everything on a VPN. But my question keeps being the same. How can I share something like all the base schema, and deploy updates if I need.

I was thinking on create an appwrite function, that check for updates on a bucket, that has a bash scripts, download it, and apply updates. But idk if that's a good idea. I'm noob in this kind of situations.

Drake
13 Feb, 2023, 18:43

Not actually a queue of data.

I recommend thinking of it as a queue because of the poor internet connection. You queue the data to be sent, and when it has internet or it has enough, it sends it.

How can I share something like all the base schema, and deploy updates if I need.

Especially if you want to deploy updates, I would recommend maintaining migration scripts that create collections, attributes, indexes, etc. you might want to store the migration data as json so that each local server can fetch the json and then use it to create whatever it needs to

Ponguta_
13 Feb, 2023, 18:49

Nice catch, I will have to think about how to set that queue. That's true.

Can you elaborate a bit in how will you make those scripts and how you will maintain them? Can be putting them on a bucket on my remote server a valid option?

Thanks for your answers

Drake
13 Feb, 2023, 18:51

maybe a function that runs on the local server that fetches some JSON file and the JSON file can say to create a collection with x, y, or z. Or, it can say add attribute a to collection b.

Ya, file in bucket could work.

Ponguta_
13 Feb, 2023, 19:31

That sounds really cool, thank you so much Steven. I will try to implement that.

Ponguta_
14 Feb, 2023, 15:17

BTW @Steven, do you think I can handle with appwrite something like more than a million of records. Or should I create something to backup old data and clean collections?

Drake
14 Feb, 2023, 18:35

Probably but it's really hard to say since there are many variables that would affect this like your database and server specs

Ponguta_
14 Feb, 2023, 18:46

Intel quad core 2.1 base, 3.5 Turbo. 8 GB Ram

Drake
14 Feb, 2023, 18:49

I can't tell you. The best thing you can do is set up your data set and run load tests.

If you want the best performance, you should also use a dedicated database server.

Tanner Meade
14 Feb, 2023, 18:51

What's the reasoning for not using something simpler like a raspberry pi + basic code to create clients for your main Appwrite server?

Tanner Meade
14 Feb, 2023, 18:53

You could store the data pretty well, have wired/wireless connections, less power requirements, and only 1 Appwrite instance to manage.

Ponguta_
14 Feb, 2023, 19:06

I want to test Appwrite on these local servers, and see how it works.

Apart from that. Clients that use my mobile app, automatically switch from local data to internet data. So is just because of that.

Ponguta_
14 Feb, 2023, 19:07

But seems like it will be easier to use just basic python containers and create my own local API

Ponguta_
14 Feb, 2023, 19:07

If you have any ideas for this it will be really appreciated

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more