Database Services

Data is the foundation of all information systems, and Database Services are the foundation for applications created on the Force.com platform. Force.com Database Services allow you to create objects to store all of your crucial data, letting the enterprise power of the platform handle the sometimes difficult tasks of ensuring that your data is safe and continually available.

Database Services go far beyond simple storage of data. All the functionality of Database Services is available to all applications against the Force.com platform, whether they are built with the declarative application framework, extended with Apex Code and Visualforce Pages, or simply accessing data through the Force.com Web Services API.

General

 Image:Icon video sm.gifPlatform State Of The Union: Core presentation on the Force.com platform from Dreamforce '07.

 Image:Icon video sm.gif Designing for Data - Best Practices for App Builders: Presentation on data design for the Force.com platform from Dreamforce 07.

Whitepaper: The Force.com Platform: The Force.com platform brings all the advantages of the on-demand environment to your own custom applications. Get an introduction to the basics of the platform, including its architecture and main components.

 Image:Icon technote sm.gif Update Collision Detection - This Summer 07 feature automatically prevents a common scenario that can lead to a loss of data integrity.

 Image:Icon technote sm.gif New Features in the Winter '07 release: Overview of new features for Database Services in the Winter '07 release.

 Image:Icon technote sm.gif Database Services Preview: Overview of new features for Database Services in the Summer '07 release.

 Image:Icon technote sm.gif Customforce for Smarties: Although this paper uses some out-of-date terminology, it still provides a good introduction to the basic capabilities of Force.com Database Services and the Application Framework.

 Image:Icon technote sm.gif Reducing the amount of duplicate data: Good advice for optimal data integrity and performance.

 Image:Icon video sm.gifPowering 100 Million Transactions Per Day - Behind the Scenes at Salesforce.com: How do we do it? An in-depth look at the infrastructure behind the world's most popular on-demand platform from Dreamforce '07.

 Image:Icon video sm.gifMeet the Developers: Roundtable session with the creators of the Force.com platform from Dreamforce '07.

Objects

An object is the basic unit of data storage on the Force.com platform, similar to a table in a relationship. The Salesforce CRM application includes standard objects, predefined and implemented by salesforce.com. You also have the ability to create your own custom objects.

 Image:Icon technote sm.gif Introduction to custom objects and tabs: A good place to start to learn about custom objects and how they relate to custom tabs.

 Image:Icon technote sm.gif A Simple Example: This example uses custom objects and fields.

 Image:Icon technote sm.gif Record types : Brief article describes how record types can be used to customize the presentation of custom objects.

Fields

A field is an individual piece of data which is included as part of an object. Standard objects come with a collection of standard fields, and all custom objects have a set of standard fields associated with the object. You can also add custom fields to any standard or custom object.

 Image:Icon technote sm.gif Overview of custom fields: A good place to start to learn about custom fields.

 Image:Icon technote sm.gif Introduction to custom objects and tabs: A good place to start to learn about custom objects and how they relate to custom tabs.

 Image:Icon technote sm.gif A Simple Example: This example uses custom objects and fields.

Relationships

Relationships are connections between objects that provide powerful functionality for protecting data integrity, providing user interfaces and allowing you to connect data from different standard and custom objects.

The Force.com platform supports two basic types of relationships, lookup relationships and master-detail relationships. Both types of relationships

  • are defined from the child object in the relationship.
  • require that the value in the relationship field exist in the parent field, or that the value be null.
  • display the value of the Name field in the parent record in the relationship field.
  • automatically provide a link from the relationship field to the matching parent record, if defined.

The differences between the two types of relationships comes from how the parent and child record are treated. These differences include -

  • If you delete a parent record in a master-detail relationship, all child records are also deleted.
  • The security assigned to the parent in a master-detail relationship controls the security for the detail records for that parent.

Once you define a relationship, the default user interface for the parent record will include a list of related child records, as well as the ability to add, edit and delete those child records.

 Image:Icon technote sm.gif Custom lookup fields: Overview of using lookup fields to establish relationships.

 Image:Icon technote sm.gif More complex examples: Uses relationships to implement project tracking.

Formulas

Force.com Database Services include the ability to define formulas to calculate values from other pieces of data. Formulas can be used to create fields as part of an object or to define evaluation criteria for validation and workflow. Formulas can also be used to calculate data presented in reports.

Formulas can include values from other fields, comparison operators, and a set of functions provided by Force.com. You build formulas with the Formula Editor.

 Image:Icon technote sm.gif Formula fields: Introduction to formula fields.

 Image:Icon video sm.gif Build Smarter Apps Harnessing the Power of Formulas & Workflow: Presentation from Dreamforce '07.

 Image:Icon technote sm.gif Image fields: Overview of the use of image fields, implemented with formula fields.

 Image:Icon technote sm.gif 100 Ways to Use Formula Fields(PDF): Handy examples illustrating the utility of formula fields.

 Image:Icon technote sm.gif Formula and image fields: Video presentation on using formula fields and image fields.

Validation

Your data is only valuable if it is correct. Database Services allow you to impose broad limits on data values through the use of field object types and relationships, but you may want to create more complex validation routines to insure that all incoming data is correct.

You can define one or more validation rules on an object. The rules are expressions or formulas that evaluate to True or False when triggered by an attempt to save a new or modified record. If a validation rule evaluates as True, the data action which triggered the rule is stopped, and an error message, defined as part of the rule, is displayed to the user.

 Image:Icon technote sm.gif Data validation: Overview of data validation for Force.com platform.

SOQL

Salesforce Object Query Language, or SOQL, is the language used to access data resident on the Force.com platform. SOQL can be used in Apex Code or through the Force.com Web Services API.
More information on SOQL and its use.

Security and sharing

You can store all of your data on the Force.com platform and use the security and sharing capabilities of the platform to limit the actions that any individual user can take against a particular piece of data. You can design and implement robust security limitations for your Force.com data, and you can share data with others on a record by record basis.

Force.com provides a robust security and sharing model. You can limit access to the tabs for an object, to the object itself, or to specific fields that make up the object. Basic security is defined through organization-wide security defaults. You can also explicitly share data with users excluded from access by organization-wide rules.

 Image:Icon technote sm.gif Sharing cheatsheet: Brief document on sharing rules for the Force.com platform.