Data Modeling / Database Design Flashcards

1
Q

Converting Relationships

A
  • You can convert a master-detail relationship to a lookup relationship as long as no roll-up summary fields exist on the master object.
  • Converting a master-detail relationship to a lookup for a custom object on the “detail” side, changes the organisation-wide default for the object to public read/write.
  • You can convert a lookup relationship to a master-detail relationship if the lookup field in all the records contains a value.
  • A lookup relationship can’t be changed to a master-detail relationship if the organisation-wide default of the child object access level in the relationship is Controlled by Parent.
  • Converting a lookup to a master-detail-relationship changes the organisation-wide default to Controlled by Parent and the sharing model is updated to public read/write.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Realtionships and Reports

A
  • Lookup relationships allow data from the two related objects to be joined in one report.
  • Master-detail relationships allow data from three objects to be joined in one report: the master object, the detail object, plus one other lookup object. If the detail object has multiple lookup relationships, a separate report type is available based on each lookup.
  • Many-to-many relationships provide two standard report types that join the master objects and the junction object. The report types are:
    • “Primary master with junction object and secondary master” in the primary master object’s report category.
    • “Secondary master with junction object and primary master” in the secondary master object’s report category.
    • The order of the master objects in the report type is important. The master object listed first determines the scope of records that can be displayed in the report.

IMPORTANT Converting a relationship from lookup to master-detail or vice versa can cause existing custom reports to become unusable due to the different standard report types available for each type of relationship. We recommend that you test your custom reports immediately after converting the relationship type. If you revert your relationship back to the original type, the reports are restored and become usable again

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Audit Fields

A

Enable ‘Create Audit Fields’

  1. From Setup, enter User in Quick Find box and select User Interface.
  2. Select the checkbox for Enable “Set Audit Fields upon Record Creation” and “Update Records with Inactive Owners” User Permissions.
  3. Click Save.

After enabling these organization wide permissions:
Grant the following profile permissions to your Users with custom profiles (see notes below for standard profiles):

  • Set Audit Fields upon Record Creation - Allow the User to set audit fields (like ‘Created By’ or ‘Last Modified By’) when you create a record via API importing tools like Data Loader.
  • Update Records with Inactive Owners - Allow the User to update record owner and sharing-based records with inactive owners.
  • *Notes**:
  • *Standard profiles** cannot be granted these permissions. Instead, use a permission set as described in Enable ‘Create Audit Fields’ permission for standard profiles.

Optional: create and configure a permission set

  1. From Setup, follow the steps outlined in Create Permission Sets.
  2. While creating the permission set, grant either the “Set Audit Fields upon Record Creation” or “Update Records with Inactive Owners” permissions under “System Permissions.”
  3. Click Save.
  4. Follow the steps in Assign a Permission Set to Multiple Users.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Price book

A

A price book is a list of products and their prices.

  • The standard price book is the master list of all your products and their default standard prices. Salesforce creates the standard price book when you start creating product records. It includes all your products and their standard prices regardless of any custom price books that include those products.
  • A custom price book is a separate list of products with custom prices, called list prices. Custom price books are ideal for offering products at different prices to different market segments, regions, or other subsets of your customers. Create a separate price book for each set of customers that you want to address. For example, if you have one set of prices for domestic customers and another for international customers, create a domestic price book and an international one.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Changing price book in an opportunity

A

If you change the price book for an opportunity that has products, all products are deleted from the Products related list, but the value in the opportunity’s Amount field remains.

You can use the Salesforce mobile app to relate a price book with an opportunity that doesn’t already have one.

To change an opportunity’s price book, use the desktop Salesforce site.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Deleting a price book entry

A
  • You can delete products from custom price books without affecting the original product listing or its entries in other price books.
  • When you delete a product from the standard price book, the product is still available and active, but its standard price is deleted and removed from all custom price books.
  • If you delete the product from the standard price book, and it’s still associated with any custom price books, click OK to remove it from all custom price books.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Deleting Price Books

A
  • Deleting, deactivating, or archiving a custom price book doesn’t affect other price books or your product lists. However, these actions can affect your opportunities and quotes. Changing associations with opportunities or quotes is sometimes required before you can remove an associated price book.
  • You can deactivate the standard price book, but you can’t delete or archive it.

