Skip to content

Phoenix API

Introduction

Grepsr API system is a sophisticated network of services designed to handle a wide range of functionalities. Utilizing Kong API Gateway, an open-source tool, we have created a flexible, scalable, and secure environment for managing our APIs and micro-services. This documentation provides an overview of our API ecosystem, highlighting how we leverage Kong's capabilities and various plugins to optimize performance and security.

API Ecosystem Overview

Our API infrastructure consists of multiple components, each serving a distinct role yet seamlessly integrated to ensure efficient and reliable service delivery. Through the use of Kong API Gateway, we have established a system that excels in handling complex routing, load balancing, and security challenges.

Key Features of our API system

1 Routing:

Our APIs are designed to efficiently route requests to the appropriate services, handling various paths and host-names(services) with precision.

2. Load Balancing:

We maintain optimal resource utilization and performance consistency by distributing incoming requests across multiple back-end services.

3. Health Checks:

Regular health checks are conducted to monitor the status of our services, enabling automatic rerouting of traffic in case of service interruptions.

4. Scalability:

Our system is built for high availability and scalability, capable of adapting to increasing demand and service expansions without compromising on performance.

5. Security:

We prioritize the security of our APIs, incorporating features like authentication, authorization, and encryption to safeguard against threats.

Plugins we have used

1. Key Authentication (key-auth):

This plugin adds key-based authentication to our services. It requires clients to provide an API key, ensuring only authorized access to the APIs.

2. Rate Limiting (rate-limit):

This plugin helps in controlling the API traffic. It limits how many requests a client can make in a given time frame, preventing overuse or abuse of the API.

3. Request/ Response Transformer:

It allows you to modify the upstream request/ response before it gets sent to the service/ client. This can be used to add, remove, or alter headers and body content.

4. Proxy Cache:

This plugin caches responses from the upstream services. It reduces latency and load on our services by serving cached responses for repeated requests. We have implemented a caching strategy for our most frequently accessed routes, storing their responses for a duration of five minutes. This approach significantly reduces the frequency of server requests, thereby optimizing server performance and resource utilization.

These tools have been instrumental in managing access, maintaining service quality, and ensuring efficient data delivery across our deployments.

API Services

Scenario:

We manage three distinct deployments: chrome-api, phoenix-api, and auth-api, each catering to different routes and functionalities.

Configuration:

chrome-api [depricated]:

The APIs currently utilized by our browser extensions are designated for eventual deprecation following the launch of Pline. These routes, primarily serving the browser extensions, will be phased out and replaced with the more advanced capabilities introduced with Pline.

phoenix-api:

The Phoenix API serves as the cornerstone of our service infrastructure, handling the bulk of our operational workload. It is configured to manage the majority of client-directed routes, effectively making it the primary endpoint for user interactions and data processing. This service plays a pivotal role in ensuring seamless and efficient handling of client requests, acting as the main hub for our API traffic.

auth-api:

We have wisely segregated critical routes, particularly those used for authentication and related functions, into a separate deployment. This separation enhances security and manageability.

Realtime crawler api:
Add Later

Each of these APIs are configured in Kong with their specific routes, plugins, and any additional settings pertinent to their operation.

Conclusion

In summary, our API system, powered by Kong API Gateway, reflects a well-orchestrated blend of performance, security, and adaptability. By strategically utilizing Kong's features and a selection of specialized plugins, we have established a resilient and dynamic infrastructure. This system not only handles current demands efficiently but is also poised to adapt and evolve with future technological trends, maintaining our commitment to excellence in API management.