Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Grumm18052yWhat will be in the array of strings ?
Unless you use some kind of ORM, you will need sql to get the data you want. -
Grumm18052y@ScriptCoded Yes, but based on the question I doubt he will be using MongoDB. (But it will probably be the best option for what he wants.)
-
@netikras search by the strings in the array unfortunately. It seems like key-value pair DB might not be the best option after reading the comments
-
@Grumm the strings are SEO keywords for the individual URL. Since a lot of the URLs have the same keywords, it’d be great if I could search and sort by them
-
@ScriptCoded @Grumm still haven’t decided whether I should use an SQL DB or not. I’m very open to any and all suggestions
-
arcioneo7712yWhy the front end needs to search and sort?
that's backend's work, remember, the front end just prints pretty processed data.
It would be also a waste to search and sort from every frontend invoking the url from the backend -
@arcioneo I'd argue that search and sort in FE are useful. Consider a table with optionally sortable columns. And an input field for a filter. Would it be more efficient if 1000 computers asked your single DB to do the filter/sort upon each click? Or would it be perhaps more efficient to filter/sort in those additional 1000 computers you get for free?
Also, consider the responsiveness -
arcioneo7712y@netikras that depends on what are you planning to do with such data.
for example, let's consider this map/db/whatever it is has 10,000 rows, what would it be the bandwidth required to send those 10k rows to 1,000 users?
Again, it all depends on requirements, but, as a general good practice, data should live in BE, you can use pagination to limit the amount of data sent to the FE and even make it more efficient by caching the table(using Redis or something like that).
again, it all depends o what are you trying to achieve -
@arcioneo I agree. Listing the whole shop's stock in single request is definitely suboptimal. However, fetching all the immediate friends on Facebook and caching locally might be an option (that's what, ~300 entries?).
-
Depends entirely on quantity.
So far you've said that you have an relationship of URL to SEO keyword.
Let's spin some hypothesis.
You have 10 distinct URLs.
You have 10 distinct SEO keywords.
You could solve this by just defining two lists and using an third object to define the mapping - creating an mini database based on simple objects.
Simple, crude - effective.
If we're talking about hundreds of SEO keyword and hundreds of URL I could understand an database, but if it's small, there's no need to involve an database.
Next question would be what kind of relationship you want: an 1:N or N:M.
In an 1:N you would define for each URL an list of SEO keywords.
In an M:N you would have a list of SEO keywords that is linked to one or more URLs - meaning that you define each SEO keyword only once and each URL only once and create an association between them.
The first case would be an good case for key value - nothing fancy.
Second case would be an good case for an RDBMs - as it isn't "strictly" key to value, but rather a key of a value to another key of an value - as the SEO keywords are one list, and the URLs are another list and you only reference them via their keys.
You could use an embedded, simplified database for that - depending on language, there exist quite a few. -
For anyone interested, I need up using mkDocs and the mkDocs-material theme. It’s a static site generator that creates pages from markdown files. It also has a built in search feature too which is extremely useful
Related Rants
-
ramisa14BF: If you were a database, I would join with you. Me: Left or right? BF: Inner. (there are no words)
-
Crazed13Me: "I'll never be able to do this" Me: "I suck at coding" Me: "What am I even looking at" Me: "Im going to...
-
featurenotbug26I wrote this code about 3 years ago. I guess we all had to start somewhere ¯\_(ツ)_/¯
Last question for today, I promise…
For my side project, I plan on saving a URL and an array of strings associated with that URL. I want to be able to search and sort the resulting DB from a frontend without needing complicated queries. Is this the use case for a key-value pair DB? Let me know if I’m not clear and thanks!
question
i’m stupid
noob
databases