Base Views and Full Text Indexing

Base View Generation

MemberJunction utilizes the concept of base views, which are SQL views that wrap underlying tables. Each entity in MemberJunction must have an associated base view, which can either be generated automatically by the CodeGen tool or customized manually. The primary purposes of these base views are:

  • Security and Data Access Control: Base views serve as an additional layer of security, enabling control over data accessibility. They allow for the exposure of only certain attributes from the underlying table, enhancing data security.
  • Abstraction and Data Aggregation: They provide an abstraction layer, separating the logic of data construction from applications. For example, a base view for a ‘Person’ entity might include not just direct attributes from the ‘Person’ table but also joined data from related tables, like a company name from an ‘Organization’ table.

Customizing Base Views

While the CodeGen tool can generate base views automatically, MemberJunction allows for customization to cater to more complex requirements. Custom base views are defined in SQL scripts, and in the entity metadata, the ‘base view generated’ field is set to zero to stop automatic generation. This approach gives developers and DBAs the flexibility to craft views that suit specific application needs, enabling them to embed custom logic and tailored data representation.

Stored Procedures for Data Modifications

As mentioned earlier, MemberJunction enforces the usage of stored procedures for modifying data (inserts, updates, deletes) to maintain security and performance efficiency. This approach restricts direct write access to the underlying tables, thereby limiting potential risks and ensuring that data modifications are executed in a controlled and optimized manner.

Full Text Indexing Capabilities

📘

Full text indexing is a feature supported in MemberJunction for enhancing search capabilities within the application.

Using SQL Server’s full text catalog and indexing functionality, MemberJunction allows for efficient and comprehensive text searches across entities:

  • Automatic Index Management: By default, the CodeGen tool manages the creation and maintenance of full text catalogs and indexes, simplifying the implementation of full text search.
  • Custom DBA Control: Alternatively, DBAs can choose to manually maintain these indexes for finer control over full text search capabilities.

Integration of Views and Full Text Search in the Application

MemberJunction’s use of views and full text search is deeply integrated into its architecture, allowing for sophisticated data querying and manipulation. This integration manifests in several ways, such as through smart filters in the API, user interface interactions, and the underlying data handling logic. Full Text indexes are automatically used by the RunView object which is described in the Provider Architecture section of this site.