You can’t recover or delete an archived price book.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Regenerate a File Preview

A

If a file preview is of poor quality, you can try to regenerate the preview. Available for Salesforce Files and CRM content documents that can be previewed.

When you regenerate a preview, the new preview request is added to a queue and the existing preview is deleted. During this time, users won’t see a file preview.

File previews aren’t available for files larger than 25 MB, unknown file types, password-protected files, and copy-protected PDFs. For files that you can’t preview, the Preview option isn’t available on feeds or list views, and files appear as generic file type icons in the feed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Mapping Set

A

A mapping set is a group of related objects that need to be mapped between the data source and the Cloud Information Model.

It aligns and transforms the data across the connected orgs.

Used in Customer 360 Data Manager

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Geolocation fields

A

A geolocation field counts toward the org’s limits as three custom fields.

Only the individual field components of a geolocation field can be modified or exported.

Although longitude values can be within -180 and 180, latitude values must be within -90 and 90.

Also, the DISTANCE formula is used to calculate the distance between two locations in miles or kilometers.

The GEOLOCATION formula returns a geolocation based on the provided latitude and longitude and must be used with the DISTANCE function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Self Relationship

A

A self-relationship can be defined using a lookup relationship field to relate an object to itself.

For example, the Flight object can be related to itself.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Audit Fields

A

The ‘Enable Set Audit Fields upon Record Creation’ user permission allows a user to set audit fields, such as Created By, Last Modified By, and Created Date.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

VS Code

A

Salesforce Extensions for Visual Code and Metadata API can be used to retrieve, deploy, create, update or delete customization information.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Mapping set

A

A mapping set is a group of related objects that includes a source schema and a target schema.

Mapping sets can be created between objects and fields within the source schema and the Cloud Information Model.

Mapping sets can be edited by adding other objects and fields.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Mapping Version

A

A mapping version needs to be activated when data from one source needs to be used in another data source

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Person Accounts

A

Account news is available only for business accounts - NOT person accounts

If person accounts are enabled, the organization-wide default sharing must be set in one of the following ways. Contacts are set to Controlled by Parent, or accounts and contacts are both set to Private.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Managing Ownership Skew

A

If you do have a compelling reason for assigning ownership to a small number of users, you can minimize possible performance impacts by not assigning the user(s) to a role.

If the user(s) must have a role to share data, we recommend that you:

  • Place them in a separate role at the top of the hierarchy
  • Not move them out of that top-level role
  • Keep them out of public groups that could be used as the source for sharing rules
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Tuning Group Membership for Performance

A
  • Identify user and group updates that are complex, such as user role and portal account ownership changes, or updates that involve a large amount of associated data. Allow for additional time to process these changes.
  • When making changes to the hierarchy, process changes to the bottom (leaf) nodes first, then move upward to avoid duplicate processing.
  • Limit the number of records of an object owned by a single user to 10,000.
  • Tune your updates for maximum throughput by experimenting with batch sizes and using the bulk API, where possible.
  • Remove redundant paths of access, such as sharing rules that provide access to people who already have it through the hierarchy.
  • Schedule large group membership operations during off-peak hours.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Record Level Locking

A

When updating child records in Salesforce, the system locks the parent and the child records to prevent inconsistencies

When objects being processed have a parent-child relationship, two situations in particular pose a risk of producing locking errors.

  1. Updates to parent records and their children are being processed simultaneously in separate threads.
  2. Updates to child records that have the same parent records are being processed simultaneously in separate threads.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Parallel Sharing Rule Recalculation

A

When this feature is turned on, sharing rules are processed asynchronously and split into multiple simultaneous execution threads based on load. The processing is also more resilient; during a server restart, the jobs will be reinstated on the queue, and the process will continue when the server comes back online.

NEED TO CONTACT SALESFORCE TO ENABLE THIS FEATURE

21
Q

Picklist Limits

A

custom picklist field can have up to 1000 values,

22
Q

When to use Standard order vs custom object

A

refrer: https://www.notion.so/Scenario-Solution-2-7d85523a56e74e5aa1dca43fce2686ec#f9ef7cbe16a34b2aa094e51d2eb45d65

23
Q

Data taxonomy

A

A data taxonomy can be defined to classify products into categories and subcategories and introduce terminologies and semantics

24
Q

