synchronization - Efficiently synchronize streaming input with large SQL database -


i've got efficiency problem on hands , i'm looking ways solve it. here situation:

  • i have streaming row-based data coming system online source, each unique id.
  • i have sql database existing row-based data, indexed id.
  • i need update sql database new data streaming in if differs existing data in database.

the obvious solution is:

  1. read incoming row
  2. read corresponding row in database
  3. if data differs, update database

the large number of round-trips making algorithm infeasibly slow.

the alternative solution have read entire sql database memory, , compare new incoming data. eliminates round-trips memory required makes infeasible.

so, alternatives have?

  1. split database multiple parts. (to address size issue)

  2. design algorithm cache of these database pieces memory. (speed)

  3. based on incoming id, hash query relevant database.

if step 2 not possible achieved efficiently, wont work.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -