1

I'm building an ECM project, my client wants web and desktop clients. So I decided to build ASP.NET MVC WebApp and WPF desktop client. Both are going to comunicate with business through an Web API project (actually I'm not sure about using Web API or WCF with MTOM as a Service Layer).

Since I expect the project to somehow scale, I'm worried about memory consumption, then I searched and couldn't figure out whether the server is going to use twice the memory when storing/retrieving files.

Suppose some user uploads a 500MB file. MVC receives the file (therefore occupying 500MB of memory for that file, at least I think it's how it works). Assuming the MVC will delegate the request to Web API (which is hosted in the same server), which is going to take care of storing the file, my question is:

Will the server consumes twice the memory during this process?

If yes, are there any techniques to avoid this? (no need to write full examples, I can search for it once I know what to search for).

Feel free to tell me if this is a bad design and suggest different approaches for this scenario, I'm trying to figure out if it's worth separating API in different project.

Alisson Reinaldo Silva
  • 10,009
  • 5
  • 65
  • 83
  • Hi. How are uploading the file. When I did this against web Api the file upload was posted from the client side through JavaScript to a stream reader in web api. Server memory consumption was minimal. Am I missing something? – Bill Jul 15 '16 at 22:48
  • @Bill no, you understood correctly. In my case, I'd send from javascript in the client to the web server (asp.net mvc webapp), then from webserver to web api (actually in the same server, but I could put them in different). Sending from javascript to webserver is ok, but when I send from WebApp to WebAPI, will the server get twice memory (because the same document is in memory in both applications), or as soon as the bytes are sent from one to another, the memory taken from sender WebApp is reduced, while API increases? – Alisson Reinaldo Silva Jul 16 '16 at 16:22

0 Answers0