Skip to main content

Streaming x Buferring

  • Streaming x Buferring

Entity Framework Core provides 𝐭𝐰𝐨 𝐚𝐩𝐩𝐫𝐨𝐚𝐜𝐡𝐞𝐬 for data access: buffering and streaming. It is essential to carefully consider the context and choose the appropriate approach to avoid undesired impacts.

🔹 𝐁𝐮𝐟𝐟𝐞𝐫𝐢𝐧𝐠: Loads or materializes all the data into memory so not suitable for handling large volumes of records.

🔸𝐒𝐭𝐫𝐞𝐚𝐦𝐢𝐧𝐠: Delivers one record at a time and does not load all the data into memory.

⚠️ To clarify, when we talk about "𝐨𝐩𝐭𝐢𝐦𝐢𝐳𝐢𝐧𝐠 𝐦𝐞𝐦𝐨𝐫𝐲 𝐮𝐬𝐚𝐠𝐞" in Entity Framework Core, we are not referring to performance optimization but rather selecting the appropriate data access approach based on the specific scenario and requirements to avoid unnecessary memory consumption.

1691265539878.jpg