Upgrading the Database #100
Replies: 4 comments 8 replies
Choosing a DB Systemusers table: Has id, username, email, password. Crucially, username and email are UNIQUE. This screams relational structure. You need strong consistency and data integrity to ensure usernames/emails aren't duplicated and that user data is reliable. pages table: Has title (PK, UNIQUE), url (UNIQUE), language (constrained), last_updated, content. Again, this is highly structured data with uniqueness constraints. The content is TEXT, which SQL databases handle perfectly well. Based on this I think we should stick with a relational DB, and my suggestion would be to use PostgreSQL Where to put the DatabaseAzure DB Service for our chosen database, would probably be the easiest, but it looks quite expensive from what I can see. We should ask Anders about how much this would cost, and what is included in our Azure Student free tier. Our other optsions as I see it: Virtual Machine (VM) on Azure (IaaS): You provision a virtual machine in Azure and install PostgreSQL on it yourself. |
|
Good points from Aleksander. I think PostgreSQL sounds interesting and relevant. I like that it is open source, and that it seems like a popular solution, so it would be a good investment of our time to learn about it. I don't think we should go with MySQL due to it's enterprise limitations. But I don't have a better argument atm, if some of you think otherwise. I also think we should ask Anders on Friday what to do with the database. A DB in a VM or Container on Azure is more work, but we might have to consider it, if an Azure DB is too expensive. I want to do a bit more research, but these are my initial thoughts. I will write some more reflections after I've done that. |
|
In regards of where to put the Database, I can see that we through Github Student Developer Pack have acces to Heroku and DigitalOcean. DigitalOcean requires you to attach a credit card, so I don't really like that solution, but we could look into Heroku There is also things outside of the student developer pack, such as:
|
|
I read about Vector databases which sounds super relevant to us, if we are to expand the search results later on. It's way to embed unstructured data into multidimensional coordinates where things that closer related, will be positioned closer to each other. When the embedded space has been constructed, you will see the results that are most closely related to what the user has searched for. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
What Database system should we go with? Relational or a no-sql DB - and why?
From Anders:
You are free to choose NoSQL or relational databases. Your chioces should be informed and based on the business domain and the data model of whoknows. (Not personal preference).
If the choice is between PostgreSQL and MySQL your choice for a modern stack should without a doubt be PostgreSQL. Here are a plethora of reasons why:
Where to put the database
The problem with PostgreSQL and other databases is that they take up a lot of resources on the VM if placed with the rest of the application.
There are many ways to solve this issue. You are allowed to use a managed database service.
But your solution should consider not only scalability but also cost.
2 votes ·
All reactions