OBLYTECH Logo
OBLYTECH Logo
ServiceNow App Engine Optimisation
Home / Guides, Services and Solutions / Services / ServiceNow App Engine Optimisation

ServiceNow App Engine Optimisation

What an App Engine Optimisation Engagement Covers

An optimisation engagement starts from applications that already run on App Engine and asks why they are slow, hard to change or inconsistent, then fixes the causes rather than the symptoms. This page covers the starting problems and discovery, the optimisation approach and typical improvements, common performance issues, development process and quality improvements, and the deliverables and success criteria. The later sections insist on measuring before changing anything, match symptoms to likely causes, set a profiling sequence that stays in order, and describe where optimisation efforts usually go wrong.

Typical Starting Problems and Discovery

Many organizations experience performance issues with App Engine applications. Forms load slowly, reports take minutes to generate and user experience degrades as the application base grows. Performance problems often stem from inefficient queries, missing database indexes or excessive data processing in the client-side logic.

Some organizations have applications built using inconsistent patterns or outdated coding practices. As the application portfolio grows, this inconsistency makes maintenance difficult. New developers struggle to understand existing code because different applications follow different conventions.

Other organizations have App Engine applications that lack proper testing or documentation. As requirements change, teams struggle to modify applications without breaking existing functionality. Technical debt accumulates as changes are made to fix issues without refactoring underlying architecture.

Discovery during optimization includes assessing application performance, reviewing application code and architecture for issues, identifying gaps in documentation and testing and understanding developer expertise and development processes.

Optimization Approach and Typical Improvements

Performance optimization typically involves profiling applications to identify slow operations, then addressing the root causes. Database query optimization (ensuring queries use indexes, filtering appropriately and returning only necessary data) often yields significant improvements. Caching frequently-accessed data prevents repeated expensive computations. Refactoring inefficient client-side logic simplifies processing and reduces page load time.

Code quality improvements include establishing coding standards and patterns that all developers follow, refactoring legacy code to use modern App Engine features and implementing automated testing so changes can be made confidently without fear of breaking functionality.

Architecture improvements might include restructuring applications to better separate concerns (data access, business logic, presentation) and establishing reusable components so common functionality is not reimplemented across multiple applications.

Documentation and knowledge transfer ensure that application design decisions are documented and new developers can onboard efficiently without depending on tribal knowledge from the original developers.

Common App Engine Performance Issues

N+1 query problems occur when code fetches one record, then for each record fetches related records individually. Fetching 100 orders and then querying for each order’s customer generates 101 queries instead of one efficient join. Optimization involves restructuring queries to fetch all necessary data in fewer operations.

Missing database indexes cause table scans where the system examines every record to find matches. Adding appropriate indexes on fields used in where clauses can reduce query time from seconds to milliseconds. Index analysis is one of the quickest optimization wins.

Excessive data retrieval happens when queries fetch all fields of all matching records when only a few fields are needed. Restricting queries to return only necessary fields reduces data transfer and memory usage.

Client-side processing of large datasets can overwhelm user browsers. Fetching thousands of records and processing them in JavaScript is slow. Server-side processing and limiting results returned to the client improves performance substantially.

Development Process and Quality Improvements

Establishing development standards helps teams collaborate effectively. Standards might include naming conventions, module structure, error handling patterns and testing requirements. New developers can onboard faster if they understand these standards.

Automated testing (unit tests, integration tests) provides confidence that changes do not break existing functionality. Teams can refactor and optimize code knowing that tests will catch regressions.

Code review processes catch issues before code reaches production. Peers reviewing each other’s work spot performance problems, code quality issues and violations of standards.

Deliverables and Success Criteria

An App Engine optimization engagement typically delivers: a performance assessment report identifying slow operations and their causes; optimized applications with improved performance; documentation of architecture and design decisions; development standards and best practices guide; and training for development teams on optimization techniques and development standards.

Success is measured by improved application performance (page load time, report generation time, data processing speed) and developer efficiency (time to add features, time to onboard new developers, reduction in production incidents due to code defects). Organizations typically see clear gains in application performance after optimization engagements..

Measuring before changing anything in a slow application

This section is for the application owner who has heard that a form is slow, that a report times out at month end, or that a list view no longer loads for certain users, and who now has to decide where the effort should go. The temptation is to start editing code the moment a complaint arrives. The better first move is to record how the slowness appears, for whom and at what times, because the same symptom can come from very different causes that require different fixes.

