Home > Not CodeFluent Related :), SQL Server > Manipulating SQL Blobs With Streams

Manipulating SQL Blobs With Streams

Streams have always been difficult to understand and master in programming, and yet it is a key concept that should be assimilated by all developers that develop "scalable" applications and want to get rid of storing data on physical disk. Streaming lets you cut up a block of data into small chunks that will be sent to the remote endpoint.

As an example, streaming is strongly used in Video-On-Demand offerings where customers can start watching a movie (usually weighing around 750MB in a compressed format) without having to download it completely on his local hard-drive. In this scenario, the VOD server splits the movie file in small "chunks" of data and sends them to the customer’s media software.

From a programming perspective, you can think of a stream as a one-dimensional set of contiguous data, which has a beginning and an end, and where the cursor indicates the current position in the stream. The data contained in the stream may come from memory, a file, a TCP/IP socket and even a database.

The core operations on a stream are: read, write and seek. In the .NET Framework, a stream is represented by the Stream class, which forms the abstract class for all other streams. Two important points with streams is that they are mostly used in a "forward only" mode and the length of the underlying data are not known in advance. We must be aware of this last constraint and try to "play" with it rather than look for workarounds.

Read the full article here!

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s