Data Lineage

A

Defining a data lineage includes specifying the data origin, how data are affected, and how the records move within the lifecycle.

25
Q

Data Classification

A

Data classification can be used to identify unstructured metadata and categorize them based on security controls and risk levels.

26
Q

Data Dictionary

A

Entity Relationship Diagrams and Metadata API can be used to build a data dictionary prior to an implementation.

27
Q

How do you define data architecture?

A

Metadata Types such as CustomField and RecordType can be utilized to define the data architecture of a Salesforce org.

28
Q

Data classification fields in Salesforce

A
  • Data Owner, Field usage, Data sensitivity Level and Complaince categorisation
  • Available in both standard and custom objects
29
Q

Big Objects

A
  • Big objects are typically used for storing large volumes of data, such as hundreds of millions or even billions of records.
  • They can be used to retain records in Salesforce for compliance or auditing purposes.
  • However, special considerations are required for creating, populating and accessing big object records. They do not support all the field types, unlike sObjects.
  • An index is created when creating a new big object, which is used to query the records.
    • Although records of a big object can be queried using SOQL, not all operations are supported.
    • Async SOQL can be used to query the records in the background.
  • Encryption is not supported in Big Objects
  • it is also possible to export Big Objects to Tableau CRM for deeper data insight.
30
Q

Big Object use cases

A
  • A big object is useful when hundreds of millions or even billions of records need to be stored for long term for the purpose of auditing, complianceand/or historical analysis
  • Large record volumes slow down reporting and queries when using Salesforce sObjects. Big object records can be queried without impact on performance. This is achieved via SOQLand Async SOQL.
  • FieldHistoryArchive is a standard big object which is used to retain field history beyond the standard Salesforce retention period
  • A large number of records can be retained for auditing or compliance. Records that do not require access can be archived monthly or annually.
  • Custom big objects can be used to form a 360-degree view of the customer, using multiple data sources, such as loyalty programs and billing data
  • A big object can be usedwhen the number ofrecords in an sObject isclose to 1 million or thereare performance issueswhile running reports orqueries.
31
Q

Big Object Index

A

An index is created when creating a new big object, which is used to query the records.

A big object is created with ‘In Development’ status and updated to ‘Deployed’ status once index is defined.

Index must be carefully designed as it can’t be edited or deleted

They can only use index fields in a query filter, in the defined order.

there should be no gaps between the first and last field in the index.

An Index can only consist of custom fields that have been marked as required.

After you’ve created the index, you can’t edit or delete it. To change the index, you must start over with a new big object.

32
Q

Querying Big Objects

A

The design of a big object’s index should be carefully considered. It cannot be changed later, so all future data use cases should be considered.

Async SOQL is useful for querying big objects. But it is only available with the licensing of additional big object capacity. Query results can be inserted into an sObject.
A limited subset of SOQL commands is available for big objects, but there are certain limitations. For example, there should be no gaps between the first and last field in the index.

Certain SOQL operations are not available. The !=,LIKE, NOT IN,EXCLUDES,and INCLUDES operatorsare not available.

33
Q

Considerations for Using Big Objects

A
  • Transactions that include big objects, standard objects, and custom objects are not supported
  • Metadata API or Setup can be used to define a custom big object and add custom fields to it. Dataloader, API or Apex can populate big objects
  • Creating a big object requires careful planning, especially when moving records. Some fields cannot be mapped directly.
  • Salesforce Connect and external objects cannot be used to access big objects in another org
34
Q

Delete a Big Object

A

When you delete a custom big object, Salesforce doesn’t add it to the Recycle Bin.

Instead, deleted big objects appear in the Deleted Objects list for 15 days. During this time, the big object and its data are soft deleted, meaning you can restore or permanently erase (flag for hard delete) the big object and its data. After 15 days, the big object and its data are automatically flagged for hard delete.

Salesforce runs a background job to completely remove big objects that have been flagged for hard-delete from your org. The job doesn’t run immediately, but you can’t access these large objects because they no longer appear in the Deleted Objects list.

Soft-deleted big objects and their data always count against your org’s limits. Big objects that are flagged for hard delete, but the background job hasn’t yet removed, also count. After the background job removes these big objects, they no longer count against your org’s limit.

35
Q

Data Skew

A

