Not really an issue but looking for suggestions on the best way to deal with the below use case.
I am trying to implement an IP whitelist allowing users to restrict access to, say a corporate network. Working on this got me thinking about the best way of implementing something like this for a large list of IP's. I know Appwrite DB (MariaDB) has full text search so
- I can create a single document that as part of a String field maintains a delimited IP address list and a cloud function that would validate and allow or reject requests
- Have a collection with each IP as a document in an indexed field.
- Save a CSV in storage and have function pull the file, read and validate IP against it.
Not sure what would be the right way, if there is one best way, of implementing something like this. Open to other ideas.
For the fastest lookup of a single IP (1.2.3.4), I would have a collection where the ID is the IP and use databases.getDocument() because databases.getDocument() fetches the document from cache (if available).
That said, for your use case, it's common to have ranges or even subnet masks or CIDR notation rather than a list of IP Addresses. If you're going this route, I would suggest finding a library that will accept the values and check against an IP. Then, you would figure out the best storage method based on what your library requires
[Solved] best way to load and query a IP block list
Recommended threads
- Password check in function
Hi, is there any way now for checking if the users password is correct in a function? I am creating a delete user function and before deleting I would like to c...
- DB connection | Got timeout reading comm...
When looking at the logs of `appwrite-mariadb` I'm seeing a lot of: ``` 2026-04-09 7:37:28 10 [Warning] Aborted connection 10 to db: 'appwrite' user: 'appwrit...
- Invalid document structure: Unknown attr...
Environment: Dart version: 3.5.1 dart_appwrite: 13.0.0 I’ve already created the database structure using a Dart function. I can create data records using cloud...