Exactly what the size that you employ for common database fields, like firstName, lastName, Email, password, etc? I see these common fields in many databases of blogs, forums, e-commerces, etc. But I'm not sure if there's some reference or default is bigger for your common fields. So, I wish to understand what the techniqueOrresearchOrfoundation that you to employ for choosing size for common fields.

Partially, it is dependent in your DBMS. Some, like MySQL 5, worry about the size of a VARCHAR(n) column instead of an limitless-length TEXT column others, like PostgreSQL, consider TEXT and VARCHAR(n) as internally identical, other than an overall length is checked on VARCHAR(n) posts. Writing something similar to VARCHAR(65536) in PostgreSQL is silly if you would like an limitless-length column, choose TEXT and that would be that.

Obviously, sometimes attempting to store too lengthy of the value will break your layout, or allow anyone to abuse the machine by selecting a lengthy title without any spaces (for instance). Usually things i do for username fields like that's just choose a maximum length so that anybody who desires an extended username is attempting to result in trouble 64 figures is a fairly round value and appears to be effective. Legitimate names and addresses (which are not frequently displayed to customers just like a username is), you will want to opt for something longer. You'll need a value big enough that it may accept any valid input, although not so large that somebody could stuff a gigabyte-lengthy string within the area simply to attack the body. 1024 figures is fairly reasonable: 1k is definitely an sufficiently small quantity of text to simply use, a round number, and bigger than any sane address line or title.

Emails can, per the connected RFC whose number I'm too lazy to find information about at this time, be no more than 320 figures. So there's your email area length. Works out that SMTP limits the size of fields to 256 figures since emails should be bracketed, a long valid current email address is really 254 figures. (This page adopts more detail.) So there's your email area length.

Passwords should NEVER be saved in plaintext, so that your password area ought to be a byte array or BLOB type exactly lengthy enough to keep the creation of the hash function you're using (or biggest component of the cryptographic group being used, for additional advanced schemes like SRP-6a).

i love 16, 32, 64, 128, or 256

What I am inclined to do is think about how lengthy a field's value may be, then double that safe.

E.g. Title: varchar(70) Email: varchar(200)

Double your estimations. After which redouble these to accomodate unicode.

Databases that have varchars (just about all do) get in a really small penalty for fields which are made to hold longer values but don't. You should use that to your benefit.

Attempt to think this in reverse: I have used existing data to obtain reasonable area measures. Presuming you can get a great-sized database full of real data, a fast query like:

SELECT MAX(LEN(lastname)) FROM dbo.MyDatabase

provides you with all you need.

UPDATE: Avoid using the quantity you get exactly. Clearly, pad up just a little based on your uncertainty, unless of course you've got a large sample set.