#Invite Tracker and Giveaway bot

1 messages · Page 1 of 1 (latest)

night notch
normal vessel
#

If something was to be interrupted for instance, the json file itself would be corrupted. Json is mainly used for configurations, not a db

#

!!nojson

tough havenBOT
#

Why JSON is unsuitable as a database.

1) JSON, quite simply, is not a database. It's not designed to be a data storage format, rather a way of transmitting data over a network. It's also often used as a way of doing configuration files for programs.

2) There is no redundancy built in to JSON. JSON is just a format, and Python has libraries for it like json and ujson that let you load and dump it, sometimes to files, but that's all it does, write data to a file. There is no sort of DBMS (Database Management System), which means no sort of sophistication in how the data is stored, or built in ways to keep it safe and backed up, there's no built in encryption either - bear in mind in larger applications encryption may be necessary for GDPR/relevant data protection regulations compliance.

3) JSON, unlike relational databases, has no way to store relational data, which is a very commonly needed way of storing data. Relational data, as the name may suggest, is data that relates to other data. For example if you have a table of users and a table of servers, the server table will probably have an owner field, where you'd reference a user from the users table. [This is only relevant for relational data]

4) JSON is primarily a KV (key-value) format, for example `` where a is the key and b is the value, but what if you want to search not by that key but by a sub-key? Well, instead of being able to quickly use var[key], which in a Python dictionary has a constant return time (for more info look up hash tables), you now have to iterate through every object in the dictionary and compare to find what you're looking for. Most relational database systems, like MySQL, MariaDB, and PostgreSQL have ways of indexing secondary fields apart from the primary key so that you can easily search by multiple attributes.

For more info and resources about storing persistent data, please see https://vcokltfre.dev/tips/storage/

night notch
normal vessel
#

mysql, mongodb, etc

night notch
normal vessel
#

its more of a data storing as a tabular form

#

u dont have to exactly copy other bots

#

as in the db part btw

night notch
#

Do u mean which file format to use

normal vessel
normal vessel
night notch
#

I saw more people suggesting sqlite online

normal vessel
#

mysql was just an example

night notch
#

Do u have anything else to improve bolb

normal vessel
#

i havent checked the whole thing but the ones i checked before arent bad

night notch
#

Doesnt seem to work that good

#

Should I make a seperate file for leaderboards and update it everytime someone joins the server

#

Or should I just keep it like that for now

normal vessel
#

i personally never tried sqlite since i mostly use mongodb

night notch
# normal vessel i mean you could try that

Rn I have a file for each server where every user has a invites list leaves list and counts for each so my bot only looks at the top counts and subtract the invite count - leaves count for the invited people that are still in the server

#

Do the invite and leave list make the process of that slower?

normal vessel
#

you'll have to ask that in #help since im not entirely sure about the speed

night notch
#

This is so hard

#

why

night notch
#

Finally

mortal wraith
#

no

silk sand
#

Not found man

#

Looks neat from the video

night notch
#

Here

#

Added some more stuff than on the video

#

Trying to do joun roles now

night notch
#

@silk sand

#

Tell me if you find a bug

#

Still tryna improve it

silk sand
night notch
normal vessel
night notch
#

@silk sand whats ur user

silk sand
night notch
#

@silk sand

silk sand
#

Or would you like me to be occassionally contrubuting send PRs and maybe you can accept/ decline?

night notch
#

On the roadmap you can see features I want to add and if I get new ideas or someone requests a feature I will add them to the roadmap

night notch
#

Would be appreciated

silk sand
#

Alr

#

PRs it is

#

Don't expect too much PRs yet cuz I'm kinda busy this few months TC_cat_sweat sorry!

night notch