Answer the question
In order to leave comments, you need to log in
How can you compare an assortment of 30 thousand items in a couple of seconds and update the price for them?
Hello. There is a site express.google.com, where various stores are presented when they are attached to indexes in the USA. The person, being at index 1, threw in goods from the Toys store and changed to index 2, where there is also a Toys store. But the assortment and prices are different in these two stores. Therefore, Google instantly changes the price of the product put in the cart and shows if there is no product in this store in the new index. How were they able to achieve this? It became very interesting)) There are about 30 thousand goods in one store and how you can check everything so quickly ..
Answer the question
In order to leave comments, you need to log in
Most likely, the prices are not checked, but taken from the second Toys store. This is also that there are two catalogs on the table, one for the city, the other for the region. You open one, one price, take another, others.
However, you can take two at once and compare prices by the piece. The computer also does this piece by piece, but very quickly. For him, complexity is measured in terms of data volume. That's how long it takes to copy war and peace to a flash drive (more than 30,000 lines?)? Few seconds. If with pictures :) It's the same to compare prices for 30,000 products, this is a data volume of several megabytes, if compared in two parameters, the product article + its price.
tr1ck1 , it all depends on how the database is structured. It doesn't even matter that it is linked to the site. If you are not familiar with the principles of relational databases and the SQL language, then it will be difficult to explain. All you can say is, the database is asked to “give all the info on these products for this index”, and it returns, very quickly. How queries are built and how it's all tied to the site - Goto YouTube.
If the price has changed to a product in the cart, then the link is the product id. And indexes, prices, etc. are already stretching from it.
Google, based on the id of the product (in the cart) and the new index, updated the price.
It didn't iterate over anything: just one record by ID.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question