I have an ASP.NET MVC application that I am currently working on. The application should scale to be able to support web farms. In addition to plain old database access, users will have the ability to upload files. Of course this means the files will need to be uploaded to a single server location on a web farm and I am considering using CSLA to fulfill that need.
The application will also have a search feature and I have determined that the best search available for .NET currently is Lucene.NET. However, being that it is a line-by-line port from Java (which means the API is horrid) and it also requires direct file system access for the indices, I am also seriously considering making a separate data portal for Lucene as well.
So basically, I have this:
Type | Method | Likely to be remote? |
---|---|---|
Database Access | Database DataPortal | Almost Never |
File System Access | File DataPortal | Always in Web Farm |
Lucene.NET Access | Lucene DataPortal | Always in Web Farm |
First of all, what CSLA types would I need to implement/override to be able to use multiple data portals in CSLA 4.x? I would like to do so using DI if possible. Note that I already use DI to inject my repositories and other dependencies into CSLA.
Secondly, if you were me, would you just put all of this into the same DataPortal and hard code the RunLocalAttribute on the data access part since running that in a 3 physical tier environment is not all that useful anyway?
Third, the files (mostly images) will need to be uploaded through CSLA. I realize I can use byte arrays for this, but is there any way to configure or extend CSLA so the files are streamed to a remote data portal directly (browser > data portal)? Or is CSLA not the right tool for the job?
I will need an abstraction from the file system because the application will also support APIs of CDNs to host the files. In addition, there could be additional APIs for search other than Lucene.NET, so running multiple data portals to allow these pieces to be swapped independently (and separate from the data access part) seems like it might be the right way to go.
I am currently using MVC 4, .NET 4.5 and CSLA 4.5.20.