Database?

Hello! While developing any website with dynamic content you need to use a database. A database is a structured collection of information, usually in form of tables. Websites use databases to store information in a (usually) clean and organized way. But how does it keep track of what goes where? Databases use schematics to structure their data, it’s a template for which datatype each column is supposed to store. Each row represents an entry, one row is one “thing”. Here is the schema for the users table in the davespace remake:

Each account is stored like this, with a sequential id to quickly find a specific entry. VARCHAR is just text, it contains up to a certain amount of characters. UNIQUE means the database won’t let two columns have the same value, two users can’t have the same username. DEFAULT sets a default value, if you add a row to the table and don’t give that column a value, it will be the default value. NOT NULL makes sure you give that column a value, and TEXT stores text. Finally, TIMESTAMP WITH TIME ZONE stores the time while accounting for time zones, so if a user in a different time zone views it, it will be accurate.

CONCLUSION

So that’s how davespace uses databases, not much different from regular sites, but still good insight into the project. Goodbye.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top