By Julien Houllier
The “article gifting” feature is an important initiative within Le Parisien, aimed at increasing subscriber engagement while attracting new prospects. The feature is based on a robust technical architecture, designed to ensure security, scalability, and a seamless user experience.
General Design of the Feature
The idea for this feature is that we allow subscribers to share a unique and temporary link providing non-subscribers access to an article for free. When a subscriber chooses to share content, a specific link is generated, associating the article with their account and a predefined expiration date. The recipient of this link must log in or create an account to gain access, ensuring security and complete traceability. Once expired, the link automatically becomes invalid, thus preserving the value of premium content.
Architecture
The technical implementation of “article gifting” relies on several interconnected components.
Platform users interact with the API Gateway via ARC (“journal”) or via Authentication (login/account creation). This Gateway acts as a central communication point, relaying user requests to different micro-services managing the associated data and logic.
Backend: Symfony and NestJS
The backend of this feature uses Symfony as the main API Gateway. This API handles user requests and transmits them to an AWS API Gateway that orchestrates the various micro-services. Unlike the API Gateway, all micro-services are implemented with NestJS. These micro-services include the User API, OAuth API, Invitation API, Subscription API, Offer API, and Advantage API. Each micro-service interacts with its specific table to manage the associated data.
> French Tech Stack Study: A look behind-the-scenes at the tools used by the French Media Industry
Data Management with DynamoDB
DynamoDB plays a crucial role in the architecture. Each generated link is stored with precise details, allowing rigorous management of shares. To ensure that articles are not accessible indefinitely, a TTL (Time to Live) is configured on the records. Thus, the links automatically expire and become inaccessible without manual intervention. DynamoDB Streams is used to detect and process changes on the “invitations” and “advantages” tables, triggering critical events such as quota renewal or the deletion of expired invitations.
Orchestration and Automation with AWS Lambda, SQS, and State-Machines
Lambda functions are at the heart of the orchestration. They retrieve messages from DynamoDB Streams and initiate complex workflows via state-machines. These workflows include invitation validation, quota decrement, or user advantage renewal. To ensure smooth communication between the different services, SQS (Simple Queue Service) is used as a transit system. When a Lambda function retrieves a DynamoDB Stream, it emits a message, which transits via SQS to the service managing the state-machines. Another dedicated Lambda function reads these messages and launches the appropriate state-machine.
Configuration Management with AWS AppConfig
To ensure maximum flexibility, critical parameters, such as the duration of invitations before expiration, are dynamically managed via AWS AppConfig. This allows teams to update the rules without having to modify the source code or redeploy the services.
Frontend and User Experience
On the frontend side, all necessary calls go through our API Gateway. The Gateway provides a smooth experience by exposing simplified access points to check remaining quotas, generate links instantly, and validate invitations.
Challenges and Solutions
Real-time quota management presents one of the main technical challenges. DynamoDB Streams and automated workflows ensure continuous quota updates without errors. Additionally, the integration of SQS for inter-service communication enhances reliability and reduces processing delays. Regarding security, each link contains a signed token, verified at each access, thus preventing any potential abuse.
Conclusion
The “article gifting” feature perfectly illustrates the adoption of modern technologies to meet our strategic needs. By combining Symfony, NestJS, AWS Lambda, DynamoDB, SQS, AppConfig, and Step Functions, we have created a scalable and secure solution while maintaining an intuitive user experience. This project highlights the importance of inter-service orchestration and automation, enabling the rapid deployment of innovative features while preserving content quality and subscriber satisfaction.