Most towns in silicon valley have updated their building codes to allow for a granny unit, but the addition has to comply with ALL the set back, and code requirements. You should also contact the Utility company to see if they might need to upgrade your Meter depending on the use you anticipate from the new unit.
If the unit is fully permitted you can actually request a NEW address for it and rent it for much higher value specially if it's in a great school district.
You will need to go to the Building and Planning department for the City where you plan to build. They have guidelines which will include, size, set backs, heights, etc. In order for it to be counted at livable space please get a building permit, and make sure that it is finalized at the end of the project.
This will give you a good idea of what is typically required for an accessory building or a second dwelling unit. Especially if you plan on renting it out be sure it has been built with the proper permits.
In San Diego what you're descibing is an Accessory Dwelling Unit (ADU). By definition you need to have a bathroom but not always a kitchen. A lot depends on the square footage. Not sure what your local jurisdictions require.