Skip to content

Dev-Laskowski/Apex-JSON-Engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Apex-JSON-Engine

Resilient I/O Architecture for JSON & JSON5

The Strategic Standard for Secure & Resource-Efficient Data Ingestion.

Apex is a proprietary, NIO-optimized engine engineered for high-availability systems where Security and Predictability are paramount. By integrating Structural Forensic Analysis and a Zero-Memory Security Shield, Apex neutralizes "Poison JSON" attacks and resource exhaustion at the threshold—long before they can destabilize your backend.

While industry standards collapse under resource starvation, Apex thrives, providing a Memory-Aware foundation that transforms raw I/O into a competitive advantage. (Advanced Exascale ApexIO and Sentinel Shield technology available in Professional & Enterprise Editions).


Architectural Innovations & Core Features

Apex transcends standard JSON limitations by offering a high-flexibility, resource-aware environment designed for complex data ecosystems:

Structural Intelligence: Smart Type Mapping

Apex actively optimizes your Heap utilization during ingestion. The engine automatically evaluates and maps data to the most efficient memory container:

  • Integer Optimization: byte → short → int → long.
  • Precision Scaling: float → double → BigDecimal.
  • Adaptive Text: Internal char vs. String optimization.
  • The Result: Significant reduction in memory fragmentation and object overhead.

Extended Numeric & Scientific Support

Engineered for Financial (FinTech) and Scientific (Research) sectors:

  • Full Sign Flexibility: Supports leading signs and zeros (e.g., +5, 005).
  • Streamlined Decimals: Native parsing for +.5 and -.5.
  • IEEE-754 Compliance: Native, safe handling for NaN and Infinity.
  • High-Fidelity Math: Built-in support for BigDecimal to ensure zero precision loss.

Developer-Centric JSON5 Flexibility

