Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Assume I have built a video sharing site such as youtube, and I want to build a recommendation system.
Assume I have a simple database [ video title, link/url to database ]
Lets assume user watches a video simply tiled - 'Sachin Tendulkar'.
How can I run a query to return me other videos whose search title includes sachin tendulkar ?
eg: other videos could be titled -
Straight drive by Sachin Tendulkar or Sachin Tendulkars famous reply to Bret Lee.
In other words, which query can I run to fetch all the videos whose title contains Sachin ?
Practically any database should be able to run such queries.
In the case of SQL, using a simple WHERE ... LIKE ... condition with wildcards should be sufficient for simple cases.
The interesting question will be how to scale this once you are dealing with much larger amounts of data, think YouTube for video portals. But until performance really becomes an issue, adding additional complexity can most likely be considered premature optimization and should be avoided.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
You enter a line that you want to look up and it gives you matching results with some context i.e. a few lines above and below it.
I was wondering what would be the best way to do that.
The text files probably wouldn't go over a megabyte each and their total number would be about 200.
One method could be to store them as text files, read them in into memory with Java, do text searches and serve the results through JSP.
I don't have much knowledge of JSP and could always learn it but I believe it might be too slow.
Any ideas?
What you are looking for is a search engine. There are many but most populars are ElasticSearch and Solr, which both use the Lucene Java library. Your requirement is very simple for a search system and both will do great job, but I'd choose ElasticSearch myself. You can also choose to use Lucene directly.
The feature to return results "with context" is called highlighting in Eleasticsearch.
It seems your data is near 200megabytes, but if it was smaller you could also use a javascript implementation like Lunr
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
Is it possible/reasonable to have a voting system on NoSQL database ?
For example how would be possible to store StackOverflow question into the NoSQL database.
I can easily imagine almost everything except how the relation will work between question/vote/user. Everything else can be stored in one document, like tags, comments(assuming there are relatively small amount of comments on posts, in my case I will not have comments anyway), user information, etc... but can't imagine how to store user votes as document will become huge. One of the options is that I can have votes stored in separate collection/document, but it will mean that while loading a question there will be a need to send another request to check if the user have voted for a question or not.
A good reference is the MongoDB documentation on Embedded documents vs Referenced documents, since those are what you seem to be referring into your question. There's no perfect solution, as both have their trade offs. You just have to make the best decision based on the type of operations/queries and their frequencies that you're expecting to be run on your database.
Honestly, until your database starts getting some serious traffic, the difference between SQL and NoSQL won't matter. Pre optimization can end up doing more harm than good, so I would just go with the one that is easiest to get deployed and you're more comfortable with to begin with.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I'm creating a mobile app to access journal articles.
They are organized by Volume -> Issue -> Section -> Article. This means that I will have 13 * 4 * 10 * 3 = 1560 articles. What is a good way to implement a database to host these articles (including their images, resources, etc) on a web server? Each article is currently marked up in HTML. I believe this is nice, because in my apps I will display the content in a web view. However, I'll need to query the articles for search functions, saving locally to the device, etc.
I'd prefer it to be open source, and as I'm new to databases (but fairly proficient in app development), I'd appreciate if you could point me toward the best way of learning.
I'm not sure if you are looking for advice concerning the structure but this might help you as an approach for further thinking:
create a table in which you write all the data
You have one column with a unique ID for each article
one column for each field of Volume, issue etc.
Then you have one column that contains a huge string in which you put the html data as a string. (There might be a better way especially concerning a search function)
You can also save it as a BLOB but this makes indexing a lot harder.
I would probably save the resources separated from the database. Then you just name them after the article id. For example resource number 10 in article 5 would be 5.10.pdf or whatever format. This depends on your html format of course. And whether you want to rename all your files (might be A LOT of work for 1500 articles)
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
The execution time for the scripts is slower. Although this much in a browser is great.
And, The published web app's load time is highly intolerable, that contained junk ( Probably because the UI is done with UIBuilder and the spaces were taken in unicode characters or whatever ).
Two questions here.
For seamless responsiveness, Is that the script folks wished the complete javascript be loaded and run in the browser and there is nothing we could do about it ?
Any optimizing techniques we should look for.
I have found that hand rolling the html and delivering with HtmlService is significantly quicker than UIService. This obviously depends on your circumstances depending on how confident you are scripting your own validators and onEdit functions. But as a possible optimisation this is where I'd start.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Does anyone have any ideas on measuring the popularity of an open source project? I thought it would be interesting to create a tools which would compare the popularity of similar open source projects.
The first metric that came to mind was to compare the number of Google results for each specific software, but it seems difficult to programmatically obtain this number (other than scraping it from the direct search page - this also runs into legal issues with Google I believe).
Any other metric ideas? I'd like the end product to be a tool, so metrics which are able to be accessed through code would be preferred.
Thanks,
Chris
If the projects are hosted by platforms like Sourceforge or Github, you can access the number of downloads...
SourceForge offer download statistics;
http://sourceforge.net/project/stats/detail.php?group_id=263007&ugn=dvwa&mode=week&type=prdownload
Google Code have activity ratings.
Maybe you could use those?