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:
- read incoming row
- read corresponding row in database
- 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?
split database multiple parts. (to address size issue)
design algorithm cache of these database pieces memory. (speed)
based on incoming id, hash query relevant database.
if step 2 not possible achieved efficiently, wont work.
Comments
Post a Comment