High Performance Database Access Layer in asp.net - asp.net

I am developing a applicatin which are having more than 5000 users once upon time. I using
ASP.NET 3.5 framework for developement. I want to develope a high performance DAL Layer
using latest technolgies like linq,ADO.NET Entity,ADO.NET Data services. I also want to make sure that it shuld be generic to all the future developement. Can any one pleasae Let me know which pattern i should use to develope that Database Access Layer. I am also
want to use microsoft enterprise library for that.

I think you should look at NHibernate and Fluent NHibernate.
You could save yourself a lot of time by not writing your own DAL. Only you know your non-functional requirements around perf and whether you're optimizing for reads, updates or something else, so write some tests, prototype, and see how it goes.
My personaly opinion is that Microsoft Ent Lib and perf aren't best buddies, but again you should prototype and prove this early in your dev cycle.

You can use Linq to SQL.
You can also take a look at this article series for creating an actual DAL using the same technology.

Related

Rich Internet Application (RIA) for Oracle Database Application

Our Oracle application is written in Oracle Forms. However, there is a requirement for it to be a Rich Internet Application (RIA). I.e. no deployment, accessed via web, looks and navigates (tabbing etc) as closely to a desktop GUI application as possible.
Apex has been discarded as not good enough and will not produce a sufficiently good user experience and does not look good compared to other technologies.
Silverlight is being suggested as the best way forward, but I would like to know what else is out there.
I have had suggestions that the way forward is to use HTML5/CSS, but we need a good framework for managing records. I do not wish to be reinventing the wheel. I understand that Silverlight for Business Applications takes care of some of those requirements.
Also, the idea is to create web services in Oracle and have a Silverlight front-end. Is this possible / the right way of doing things?
Any pointers in the right direction or thoughts would be appreciated.
Thanks.
Apex has been discarded as not good
enough and will not produce a
sufficiently good user experience and
does not look good compared to other
technologies.
Oracle Apex has all the features that you are looking for. You can customize it using CSS, users can access it using web and since your current application is in Oracle Forms, you can reuse a lot of your code written in Oracle procedures/packages/triggers. Also, the learning curve for your Oracle Developers would be very smooth.
I'd suggest you to try and create a small module for your future project and see how effective it is in terms of both Development time and the rich UI.
I don't know much about it, but you might want to look at FormSpider.
And of course there is Oracle ADF.
Like Rajesh, I bridle at the suggestion that Apex is "not good enough", having been heavily involved in a very successful Apex project ;-)
From my point of view,there is no direct dependence between your future RIA's and the RDBMS you are using now. In other words,features and advantages of Silverlight\Entity Framework are almost equal for different data sources (e.g SQL Server,Oracle and etc).
Also, the idea is to create web
services in Oracle and have a
Silverlight front-end. Is this
possible / the right way of doing
things?
Using a middle tier (WCF or WCF RIA Services) as a data access layer will be more preferable than creating web-services in Oracle.
This tutorial can be usefull for you to get some general view of the Silverlight and WCF Ria Services.
http://www.silverlightshow.net/items/WCF-RIA-Services-Part-1-Getting-Started.aspx

What is better for my ASP.NET project using (Server explorer) or DBconnect class?

I have ASP.NET project and I want to know what is better to use.
ODBC connection and with Server Explorer (drag and drop make DataSet and modify it) or do some DBconnect class with connection to database, queries and use it for GridView?
When I use server explorer, I don't have good feeling because all logic is on aspx page and I do not separate from the application layer logic layer.
It will be a lagre application, databese(PostreSQL) have 18 tables and difficult constraints and application have to generate some documents etc. .
"Better" depends entirely on your situation. Is the purpose to get something done as quickly as possible for internal users at your company, or is this going to be a commercial site that will need to be highly extensible and needs to be as easy as possible to maintain? Will you need to integrate with other platforms possibly built using other languages at some point? The answers to all of these questions should affect your decision.
If you're looking to separate your project into distinct layers, then I would recommend an ORM such as NHibernate or Entity Framework (there are other commercially available ORM products out there, but these are the ones I'm familiar with and which you can easily get help with on this site).
Create a DataSource with LINQ to Entity. It let you the liberty of LINQ with the peace of mind of when you change something il will break your build so you will be able to debug more efficiently.
Well if you have total flexibility, I would recommend using C# ASP.NET 4 with MVC3 razor for the UI and application code. Use Entity Framework 4.1 code first for the data access layer.
This way you will always work with real objects that you create, and with List<realtype> instead of the total mess that exists with datasets.