A baseline needs three numbers that the owner can reproduce: the time taken for the slow action, the volume of records it touched, and the user population it affected. Without a baseline, an optimization cannot be shown to have worked, and the next complaint simply reopens the debate. Performance monitoring within the platform, where it is enabled, is the usual source for those figures. The KPIs and metrics for App Engine describe which measures are worth keeping over time.

Matching symptoms to likely causes

Symptom reported First check Likely cause Change to try first
A list view slows as the table grows Query shape and filter fields Filter on a field that is not indexed Review the index on the filtered field before rewriting code
A page takes seconds to draw for each record in a loop Count of queries per request One query per record instead of one query for the set Fetch related data in a single pass
A report exports slowly Number of fields returned Every column requested when only a few are used Restrict the query to the fields the report needs
The browser freezes on a large screen Records sent to the client Processing thousands of rows in the browser Move the processing server side and cap results
Slowness only for one site or one network Timing by location Network or device, not the application Escalate to platform or infrastructure before editing code

The last row matters because it prevents wasted work. An application can be well built and still feel slow for a group of users whose connection or device is the limit. Confirming that the delay sits inside the platform’s own processing is the step that justifies code changes at all.

A profiling sequence that stays in order

  1. Reproduce the slow action in a test copy with a data set of similar size, and record the time it takes.
  2. Identify every query, script and transform the action triggers, using the platform’s logging for that action where it is available.
  3. Count the queries per request and note any that repeat with different identifiers, since those usually signal a loop of single lookups.
  4. Check the indexes and filter fields on the tables involved, and confirm whether the slow queries use them.
  5. Change one thing at a time, re-measure against the baseline, and record the result before making the next change.
  6. Repeat the measurement in production after release, at the time of day the complaint was first raised.

Where optimization efforts usually go wrong

The most common error is adding indexes to every field that appears in a filter. Each index speeds some reads but slows writes and consumes storage, and an application that writes heavily can become slower overall. Indexes should follow the measured queries, not the list of fields people would like to filter on. The second error is caching data that changes often, so that users see stale values and the team spends weeks chasing what looks like a logic defect. Caching should be limited to reference data that changes rarely, with a clear rule for when it refreshes.

The third error is treating optimization as a one-time event. Applications keep growing, and a query that was fast with a thousand records can be slow with a million. Teams that handle this well put one or two performance measures into the regular review of the application, so that drift is noticed while it is still small. Where the work also touches how the application is tested, the governance of automated tests is the place to protect the gains against regression.

Questions owners ask about application performance

Is adding an index always the right answer?

No. An index is the right answer when a measured query filters on a field with good selectivity and the table is read far more often than it is written. When the table is written constantly, a query rewrite or a different filter can be a safer first move.

How do we know an optimization actually worked?

Compare the same action, with the same data volume and user group, before and after the change. A single good result on a quiet afternoon proves little. Two or three repeated measurements over a normal week provide a fair comparison.

When should a slow application be left alone?

When it runs once a month, the people waiting for it are few, and the cost of the work exceeds the cost of the delay. Recording that decision avoids the same complaint being reopened every quarter without new information.

Can caching introduce errors of its own?

Yes. A cached value that outlives a change to its source will be wrong until the cache refreshes, and users will not know why. Any cache needs a documented owner, a refresh rule and a way to clear it manually when the source changes.

Next step for an optimization review

A baseline is the only thing that makes the next optimization decision defensible.

Frequently asked questions

How do we identify which applications are best candidates for optimization?

Prioritize based on user impact: applications that are slow and used frequently should be optimized first. Applications that are critical to business operations or that are causing user complaints should also be high priority. Avoid optimizing rarely-used applications unless they are blocking business initiatives. Use performance metrics and usage data to make prioritization decisions.

Should we optimize applications incrementally or rewrite them completely?

Incremental optimization is usually preferred because it delivers value faster and reduces risk of introducing new bugs. Optimize the slowest operations first and measure improvements. If incremental optimization reaches diminishing returns, then consider a larger refactoring. Complete rewrites are risky and should be reserved for cases where the application is fundamentally broken or uses obsolete architecture.

How do we balance optimization with adding new features?

Establish a practice of continuous optimization: dedicate a portion of development capacity (a range) to refactoring, code quality and performance improvements alongside feature development. This prevents technical debt from accumulating and keeps applications performant as the codebase grows. Avoid the scenario where all effort goes to new features and technical quality degrades.

Talk to Oblytech

Planning, running or fixing a ServiceNow programme? Tell us where you are and we will suggest a sensible next step.

Contact us