Symbol Extraction

Split your codebase at build or deploy time — gain the development speed of monolithic code with the deployment flexibility of microservices.

What is Symbol Extraction?

Symbol Extraction in NanoAPI refers to the process of identifying and isolating specific symbols—such as classes and functions—from your codebase to create smaller units of functionality such as microservices or serverless functions. This approach enables the decomposition of a monolithic application into smaller, more manageable services that can be deployed and scaled independently.

Real-World Example

Consider a Node.js Express server with multiple endpoints. By utilizing NanoAPI's Symbol Extraction feature, each endpoint can be transformed into a standalone service, encapsulating its respective functionality. This modularization enhances scalability and maintainability, and can assist in large lift-and-shift operations.

What are Symbols?

Symbols are how our tool recognizes definitions within any programming language. The following items within a programming language fall within this definition:

Imports/Exports

Any imports into a file, or exports out of a file, are read by our system to define file-level dependencies within or across your system.

Namespaces

Similar to imports/exports, namespaces are considered by our system to fully map out relationships within a codebase — allowing for classes and functions with the same name to be considered separately.

Functions

Any function definition within the relevant programming language is also understood by our system, as well as a graph of all the dependencies required to run that function.

Classes

Any class not defined by external dependencies (language libs, frameworks) is also ingested into the manifest, much in the same way as functions.

Flexible Architecture

The extraction happens via the UI or the CLI with the purpose of allowing developers to split their codebase apart at build or deploy time. This gives you the development speed of monolithic code and the deployment flexibility of microservices.

Incremental Modernization

Allows companies to test and deploy microservices incrementally without committing to a full rewrite upfront. This capability minimizes operational disruptions and downtime while enabling iterative modernization.

Architecture Flexibility

Supports both monolithic and microservices architectures, making it suitable for companies at all stages of their growth. Adapt your architecture as your needs evolve without painful rewrites.

How Symbol Extraction Works

1. Analyze Your Codebase

NanoAPI scans your entire codebase to identify symbols (functions, classes, modules) and their dependencies. This creates a complete map of your system's architecture.

2. Select Symbols to Extract

Using the UI or CLI, you select which symbols you want to extract into separate services. NanoAPI helps identify good candidates based on dependency analysis.

3. Generate Service Boundaries

NanoAPI automatically determines the optimal service boundaries, ensuring that each extracted service is cohesive and minimally coupled to the rest of the system.

4. Deploy Independently

The extracted services can be deployed independently, allowing you to gradually transition to a microservices architecture while maintaining the development simplicity of a monolith.