Is Eloquera or db4o better suited for my web application?

I'm considering using an object oriented database in Visual Studio .NET for my web application, which is basically a web store.
Which should I consider, Eloquera or db4o? Can I have some fresh perspective?
A similar question was asked like 10 months ago - please also mention changes since then.
The features that I consider important are:
Ease of integration into web application project.
Ease of querying using LINQ.
Ease of deployment upon release in IIS server.
Multi user support.
Looks like db4o could be a fit for your needs, but that depends on two factors:
If you're going to host your web store on a hosting provider db4o won't work in a limited trust environment
Depending on the number of simultaneous users, db4o could be a fit or not. As a rule of thumb I would say that if you're talking about more than 50 users hitting the db at the same time, then you should look at other options (one example: Versant Object Database).
Disclosure: I work for Versant and db4o.
Another option would be RavenDb -- it is more of a document database than an object database but it satisfies your requirements by and large:
Easy Integration: insanely easy; use nuget
Easy Linq: linq is the query platform
Easy for IIS: pretty much set up an application pointed there and you are done
Multi-User: yup.
I suggest Eloquera. All the pros of db4o (and more), less some cons...
Real World Experience of db4o and/or Eloquera Database
Eloquera is multihreaded, in opposite to db4o. So, if you expect more that a single visitor to your website, Eloquera is an obvious winner here.
Moreover, Eloquera provides the object-oriented and document-oriented APIs, which can be used together.

Data Access using ASP.NET, what is the best?

