Founded in 1990 as a joint Swiss-Turkish venture, Foreks provides market data to customers in the financial services industry across Turkey and Greece. These customers include corporate clients—such as banks, brokers, foreign exchanges, and other financial institutions—and individual investors. Customers trust Foreks to provide fast, accurate, and comprehensive information in a format that helps them to make timely trades.
Until five years ago, Foreks hosted its applications and infrastructure on bare-metal servers in local collocated data centers. This worked well, but the advent of new delivery models—driven by the cloud—prompted Foreks to look at ways to provide a faster service to customers and handle extreme fluctuations in traffic.
Lead DevSecOps Engineer Umur Coşkuncan explains some of the goals of the company’s cloud strategy: “The Turkish stock market begins trading at 10:00 AM. We see a huge jump from 100,000 to 2 million requests a minute on our servers at that time, so we have to make sure our infrastructure can handle that, then scale down when trading stops at 6:00 PM. Traditionally, we used to overprovision physical servers, but with the cloud we wanted to avoid that—and the associated costs—by spinning up and terminating instances according to our need.”
Another driver of cloud adoption was the ability to innovate faster. This is especially true for growth areas like mobile, which have seen traffic increase from 1.5 million requests a day to 8 million in the last year alone. “We work in a competitive market,” explains Coşkuncan, “so reacting to changes from our suppliers and getting new services to our customers fast are vital. We’ve been at the forefront as IT has moved from physical servers to virtual ones, then to containers, and most recently to serverless—making deployment easier each time. We saw the cloud as the best way to reduce time-to-market.”
As of summer 2018, Foreks is all-in on AWS, running more than 95 percent of their infrastructure on AWS. This move has not been a lift and shift of the company’s old applications; it’s formed part of a cultural transition to more agile development practices.
Now, a DevOps team helps development teams build and deploy applications that are optimized for the cloud by advising on architectures, what AWS services to use, how to keep uptime high, and how to reduce cost. Foreks uses more than 40 AWS services to reduce its infrastructure maintenance burden as much as possible.
For example, many services run without permanent Amazon Elastic Compute Cloud (Amazon EC2), instead using AWS Lambda or AWS Batch, with data stored in NoSQL Amazon DynamoDB tables or Amazon Simple Storage Service (Amazon S3). For services that require a host instance, Foreks uses about 600 Docker containers, orchestrated with Kubernetes, and automatically deployed onto Amazon EC2 instances.
The company keeps configuration data for applications in Amazon S3 buckets, which is accessed by Docker containers at boot, meaning that one container image can behave in different ways. “We can create 30 different microservices from a single image,” says Coşkuncan. “And developers only need to make changes to the configuration files. This is another automated process, which typically handles around 25 changes a day.”
Coşkuncan is also excited to use the new Amazon Elastic Container Service for Kubernetes (Amazon EKS), which will take more management off the team’s hands.
Two prominent benefits of migration to the cloud are faster time to deploy and less infrastructure to manage.
Coşkuncan’s team has automated processes so that developers can self-deploy code. In the company’s legacy physical environment, deployments can take weeks—even months—as code is passed back and forth between Ops and Dev teams, servers are configured, and requirements are ironed out. In the AWS Cloud, it takes minutes.
With the drive toward serverless infrastructure, Foreks has been able to do away with many permanent instances. For example, one of its services used to use an Amazon EC2 instance to check for files coming from a data provider, process them, and send the output to another service that connects to clients. Today, it uses a combination of AWS Lambda, AWS Batch, Amazon S3, and Amazon Simple Notification Service (SNS) to perform the same process—only coming online when code needs to be executed. “Moving this service to a serverless architecture on AWS saved us 70 to 75 percent compared to using Amazon EC2,” says Murad Ozsert, software development team lead at Foreks.
In addition, Foreks no longer has racks of physical servers sitting idle during quiet periods. It used to need 30 servers for peak traffic to its mobile services but only two for baseline traffic. Now, it can terminate instances or shut down entire compute environments in AWS and use the money saved for innovation.
Coşkuncan is confident that Foreks can deliver data faster to customers by using AWS. “We’re a lot more advanced in our use of the cloud than many competitors,” he says. “We try and keep data in memory rather than in slow relational database services. And, the speed and network stability of AWS help make us the fastest data provider in the ecosystem—at least 50 milliseconds faster than our competitors—which means clients choose us because they can queue orders in their trading systems faster.”
In fact, Foreks’s use of the cloud is so advanced that it has opened a new line of business providing cloud consulting to existing clients in Turkey. “We pride ourselves on our AWS knowledge,” says Coşkuncan. “Our teams have a wide array of certifications, and we specialize in serverless compute environments—especially for use in the financial services industry. Our goal now is to spread that knowledge so others can benefit. Financial services organizations want to work with AWS. We see this as a fantastic opportunity.”