Data skew occurs when too many records are related to a parent record or owner in Salesforce.

There are three types of data skew, namely, account data skew, lookup skew, and ownership skew.

It can cause issues such as lock exceptions and long-running sharing calculations.

However, there are approaches and techniques to reduce or avoid them.

36
Q

Handling Data Skew

A

Account data skew can be avoided by making sure that more than 10,000 child records are not related to any single account record.

There are also techniques for identifying and mitigating the problems associated with lookup skew.

Moreover, performance issues due to ownership skew can be minimized by using strategies like not assigning a role to the skewed user.

37
Q

Ownership Skew

A

Ownership skew is an imbalance that occurs when a large number of records of a particular object are owned by a single user in Salesforce who also exists in the role hierarchy.

When a single user owns more than 10,000 records of an object,

  • they should not be assigned to a role, or
  • they should be placed in a separate role at the top of the role hierarchy.
38
Q

Account Data Skew

A

Account Data Skew occurs when too many child records are related to the same parent account record.

For example, it occurs when more than 10,000 contactsare associated with the same account

A Public Read/Write sharing model can be enabled to improve sharing performance.

39
Q

Lookup Skew

A

Lookup Skew occurs when too many child records are related to the same record in the lookup field. For example, when 10,000 records of a custom object look up to the same record of another object, it causes lookup skew.

Use the following strategies to mitigate locking issues related to lookup skew.

40
Q

Implicit sharing

A

The built-in implicit sharing feature provides record accessibility, and its parent implicit sharing provides read access to an account for users who have access to standard child objects, such as Contacts, Cases, and Opportunities. So when salespeople create a Contact, sharing calculations determine during the save operation if a parent implicit share to the Account should be created.

41
Q

The Impact of Account Data Skew

A

To understand the impact of account data skew, consider the following scenario.

User Jane has access to contact Bob Smith and has a parent share to the single generic account. Her manager changes ownership of the contact Bob Smith to another salesperson and clicks Save.

The sharing calculations now run for a longer period of time because they have to determine whether to delete the parent implicit share. The calculations check if Jane has access to the remaining 299,999 contacts under the single generic account.

If another salesperson tries to add a new contact for the same account while the sharing calculations are occurring, that request will wait for Force.com to release the lock on the account, resulting in lock contention and reduced database concurrency. Because this is a synchronous request, this request starts counting against the concurrent Apex request limit if the wait exceeds 5 seconds. If the wait exceeds 10 seconds, the salesperson will get an “UNABLE_TO_LOCK_ROW” error.

41
Q

The Impact of Account Data Skew

A

To understand the impact of account data skew, consider the following scenario.

User Jane has access to contact Bob Smith and has a parent share to the single generic account. Her manager changes ownership of the contact Bob Smith to another salesperson and clicks Save.

The sharing calculations now run for a longer period of time because they have to determine whether to delete the parent implicit share. The calculations check if Jane has access to the remaining 299,999 contacts under the single generic account.

If another salesperson tries to add a new contact for the same account while the sharing calculations are occurring, that request will wait for Force.com to release the lock on the account, resulting in lock contention and reduced database concurrency. Because this is a synchronous request, this request starts counting against the concurrent Apex request limit if the wait exceeds 5 seconds. If the wait exceeds 10 seconds, the salesperson will get an “UNABLE_TO_LOCK_ROW” error.

42
Q

When there is ownership skew, which role should be occupied by a skewed owner in the role hierarchy?

A

Highest role that is separate from the other roles

43
Q

Which sharing model can be considered to avoid account data skew?

A

Public Read/Write

44
Q

Which sharing model can be considered to avoid account data skew?

A

Public Read/Write

45
Q

What can be done to reducwe the record saving time in order to mitigate the problems rleated to lookup skew?

A

Increase the performance of synchronous Apex code, remove unnecessary workflows, and use asynchronous processing.

46
Q

Querying options for Big Objects

A

Subset of SOQ: commands and async SOQL

47
Q

Big objects use cases

A

Big objects can be used to

  • store very large volumes of records,
  • archive records,
  • retain field history,
  • create a 360-degree customer view, and
  • retain records for auditing or compliance.
48
Q

In Customer 360 Data Manager, what can be created to map the objects and fields between the source schema and the Cloud Information Model?

A

Mapping Set