I have been asking my self this question from the time i started workin in the software development field,
What is the best way to access data?
Which gives the best performance?
Which is the best for maintainability?
There are lots of solutions to deal with database in the Asp.Net web app,
Entity framework 4.0
Classes generator using ADO.Net such as Code Author ( i liked the way it works and the way it accesses the database using the data access block in Microsoft Enterprise Library).
i will start a new project tomorrow,and i don't know which approach is better??Any idea?
I'm using Castle Active Record for data access in our new ASP.NET project. It's a great and easy tool that is built upon NHibernate. NHibernate itself is a great ORM for .Net.
There is no "best". There is only preference. Some like MVC, some like WebForms, some like Dynamic Data. Entity Framework works nicely, as does LINQ to SQL(although I hear that one is being deprecated, but I'm fuzzy on that.) All work well.
Personally, I like WebForms, but if I want a quick and dirty CRUD app, I always opt for Dynamic Data, and if I need additional functionality mixed in, I can throw in some standard WebForm aspx pages.
Performance wise, I don't know that there's inherently a big difference. All use the same code under the hood. All are based on ADO.NET. Entity Framework and LINQ to SQL seem to have additional overhead compared to the old-fashioned WebForms, but proper DB design and planning is probably of greater importance.

ASP.NET MVC open source application. MySQL or SQL Server? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have around 4 years experience of ASP.NET & SQL Server (only web forms). I have a little knowledge of Ruby on Rails and have developed one very small 2-3 pages application in ASP.NET MVC in my job. Now I and one of my friend ( same experience like me) are willing to gain more experience of ASP.NET MVC. For that purpose we have thought of developing an open source application in ASP.NET MVC. It can be a a blog system or forum or anything else so that community can also take benefit of it. But we are not able to decide the back-end database for the application between MySQL and SQL Server. What will you suggest in terms of following -
Which will be more supported or required by community?
If we use MySQL, will it be a tough road ahead?
Is there any chance of supporting both by using ORM (I have no experience of working with any ORM)
Any other suggestion ?
Thanks in advance.
If you can't decide which to use as a backend, then one suggestion I have it define an interface for the data layer, use the IRepository pattern against this interface, and simply pick one and write an implementation of the data layer for that choice. In a (successful) open source project, it's unlikely that everyone who wants to use it will have the same ideas about what database will work for them. In that case, designing it so that it can use any database, given a suitable implementation of the interface is a wise move. Using something like nHibernate, which already supports many different databases may be the route you want to go if you don't mind having dependencies on other libraries.
Which will be more supported or required by community?
For most business users, and most dedicated ASP hosting providers, it will be Microsoft SQL Server IMHO. With a surprising spread across version numbers. I see quite many SQL Server 2008, a lot of 2005, and quite surprisingly many 2000's too.
For small "we're cheap, is it gratis?" businesses and individuals, I do see some MySQL on Windows too. I guess in my little circle of companies that I've worked with, it is 2/3 MSSQL and 1/3 MySQL of the two databases you mention.
If we use MySQL, will it be a tough road ahead?
In terms of more difficult development? Yes and no; LINQ to SQL is more or less only available for MSSQL, and many find it to be a simple and natural technology to work with. So "yes" if your plan was to use LINQ to SQL as your ORM of choice. Other good ORM's like nHibernate work equally well with both databases, as elder_george says.
Is there any chance of supporting both by using ORM (I have no experience of working with any ORM)
Sure, f.x. with nHibernate, and a bit of extra XML for nHibernate configuration, and some more extensive install docs, SQL scripts et cetera for the users.
Any other suggestion ?
Since this is your first application, play around with the design first using mocksups & prototyping, UML or something else of your choice. See if you can get some experienced MVC developers to critique your design, but don't take their critique as gospel, there is more than one way of doing things right.
Definitely consider tvanfosson's suggestion to use an IRepository to provide flexibility on the storage layer.
Consider using unit testing and dependency injection from the start too; both are IMHO very important and helpful in the longer run. On the downside, that would be a lot of new technology if you don't have prior experience with these.
MS SQL is easier to use with .NET. .NET includes LINQ to SQL ORM out-of-box, so nothing has to be installed.
MS SQL has a free Express edition but it's up to you to decide whether its capabilities (4Gb for DB, 1 CPU only and so on) will be enough for your application (IMHO they will be =))
There'are ORMs that allows to switch between DBMS's: NHibernate, SubSonic, DbLinq. NHibernate is the strongest beast out there, and it has an active record implementation built if you are looking for familiar concepts from RoR.
tvanfosson and elder_george had given good comments.
ASP.NET MVC aside, it's more of MySQL vs MSSQL. I've developed web projects using both and find them relatively on-par from a development point of view. ORM I've used is NHibernate.
From deployment/production perspective, you will be bounded by MSSQL Express edition's limitation, assuming you are not going to pay for it. You might want to spend some thoughts in this aspect.
Use ORM -> NHibernate
https://www.hibernate.org/361.html
I was in a similar situation a couple of months ago. Now my newest project on ASP.Net MVC is almost complete. Here's the set I chose
--ASP.Net MVC + MySQL. No ORM.--
I decided to go with MySQL instead of MS SQL because MySQL is free, and MS SQL is very expensive. If you're making an open source application, you gotta think about that seriously. This is going to be a major problem if you are targeting widespread adoption of your application.
At first I tried to use MySQL through an ORM -- Enterprise Framework (EF). It was the worst decision ever. Enterprise Framework totally killed the performance. It was the pits of the pits. I believe nHibernate is better, but I don't know how much better.
With my own SQL code things are fast enough.
The first iteration of my site will be in public beta this week and then there will be several iterations.
It went rather well so I car recommend the set I chose with ease.

Resources