As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm developing an MVC 3 application, and thought about using ASP.NET's default users, roles and profiles implementation. I created the aspnetdb database and can authenticate users very quickly - no problem.
The problem begins when I want to associate things with users. For instance, I want users to upload images - each image should be associated to the user who uploaded it.
If the aspnet_Users table wasn't in a different database, I would have just added a UserId column to the Images table, set the appropriate foreign key and not worry about it anymore. That's the straightforward way used in Django as well. Unfortunately, SQL Server 2008 doesn't support foreign key constraints between databases.
I can create all the ASP.NET tables in my main database, but I'm not sure of the downside.
This issue is probably encountered by anybody creating an ASP.NET application. What's the best practice?
You should be adding the asp.net membership provider tables to your main database. The only reason I can think that you wouldn't do this is if they are self contained (e.g. you're creating an access control project).
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have many important question about E-Commerce solution database :
For validation your form fields, for example (Null Value can not be inserted , Unique value , just number input, Date validation and etc.)
what's the best way :
a) Use function with T-SQL in my database on the table fields and handle with Try-Catch
b) Use .NET validation component
c) Use Ajax component
d) Use businesses method
If I use Entity Framework, should I use stored procedures or I can use insert, update and delete method from Entity Framework?
Which one is the best way for E-Commerce solution ?
For E-Commerce solution we should 3 or 5 step normalization or create Flat table ?
For E-Commerce solution Linq To Sql or Entity Framework ? which one and why ?
These are very important questions for me
Thanks
I think the right answer is more nuanced. The 'best' way means validating at many places along the way.
You should validate in the form using JavaScript/jQuery. Tell users about required values, improper formats, etc.
Controllers should bind and validate values they receive.
Services should never trust a UI. They also have additional information that a UI can never have: business rules for validity. Those are context-dependent and may change. Let the execution of business rules be done by the middle tier services.
Validating in the database, using constraints like UNIQUE, triggers or stored procedures, should be the last resort and only used if the database is shared by several applications. I wouldn't want to wait until I was persisting data to find out that it was invalid. The earlier you can inform a user, the better.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am trying to get some ideas for storing text in a database. This data will be used on a web page but also will be used to share with other users outside of the web page. There are instances that I would like to use italicization or bold text, break into paragraphs, etc for the web page. I am also going to be allowing others to access the db to pull this information into their own application may be a web page, another database, vb application, etc. What would be the best way to do this and not have a format that may not be supported by the clients program? I read some post where they suggested to store the data as XML and then I could strip it out if I didn't need it. I am not that advanced so seems it may be difficult. I welcome all suggestions....
Avoid storing rendering data in your database - store just the data in its rawest form. Let the user of the data decide how to format it. Perhaps, if formatting is part of the data (ie you're storing "documents") you could store as markup/markdown (good point from #pst).
Another way of looking at it is to store the data without assuming what it's used for. That way, it's easiest to maintain and use for your initial uses, and more in the future.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Are there cases where database designers are not allowed to know the details of the data? I am looking for real-world examples to learn from — please.
I can't help but tell a story about database nightmares. One of the worst was when Amazon was first growing. Initially they only sold books, then expanded to music, and then to many other things.
For a period of about two years, Amazon would announce a new market every two or three months -- children's clothing, housewares, garden supplies, food, and so on. The database folks were tasked with developing and supporting the systems for the product lines. However, Amazon considered the new product announcements to be highly, highly secret.
In particular, the data warehouse people would be kept further from the loop. Sometimes, they would find out about a new line of business by reading news -- and then have to support it in the data warehouse.
So, they had to develop a flexible database to meet unannounced business needs.
In any business environment, there are new needs that arise. I would suggest a book such as Ralph Kimball's "Data Warehouse Toolkit" for more background on how to develop a fairly robust system.
I am currently working at a company that stores very private personal information. I am not allowed access to the production database. For our development and test environments, we replace all names, addresses, and other personal information with randomly generated information.
Yes, I've often seen databases allow for custom data to be defined by the user. The basic approach is to design a meta data system for your database. Then allow entities associations with custom fields. You wouldn't want to do this for all your data, otherwise you'll just end up with a database in a database, but for dynamically adding a number of custom fields this approach works well.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am developing a windows phone 7 app which will need some basic database functionality. I came across the following projects on codeplex. Has anyone tried any of these projects and can help me decide to choose one, please?
http://rapidrepository.codeplex.com/
http://winphone7db.codeplex.com/
Pratik
We use SQLite since you can design the database ahead of time using standard SQL commands. It works pretty well on the phone.
I've written a quick start guide here: http://wirebear.com/blog/2010/11/12/using-sqlite-in-your-wp7-app
UPDATE:
This was a valid solution pre-Mango but it is NOT what I would recommend now and it is not what we are doing. With Mango Microsoft has given new ways to use SQL CE with LINQ to SQL and is the better way to have a database in your app. A good guide to getting started can be found here: http://www.jeffblankenburg.com/2011/11/30/31-days-of-mango-day-30-local-database/
There also are other databases available for the phone (see Local Sql database support for Windows phone 7).
What's best for you will depend on your requirements:
Do you need anything in particular? transactions? relations or objects?
What's most important? reliability, performance, etc.?
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 13 years ago.
Is Google Spreadsheets / Docs a viable database option for real-world applications?
Without knowing what this application does, I'd say no. Simply on the basis that a spreadshet != a database.
no, a spreadsheet and a database are distinct concepts. Spreadsheets do not allow you to query the data. Spreadsheets (especially "hosted" like Google's) will not support real world load.
Depends on your application. As a database, typically not. It can be useful in instances where you need "Excel With Web Features" or as an alternative to a database.
Especially now that Spreadsheets, Presentations and Docs are all basically used under the "Google Docs" moniker, the entire "Google Docs" suite is best used as the sum of its parts.
Two examples:
Web forms. Create a form using the Forms application, and all its entrants are stored in a Google Spreadsheet. Personally I've found this to be a pretty quick and easy way to collect names and contact information online, and its all output into a very easy-to-use and portable format.
Using the spreadsheet to interact with other web content. See this example of displaying and grabbing content from Wikipedia for editing: http://ouseful.wordpress.com/2008/10/14/data-scraping-wikipedia-with-google-spreadsheets/
You might see for MySQL, PostgreSQL, SQLite to use in applications, for example, to archive my books.