Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC - Alternatives to databases [closed]

I thought about splitting this up, but i think it's better as one big question. Here it goes. :-)

Warning: this question is in-depth. :-)

I've been working with ASP.NET for a little while now. Just a few days ago, after watching a course on MVC at Pluralsight, i decided to try it out. Development was amazing and very easy, especially with the Entity Framework 4.1. As i searched around for deployment options, i found AppHarbor. Unfortunately, i ran into some problems. See, i can't just magically port my databases over with the git commit AppHarbor requires. The problem is, I've never really worked with databases - they've always just worked automagically. I'm scared stiff of connection strings and the like. I managed to get a database set up on AppHarbor for the ASP.NET Membership stuff (I still need to figure out how to copy over the data and schemas, but i'll figure that out :-)) but i'm clueless on what to do about the Entity Framework SQL Server Compact database, which i'm using to store blog posts and comments. Problems:

  1. It's not working - MVC/EntityFramwork/Whatever-Is-Automagically-Working-Behind-The-Scenes isn't firing up a new database or whatever
  2. AppHarbor only allows 1 database (for the free version)

Potential Solutions?

  1. Combine the databases. I have no idea how to do this or how i would keep the EntityFramework's Auto-Magic working.
  2. Adopt a non-database solution for the posts/comments. I realize databases are incredibly more efficient as there's a sort of interface between the literal file and the programs accesing it, so you don't have file locking and stuff. So what would be the best alternative?

My Question

What's the best way to handle this situation? Not just this particular situation, but the general situation of "crap-i-hate-databases"?

Ways to answer:

  1. Recommending that i learn about databases: fine, but please provide some good resources.
  2. Giving a non-database alternative: awesome.
  3. Explaining what i need to do to get this all working on AppHarbor (but more generally any deploy server): ideal. I may even set up a bounty just to award it

Thanks so much in advance; I realize this is a deepish question and the rep garnered may not be worth it. Please let me know if i need to provide any more information.

like image 711
Thomas Shields Avatar asked Jun 08 '11 20:06

Thomas Shields


People also ask

How fetch data from database and display in table in ASP NET MVC?

From the Add New Item window, select ADO.NET Entity Data Model and set its Name as NorthwindModel and then click Add. Then the Entity Data Model Wizard will open up where you need to select EF Designer database option. Now the wizard will ask you to connect and configure the Connection String to the database.

How does MVC connect to database?

Let's add one record from the browser by clicking the 'Create New' link. It will display the Create view. Let's add some data in the following field. Click on the Create button and it will update the Index view as well add this new record to the database.

Is it OK to use entities for view models in ASP NET MVC?

In ASP.NET MVC, ViewModels are used to shape multiple entities from one or more models into a single object. This conversion into single object provides us better optimization.


2 Answers

I am going against the grain and suggest you do not use EF and generate a whole bunch of scaffolding code using MVC3. Simplify your app and really learn what is going on. That way you will be able to debug and add features.

Try taking your existing database and building an MVC3 app with Massive. Really simple and confrontable.You will get over your database phobia when you see how easy it is.

like image 96
Andrew Cowenhoven Avatar answered Sep 28 '22 05:09

Andrew Cowenhoven


You may consider checking out a document database like Raven DB.

like image 21
ataddeini Avatar answered Sep 28 '22 03:09

ataddeini