Accelerate development and debugging with native support for internal documentation:

  • In-Line Documentation: Single-line (//) and Block comments (/* ... */) allowed directly within the data stream.
  • Zero-Dependency Logic: All features are self-contained within the NIO-core—no external libraries required.

Precision Serialization:

Industry-leading speed with a focus on maintaining forensic data integrity.

Deterministic Stability & Resource Guarding

Apex is architected to survive extreme data conditions that typically compromise standard JVM environments. It prioritizes system availability over uncontrolled execution.

Infrastructure Safety & Configurable Resource Limits

Apex provides a "Safety First" architecture. While we provide sensible out-of-the-box defaults to protect your JVM, we empower architects with granular control over every critical ingestion parameter.

Total Resource Control

Unlike libraries with hidden or hard-to-configure constraints, Apex exposes the "safety valves" directly through the API. You can tune the engine to match your specific hardware environment (from 128MB Edge-devices to Exascale Clusters).

Configurable Safety Envelopes (Per Call):

You define the boundaries of your data ingestion to prevent resource exhaustion and "Poison JSON" attacks:

  • Nesting Depth: Default 1,000 (Validated up to 10,500 levels).
  • String Length: Default 20 MB (Prevents massive string buffer allocation).
  • Digit Count: Default 50 (Neutralizes CPU/RAM exhaustion from massive scientific notation or BigDecimal overflows).
  • Object Count: Default 100,000 (Ensures predictable Heap utilization).

API Implementation Example:

// Total control over Nesting, String length, Digit count, and Object counts
Apex2MSJava.parseJson(filePath, maxNesting, maxStringLength, maxDigits, maxObjects);
Apex2MSJava.parseJsonUnsave(data, maxNesting, maxStringLength, maxDigits, maxObjects);

Adaptive Nesting Resilience

  • Deep-Structure Support: Validated up to 10,500 levels of nesting depth.*
  • Stack-Overflow Protection: Instead of a fatal StackOverflowError that crashes the JVM, Apex intercepts deep nesting and returns a controlled null/false, allowing the system to remain operative.
  • *Nesting limits are configurable and depend on available hardware resources (RAM/Stack size).

Resource Starvation Survival (The "Death Zone" Proof)

  • High-Density Efficiency: Engineered to maintain peak performance even in resource-constrained 128MB/512MB Heap environments.
  • GC-Pressure Mitigation: By minimizing object allocation deltas, Apex prevents the "Garbage Collection Death Spiral" common in high-load scenarios.
  • Proven Resilience: For a deep-dive into how Apex survives in a 128MB JVM with 96MB pre-allocated load, see our Death Zone Benchmark Report.

Safety Envelopes

  • Configurable Limits: Professional editions allow for hard-capping total objects, memory allocation, and nesting depth per operation to ensure deterministic behavior across the entire infrastructure.

Integration: Zero-Friction & Zero-Dependencies

Apex is engineered as a Sovereign Component. It requires no external libraries, ensuring a clean and secure supply chain for your mission-critical applications.

Direct Implementation

Apex is designed for immediate deployment. There is no complex configuration or dependency management required:

  • Add the JAR: Include the Apex build (C, M, S, MS, or IO) in your Java Classpath.
  • Zero Transitive Dependencies: Apex does not pull in third-party code. This eliminates the risk of "Dependency Hell" and minimizes your application's attack surface.
  • Universal Compatibility: Native support for Java 9 through Java 21+.

Basic Usage Example:

Serialization (Object → File/String)

import io.github.devlaskowski.apex2c.Apex2CJava;  
import io.github.devlaskowski.apex2c.Apex2CJava.LoadedContent;  
...  
// Static "Safe" way  
Apex2CJson.saveJava("data.json", myObject, true); // true = Pretty Print  
String json = Apex2CJson.serializeJava(myObject, false);  
  
// AutoCloseable way  
try (Apex2CJson apex = new Apex2CJson()) {  
    apex.save("data.json", myObject, true);  
}  

Deserialization (File/String -> Java Object)

import io.github.devlaskowski.apex2c.Apex2CJson;  
...  
// Static "Safe" way  
// Returns 'LoadedContent' to allow manual buffer recycling  
LoadedContent content = Apex2CJava.loadJson("data.json");  
char[] rawBuffer      = content.data;  
int length            = content.actualLength;  
  
Object data  = Apex2CJava.parseJson("data.json");  
Object data2 = Apex2CJava.parseJson(rawBuffer);  
  
// AutoCloseable way  
try (Apex2CJava apex = new Apex2CJava()) {  
    Object result  = apex.parse("data.json");  
    Object result2 = apex.parse("{\"data\": NaN}".toCharArray());  
}  

The Business Case: Resilience & Predictability at the Hardware Limit

Apex is not just about raw performance. It is a strategic investment in infrastructure stability, predictable resource consumption, and business continuity.

Why the License Pays for Itself: The Value of the Shield Sentinel

The decision to deploy Apex is a decision to protect your backend against unpredictable data conditions and resource exhaustion.

  • Engineered for Peace of Mind: Apex is architected to intercept extreme "Death Zone" conditions—such as deep nesting or massive payloads—long before they can paralyze your system. Instead of fighting fires and dealing with the fallout of fatal OutOfMemory or StackOverflow crashes, you gain the confidence of a system engineered to remain operative under extreme duress. You aren't just buying software; you are buying a good night's sleep.
  • The Shield Sentinel Advantage (ApexS & ApexMS): Functions as a structural firewall. It evaluates incoming payloads at the threshold to neutralize potential resource-exhaustion attacks and malformed data before they can destabilize the environment.

Scenario: Processing 100 Million JSON Requests / Day

Extrapolated from our canada_provinces.geojson Benchmark Report. This demonstrates how Apex handles massive, continuous workloads at the absolute hardware limit.

Metric                 Apex Performance                  The Business Impact
------------------------------------------------------------------------------------------------
Edge-Case Safety       Intercepts & Survives extreme     Maintains SLAs and prevents 
                       loads                             unplanned downtime                       
Threat Resilience      Active Structural Blocking        Protects backend systems from 
                                                         payload exploits                                 Execution Efficiency   Up to 41% less compute time       Frees up CPU cycles for other 
                       required                          critical tasks
Active Heap Load       Operates at ~35% capacity         Minimizes garbage collection and 
                                                         memory overhead

Conclusion: Absolute Predictability

An Apex license provides high-level infrastructure insurance. By eliminating the risks of memory fragmentation and uncontrolled execution, you maximize the lifespan and density of your existing hardware while securing your operations against unexpected spikes.


Edge-Case Survival & Smart Throttling Proof

To validate Apex's resilience under extreme resource starvation, we heavily restricted the runtime environment.

Test Parameters:

  • Max Heap: 128 MB (-Xmx128m)
  • Pre-Allocated Load: Up to 118 MB locked by a dummy byte array.
  • Resulting Workspace: Less than 10 MB remaining for the entire JVM, garbage collection, and application logic.

Scenario A: Smart Object Dropping under Critical Starvation

When pushed to the absolute limit while attempting to read the large canada_provinces.geojson, the engine hits the wall. Instead of a hard crash, it generates a single log line and instantly moves to the next task to keep the thread alive.

STATUS: [ULTRA STABLE] - Rock solid performance.
RESULT: Apex2C serialize benchmark, compact: false processed: canada_provinces.geojson
runs: 100 | time: 0 ms / 394,048 ns | average: 0 ms (3,940 ns)

Critical: Out of memory: Reached Java heap space.

Scenario B: Smart Triage Under Heavy Starvation

In a heavily starved environment where only ~5 MB of free heap remained, Apex was still able to fully process the twitter.json payload, while dropping larger files like citm_catalog to protect the JVM.

+---------------+---------------+---------------+
| Phase         | Used MB       | Reserved MB   +
+---------------+---------------+---------------+
| BASELINE      |        122.65 |        128.00 |
| ACTIVE (RUN)  |        126.63 |        128.00 |
| BREAK 5s      |        122.70 |        128.00 |
| BREAK 10s     |        122.68 |        128.00 |
+---------------+---------------+---------------+
| Metric                  | Values ms           |
+-------------------------+---------------------+
| Median                  |            2332.434 |
| Average                 |            2332.434 |
+-------------------------+---------------------+
STATUS: [ULTRA STABLE] - Rock solid performance.
RESULT: Apex2C deserialize benchmark processed: twitter.json
runs: 1 | time: 2,332 ms / 2,332,434,151 ns | average: 2,332 ms

The Business Result: No total blackout. While standard parsers would hard-crash the entire thread on the first unfulfilled allocation, Apex applies a "Smart Triage" strategy. It keeps smaller operations running while safely logging the memory exhaustion of larger tasks—giving your developers the time to investigate the leak without your entire infrastructure going down.


Operational Freedom: No More 3 AM Emergency Calls

System crashes due to unexpected payloads or malformed JSON always happen at the worst possible time. Apex is engineered to give your DevOps and on-call engineers their nights back.

Clean Infrastructure, Peaceful Nights

  • Zero Parser-Induced Downtime: Apex intercepts malformed payloads before they can trigger cascading failures or lock up your threads.
  • Forensic Observability: When Apex blocks invalid data, it doesn't just fail silently or throw a cryptic, generic error. It provides exact, forensic debug output directly in your logs. You instantly know what failed and where it failed.

Precise Forensic Output Examples:

Json Error: Missing value, line: 1, column: 11
Json Error: Invalid Map key: String expected (numeric found), line: 0, column: 3
Json Error: Unbalanced structure (mismatched brackets), line: 0, column: 11

No more guessing games or digging through heap dumps to find out which payload poisoned your system.

The "Clean Road" Strategy: Apex Shield

Apex utilizes a two-tier defense architecture to keep your pipeline moving:

  • The Sentinel: Evaluates incoming payloads at the threshold with a near-zero memory footprint. It stops invalid data and malicious structures right at the door.
  • The Worker: Only initializes and starts processing if the Sentinel provides explicit clearance.

"Don't let bad data clog your infrastructure."

Apex clears the road at the threshold. By ensuring that only valid, safe data ever reaches your heap, your business logic can focus on what it was originally built for: running your core services and generating revenue.

Financial Side-Effect

While Apex focuses on stability and security, its ultra-efficient NIO-core naturally reduces CPU execution time and active RAM utilization. This secondary benefit directly translates into lower cloud bills and delayed hardware expansions as a welcome bonus.


Which Apex Edition is right for you?

1. Apex Standard (The Speed Demon)

Best for: Developers, Students, and Personal Projects.

  • Usage: Strictly private, non-professional use on local personal machines.
  • Goal: Fastest possible parsing for trusted data.
  • Cost: 100% FREE (Personal Use Only).

Apex: Community Protection

Even in our 100% free Community Edition (Apex2C), infrastructure safety is not an afterthought. While we leave object counts open for maximum flexibility, the engine comes with hardcoded edge-case protection out-of-the-box to prevent malicious payloads from locking up your CPU and memory:

  • Max String Length: Capped at 20 MB (Prevents massive string buffer allocation).
  • Max Digit Count: Capped at 50 digits (Neutralizes CPU/RAM exhaustion from massive BigDecimals).
  • Infinite Structure Defense: While there is no hard object limit, both deep nesting and memory exhaustion are safely intercepted at the framework level. The engine gracefully aborts before your JVM crashes.

Note: For granular, per-call configuration over all safety envelopes and access to the pre-parse Sentinel Shield firewall, please refer to the Professional or Enterprise editions.

2. Apex M (The Efficiency Master)

Best for: Freelancers, Startups, and Independent SaaS owners.

  • Usage: Commercial environments and for-profit applications.
  • Goal: Drastically reduce cloud bills and process massive data loads on constrained instances.
  • Business Case: Engineered to cut operational overhead. The annual license fee is typically covered by your monthly server cost savings within the first few weeks.
  • License Expiry Behavior: Apex is engineered for business continuity. If a commercial license expires, the engine will not lock your infrastructure. Instead, it transitions to standard processing. The log will display UNLICENSED MODE (HYPER PERFORMANCE DEACTIVATED) ❗ and the engine operates without the premium speed-optimization delta.

Inside the Apex-M Engine (High-Efficiency Build-Time Security)

To fit into strict memory limits and maximize edge-computing hardware density, the Apex-M engine featured in this edition utilizes an optimized operational strategy:

  • Build-Time Validation: Instead of using a separate Pre-Parse layer (Sentinel), Apex-M integrates its core security directly into the object generation phase. It evaluates data structural safety in real-time as it maps to the Heap.
  • Graceful Failure over Corruption: If malformed data or improper nesting attempts to leak through, the engine immediately intercepts the error, returns null, and prevents corrupt or partial objects from entering your business logic.
  • Pre-Tuned Safety Envelopes: To maximum throughput and prevent misconfigurations from burning your small-instance resources, this edition comes with hardcoded, highly optimized safety thresholds identical to the baseline protection profile (20 MB strings / 50 digits).
  • The Result: Maximum hardware density and a hyper-lean memory footprint without sacrificing your system's stability.

3. Apex S (The Shield)

Best for: Growing systems requiring top-tier security on a budget.

  • Usage: Ideal for applications transitioning from internal to public, untrusted data streams.
  • Goal: Cost-effective deployment of the Sentinel Shield defense.
  • Positioning: The entry-level model for high performance and heavy security.
  • License Expiry Behavior: Apex values zero-downtime architectures. Upon license expiration, your system remains operative, but the pre-parse security firewall is disengaged. The log will display UNSAFE MODE (PRE-PARSER SHIELD DEACTIVATED) ❗. Immediate renewal is highly recommended to restore active DoS and payload protection.

Uncompromised Security, Balanced Performance

Apex-S shares its core defensive DNA directly with the Enterprise edition:

  • Sentinel Shield Included: Just like the larger editions, Apex-S utilizes the full Shield Sentinel Technique to stop DoS attacks and malformed JSON right at the door.
  • In-Build Protection: It also retains the deep "build-time" safety layers to prevent fatal system crashes.
  • The Trade-Off: To make this engine more accessible, Apex-S is not as aggressively memory-aware as the premium Apex-MS line and does not reach the same absolute peak parsing speeds.
  • The Result: You get massive, fortress-like infrastructure protection without paying for the highest-end enterprise operational optimizations.

Configurable Safety Envelopes (Apex-S & Apex-MS Only)

While our entry and efficiency models come pre-tuned to protect standard infrastructure, the advanced Apex-S and Enterprise (Apex-MS) lines give architects absolute, granular control over their environment.

There are no hidden configuration files or complex system properties to manage. Apex exposes the safety valves directly through the API as standard parameters:

  • Dynamic Nesting Depth: Override the default limit to support complex, highly nested legacy data trees.
  • Dynamic String Lengths: Scale up the memory allocation for specific ingestion calls that process heavy text payloads.
  • Dynamic Digit Counts: Adjust precision boundaries based on your specific scientific or financial processing needs.
  • Dynamic Object Limits: Hard-cap the total number of objects created per call to ensure deterministic heap utilization and prevent memory exhaustion during massive data bursts.
API Implementation Example:
// Pure transparency: Pass your exact hardware limits directly into the call
Apex2SJava.parseJson(filePath, maxNesting, maxStringLength, maxDigits, maxObjects);
Apex2MSJava.parseJson(filePath, maxNesting, maxStringLength, maxDigits, maxObjects);

4. Apex MS (The Fortress)

Best for: Corporations, Banks, and High-Traffic Platforms.

  • Usage: Mission-critical infrastructure handling untrusted public data.
  • Goal: Prevention of "Poison JSON", DoS attacks (Apex-S/MS), and structural exploits.
  • Business Case: Advanced, proactive infrastructure protection and zero-downtime architecture.
  • License Expiry Behavior: Apex values zero-downtime architectures. Upon license expiration, your system remains operative, but the pre-parse security firewall is disengaged. The log will display UNSAFE MODE (PRE-PARSER SHIELD DEACTIVATED) ❗. Immediate renewal is highly recommended to restore active DoS and payload protection.

Double-Layer Defense: The Apex Sentinel & Build-Time Shield

The Enterprise edition combines both of Apex's protective technologies into a zero-compromise fortress:

  • The Sentinel Shield: Validates, processes, and discards malformed, corrupt, or injected JSON data at near wire-speed. This ensures your parser never becomes the bottleneck, even under massive network load.
  • Integrated In-Build Protection: On top of the Sentinel pre-parser, it inherits the deep build-time security of the Apex-M line. If a threat or structural anomaly ever passes the threshold, the system fails gracefully rather than compromising the JVM.
  • The Result: Total peace of mind for high-availability systems where infrastructure downtime directly equates to massive financial losses.

5. ApexIO (The IO-Titan)

Best for: AI Research, High-Performance Computing (HPC), and Large-Scale Data Centers.

  • Usage: Massive-scale AI training, data context ingestion, and scientific research.
  • Goal: Processing extreme datasets across the entire spectrum—from Gigabytes to Exabytes.
  • Business Case: Engineered for environments where information density and throughput are critical.
  • License Expiry Behavior: Since ApexIO is built for extreme data throughput, an expired license disengages the advanced hardware-level parallel execution pipelines. The log will alert you with UNLICENSED MODE (HYPER PERFORMANCE DEACTIVATED) ❗ and the system will fall back to baseline linear I/O execution.

Direct-to-Memory Hardware Pushing

ApexIO is specifically engineered for environments that deal with massive amounts of data:

  • True Streaming Architecture: It reads data from the disk directly into your Java objects while parsing the structure on the fly, without holding the raw JSON structure in memory. It works the exact same way in reverse: building from your structure straight to disk.
  • No Internal Limits: This software has no arbitrary barriers. It reads and processes data as long as there is physical RAM available to hold the resulting objects. If your server provides the RAM, ApexIO delivers the data.
  • The Security Profile: This edition skips the Pre-Parser (Sentinel Shield) because it is engineered for trusted, internal data pipelines where speed is the only priority. However, it still retains full real-time in-build protection to prevent corrupt data from crashing the JVM.

The Reality Check: Predictability Over Chaos

Legacy parsing workflows force you to accept risks as normal behavior. Apex redefines what you should expect from your core data infrastructure.

Operational Scenarios: The Apex Difference

Scenario               Apex Performance Strategy         The Business Impact
------------------------------------------------------------------------------------------------
Massive Throughput     Ultra-Lean Execution              Slashes cloud overhead by maximizing 
                                                         existing hardware density.                       
Deep Nesting Limits    Controlled interception and       Zero thread lockups and no 
                       safe exits                        interrupted operations.
Constrained Memory     Minimal allocation deltas         Drastically reduces Garbage 
                                                         Collection spikes.

Ready to Upgrade?

Don't let uncontrolled data ingestion burn your infrastructure budget. Stop accepting system crashes as a normal cost of doing business and invest in a good night's sleep instead.

Architecture & Leadership

The Apex Engine is the result of advanced research into high-concurrency resource management.

  • Lead Architect: Michael Laskowski
  • Role: CEO | Internationally Certified Software Engineer
  • Specialization: High-Performance I/O & Intelligent Memory Systems (IntelliMem)

View Executive Profile & Innovation Track Record on LinkedIn

Direct License Inquiries

Clicking the link will prepare a formal inquiry template. Please provide your corporate entity details and a brief overview of your deployment scale. Our executive team will facilitate the licensing documentation and technical onboarding details.

About

High-Performance NIO JSON/JSON5 Engine. Optimized for extreme speed and low-resource overhead. Outperforms industry standards in processing, CPU/RAM efficiency, and usability—because time is money. (Advanced 400GB+ and Pre-Parser shield available in Business Editions).

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors