<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Alperen Keşkekoğlu on Medium]]></title>
        <description><![CDATA[Stories by Alperen Keşkekoğlu on Medium]]></description>
        <link>https://medium.com/@alperenkeskekoglu?source=rss-95ebd25638a8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*wQ1l624x6uEeIE5X</url>
            <title>Stories by Alperen Keşkekoğlu on Medium</title>
            <link>https://medium.com/@alperenkeskekoglu?source=rss-95ebd25638a8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 07:43:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alperenkeskekoglu/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Unlocking Software Excellence: Feature Flags and Beta Testing as Game Changers]]></title>
            <link>https://medium.com/insiderengineering/unlocking-software-excellence-feature-flags-and-beta-testing-as-game-changers-2e88df2f47b7?source=rss-95ebd25638a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e88df2f47b7</guid>
            <category><![CDATA[feature-flags]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[beta-version]]></category>
            <category><![CDATA[laravel]]></category>
            <dc:creator><![CDATA[Alperen Keşkekoğlu]]></dc:creator>
            <pubDate>Mon, 14 Apr 2025 07:02:31 GMT</pubDate>
            <atom:updated>2025-04-16T09:01:47.483Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y2fLw8wklmiHVpOZtw82ow.png" /></figure><p>In the fast-paced world of software development, one of the biggest challenges is delivering new features quickly without compromising the stability and reliability of your application. Traditional approaches to feature releases often involve significant risks, such as unexpected bugs, performance issues, or negative user feedback that can disrupt the user experience and damage trust.</p><p>Feature flags and beta testing address these challenges by introducing a controlled and flexible approach to development. Feature flags enable incremental feature rollouts, allowing developers to activate or deactivate functionality dynamically, reducing the impact of potential issues. Beta testing complements this by validating features in real-world conditions, gathering user feedback, and ensuring the final release meets expectations.</p><h3><strong>What Are Feature Flags?</strong></h3><p>Feature flags, or feature toggles, allow developers to dynamically enable or disable specific features without redeploying the application. By decoupling feature deployment from code releases, they bring unparalleled control and flexibility.</p><p><strong>Key Benefits of Feature Flags:</strong></p><ul><li><strong>Granular Control:</strong> Activate features for specific user groups, environments, or use cases.</li><li><strong>Safer Releases:</strong> Gradually roll out features, minimizing risks and monitoring real-world performance.</li><li><strong>Instant Rollbacks:</strong> Deactivate problematic features without redeploying code, reducing downtime.</li></ul><h3><strong>Implementation Levels for Feature Flags</strong></h3><p>Feature flags can be implemented at various levels, each catering to distinct needs:</p><ol><li><strong>Infrastructure Level</strong></li></ol><p>At the infrastructure level, feature flags are used to control operational aspects of your system dynamically. This is particularly useful for managing infrastructure configurations, scaling strategies, or service transitions during deployments.</p><p><strong>Key Use Cases:</strong></p><ul><li>Switching between a primary and backup database during failover.</li><li>Enabling a new caching layer to optimize performance.</li></ul><pre>if (config(&#39;infra.use_new_caching&#39;)) {<br>    // Enable the new caching system<br>    Cache::setDriver(&#39;redis&#39;);<br>} else {<br>    // Fallback to the default caching system<br>    Cache::setDriver(&#39;file&#39;);<br>}</pre><p>This approach allows teams to test infrastructure upgrades incrementally without disrupting ongoing operations. For instance, you could enable a new caching layer for 10% of traffic and monitor performance before a full rollout.</p><p><strong>2. Middleware Level</strong></p><p>Middleware is a powerful point to implement feature flags, allowing requests to be filtered or modified dynamically before reaching the application logic. Middleware-based feature flags are ideal for controlling access to experimental features or ensuring compatibility with specific user groups or roles.</p><p><strong>Key Use Cases:</strong></p><ul><li>Activating a beta feature for users in a specific geographic region.</li><li>Restricting access to admin-only tools for authorized users.</li></ul><p><strong>Example:</strong></p><p>Here’s an updated middleware that checks a feature’s activation status based on user roles stored in Redis:</p><pre>namespace App\Http\Middleware;<br><br>use Closure;<br>use Illuminate\Support\Facades\Redis;<br><br>class CheckFeatureFlag {<br>    public function handle($request, Closure $next, $featureKey) {<br>        $userRole = $request-&gt;user()-&gt;role;<br><br>        // Check if the feature is enabled for this role<br>        if (!Redis::sismember(&quot;feature:{$featureKey}:roles&quot;, $userRole)) {<br>            return response(&#39;Access denied: Feature not available for your role.&#39;, 403);<br>        }<br><br>        return $next($request);<br>    }<br>}</pre><p>This implementation ensures dynamic feature access based on user roles or permissions, allowing for a flexible and secure approach to feature management.</p><p><strong>3. URL/Route Level</strong></p><p>At the URL/Route level, feature flags are used to dynamically enable or disable features based on query parameters or specific routes. This approach is especially useful for testing new features with selected user groups or conducting A/B tests to optimize user experience.</p><p><strong>Key Use Cases:</strong></p><ul><li>Providing early access to beta features via special links.</li><li>Testing different layouts or workflows for targeted groups.</li><li>Dynamically enabling features based on user roles or experiment groups.</li></ul><p><strong>Example:</strong></p><p>A simple way to control features at the route level is by using query parameters to toggle feature availability:</p><pre>if ($request-&gt;query(&#39;beta&#39;) &amp;&amp; config(&#39;features.enable_beta_dashboard&#39;)) {<br>    return view(&#39;dashboard.beta&#39;); // Load the beta dashboard<br>}<br>return view(&#39;dashboard.default&#39;); // Load the standard dashboard</pre><h3><strong>Advanced Use Cases for Feature Flags</strong></h3><ol><li><strong>A/B Testing with URL Flags</strong></li></ol><p>Feature flags at the URL/Route level can also facilitate A/B testing, allowing you to direct users to different versions of a feature or layout based on parameters:</p><pre>$experimentGroup = $request-&gt;query(&#39;experiment_group&#39;);<br><br>if ($experimentGroup === &#39;A&#39; &amp;&amp; config(&#39;features.new_checkout&#39;)) {<br>    return view(&#39;checkout.new&#39;); // New checkout flow for Group A<br>} elseif ($experimentGroup === &#39;B&#39;) {<br>    return view(&#39;checkout.default&#39;); // Default checkout flow for Group B<br>}<br>return view(&#39;checkout.default&#39;); // Default fallback</pre><p><strong>Example Scenario:</strong></p><ul><li>Group A sees a redesigned checkout page to improve conversion rates.</li><li>Group B continues to use the existing checkout for comparison.</li></ul><p>2. <strong>Role-Based URL Feature Activation</strong></p><p>Feature flags can be combined with role checks to dynamically enable features via URLs:</p><pre>if ($request-&gt;query(&#39;beta&#39;) &amp;&amp; $request-&gt;user()-&gt;hasRole(&#39;beta_tester&#39;) &amp;&amp; config(&#39;features.enable_beta_tool&#39;)) {<br>    return view(&#39;tool.beta&#39;); // Beta feature for authorized testers<br>}<br>return response(&#39;Access denied.&#39;, 403); // Deny access for unauthorized users</pre><p>This ensures that even if someone discovers a beta flag in the URL, only authorized users can access the feature.</p><p>3. <strong>Domain-Specific Beta Features</strong></p><p>For multi-domain projects, beta features can be activated for specific domains. Using Redis, domains allowed to access a feature are stored in a set.</p><p><strong>Wildcard Usage:</strong></p><ul><li>If the set contains a wildcard (*), the feature is available to all domains.</li></ul><pre>use Illuminate\Support\Facades\Redis;<br><br>function isFeatureEnabledForDomain(string $featureKey, string $domain): bool {<br>    $allowedDomains = Redis::smembers(&quot;feature:{$featureKey}:domains&quot;);<br><br>    // Check for wildcard<br>    if (in_array(&#39;*&#39;, $allowedDomains)) {<br>        return true; // Open to all<br>    }<br><br>    // Check for specific domain<br>    return in_array($domain, $allowedDomains);<br>}<br><br>// Usage<br>$featureKey = &#39;beta_new_ui&#39;;<br>$currentDomain = request()-&gt;getHost();<br><br>if (isFeatureEnabledForDomain($featureKey, $currentDomain)) {<br>    return view(&#39;dashboard.beta&#39;);<br>} else {<br>    return view(&#39;dashboard.default&#39;);<br>}</pre><h3><strong>Flag Lifecycle and Cleanup</strong></h3><p>Feature flags are incredibly powerful tools, but if not managed effectively, they can lead to unnecessary complexity and technical debt. To ensure long-term maintainability and efficient development workflows, it is critical to understand and manage the lifecycle of feature flags.</p><p>The lifecycle of a feature flag begins with its creation, where the purpose and context of the flag should be clearly defined. Whether it’s for a gradual rollout, experimentation, or A/B testing, the flag should be implemented with a meaningful name and stored in a centralized system like Redis, a database, or a feature management tool. During its active phase, the flag enables developers to monitor performance, collect user feedback, and dynamically adjust its behavior without requiring a full redeployment.</p><p>After the flag has served its purpose, an evaluation phase follows to assess whether the associated feature has achieved its intended goals. At this stage, the team must decide whether the feature should be permanently integrated, further iterated, or deprecated. Once a decision is made, cleanup becomes essential. If the feature is fully adopted, the flag and any associated logic should be removed from the codebase. Proper documentation of these changes is also important to ensure traceability and clarity for the entire team.</p><p>Failing to clean up outdated feature flags can lead to several issues, such as reduced code readability, slower application performance, and the risk of unintentionally reactivating deprecated features. To prevent this, teams should maintain a disciplined approach to flag management. This involves keeping detailed documentation of each flag’s purpose, creation date, and ownership, as well as reviewing active flags regularly during sprint retrospectives or code audits. Tools and scripts can also be employed to track flag usage, while expiration dates can be set for temporary flags to enforce timely reviews.</p><p>In cases where long-term flags are necessary, such as those used for toggling regions or managing premium features, it is important to periodically review their relevance and ensure their logic remains simple and maintainable.</p><p>By integrating flag cleanup processes into the development workflow, such as through CI/CD pipelines that detect stale flags, teams can prevent feature flags from becoming a liability. Proactive management ensures that flags continue to enhance flexibility and innovation without compromising the quality or maintainability of the codebase.</p><p>Effective lifecycle management not only maximizes the benefits of feature flags but also supports a cleaner, more efficient development process. By approaching cleanup with discipline and foresight, teams can ensure their projects remain agile and scalable while avoiding unnecessary technical debt.</p><h3><strong>Final Thoughts</strong></h3><p>Feature flags and beta testing are transformative tools in modern software development, enabling teams to innovate faster while minimizing risks. Feature flags offer the flexibility to deploy features incrementally, toggle functionality dynamically, and roll back changes instantly if needed. When paired with beta testing, they provide an opportunity to gather valuable user feedback, test features in real-world scenarios, and refine products before a broader release.</p><p>The key to maximizing their benefits lies in disciplined management. By strategically planning the lifecycle of feature flags, regularly reviewing their usage, and removing outdated flags, teams can avoid technical debt and maintain a clean, efficient codebase. Similarly, combining A/B testing with feature flags allows for data-driven decisions that improve user experience and product performance.</p><p>Adopting these practices fosters an agile development culture where teams can experiment, iterate, and adapt quickly to user needs. Whether you’re rolling out a small experimental feature or launching a major product update, feature flags and beta testing provide the tools to do so confidently and effectively. Embrace these methods to deliver software that is not only innovative but also resilient and user-centric.</p><p><strong>Ready to elevate your development game? Start exploring feature flags and beta testing today!</strong></p><p>If you are about to make a decision about your career, please take a look at <a href="https://medium.com/insiderengineering/advanced-frequency-capping-mechanisms-c407bccc9aef">Advanced Frequency Capping Mechanisms</a> post by <a href="https://medium.com/@Xicy">Umut Akkaya</a>, Senior Software Engineer at Insider.</p><p>Also, don’t forget to follow <a href="https://medium.com/insiderengineering">Insider Engineering Blog</a> to see more articles ✍️</p><p>You can reach me on <a href="https://www.linkedin.com/in/alperenkeskekoglu/">LinkedIn</a> 📥</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e88df2f47b7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/insiderengineering/unlocking-software-excellence-feature-flags-and-beta-testing-as-game-changers-2e88df2f47b7">Unlocking Software Excellence: Feature Flags and Beta Testing as Game Changers</a> was originally published in <a href="https://medium.com/insiderengineering">Insider One Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Refactoring Old Monolith Architecture: A Comprehensive Guide]]></title>
            <link>https://medium.com/insiderengineering/refactoring-old-monolith-architecture-a-comprehensive-guide-7c192d7612e8?source=rss-95ebd25638a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c192d7612e8</guid>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[monolithic-architecture]]></category>
            <category><![CDATA[refactoring]]></category>
            <dc:creator><![CDATA[Alperen Keşkekoğlu]]></dc:creator>
            <pubDate>Mon, 10 Jun 2024 07:02:43 GMT</pubDate>
            <atom:updated>2024-06-10T07:02:43.512Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DhBdqw8HNiEewsdo9dc4rg.jpeg" /></figure><p>In the fast-paced world of software development, legacy projects built on outdated frameworks can become a significant obstacle to innovation and growth. Over time, as requirements change and new technologies emerge, maintaining and extending these monolithic applications becomes increasingly challenging. In this guide, we’ll delve into the process of refactoring an old monolith project, step-by-step, to breathe new life into your codebase and set the stage for future scalability and maintainability.</p><p>Before diving into the refactoring process, it’s crucial to understand the challenges associated with maintaining an old monolith project. These challenges may include:</p><p><strong>Complexity:</strong> Over time, the codebase accumulates technical debt, resulting in complex and intertwined dependencies that are difficult to untangle.</p><p><strong>Scalability:</strong> Monolithic architectures often struggle to scale horizontally, leading to performance bottlenecks as the application grows.</p><p><strong>Maintainability:</strong> As the codebase grows, it becomes increasingly difficult to understand, modify, and extend, resulting in longer development cycles and higher maintenance costs.</p><p><strong>Dependency Management:</strong> Legacy projects may rely on outdated dependencies and deprecated features, posing risks to security and stability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QXertnMZZqKZOYMnMU_X3g.jpeg" /><figcaption><em>Diagram illustrating monolithic architecture</em></figcaption></figure><p>Refactoring an old monolith project requires a systematic approach to gradually modernize the codebase without disrupting the existing functionality. Here’s a comprehensive roadmap to guide you through the process:</p><h4><strong>Code Analysis and Documentation</strong></h4><p>Begin by conducting a thorough code analysis to identify areas of improvement and potential refactoring opportunities. Document the existing codebase, including its structure, dependencies, and architecture, to gain a comprehensive understanding of the application’s current state.</p><h4><strong>Modularization</strong></h4><p>Break down the monolithic application into smaller, more manageable modules or components. Identify cohesive areas of functionality and extract them into separate modules, each with its own responsibilities and dependencies. This modular approach improves code reusability, maintainability, and testability, making it easier to reason about and extend the codebase in the future.</p><p><em>Before Modularization</em></p><pre>// UserController.php<br><br>namespace App\Http\Controllers;<br><br>use Illuminate\Http\Request;<br>use App\User;<br><br>class UserController extends Controller<br>{<br>    public function index()<br>    {<br>        $users = User::all();<br>        return view(&#39;users.index&#39;, compact(&#39;users&#39;));<br>    }<br><br>    public function show($id)<br>    {<br>        $user = User::findOrFail($id);<br>        return view(&#39;users.show&#39;, compact(&#39;user&#39;));<br>    }<br><br>    public function update(Request $request, $id)<br>    {<br>        $user = User::findOrFail($id);<br>        $user-&gt;update($request-&gt;all());<br>        return redirect()-&gt;route(&#39;users.show&#39;, $id);<br>    }<br><br>    public function login(Request $request)<br>    {<br>        // Your login logic<br>    }<br><br>    public function logout()<br>    {<br>        Auth::logout();<br>        return redirect()-&gt;route(&#39;home&#39;);<br>    }<br><br>    // Other methods for user management...<br>}</pre><p><em>After Modularization</em></p><pre>// UserController.php<br><br>namespace App\Http\Controllers;<br><br>use Illuminate\Http\Request;<br>use App\User;<br><br>class UserController extends Controller<br>{<br>    public function index()<br>    {<br>        $users = User::all();<br>        return view(&#39;users.index&#39;, compact(&#39;users&#39;));<br>    }<br><br>    public function show($id)<br>    {<br>        $user = User::findOrFail($id);<br>        return view(&#39;users.show&#39;, compact(&#39;user&#39;));<br>    }<br><br>    // Other methods for user management...<br>}</pre><pre>// ProfileController.php<br><br>namespace App\Http\Controllers;<br><br>use Illuminate\Http\Request;<br>use Auth;<br><br>class ProfileController extends Controller<br>{<br>    public function show()<br>    {<br>        $user = Auth::user();<br>        return view(&#39;profile.show&#39;, compact(&#39;user&#39;));<br>    }<br><br>    public function update(Request $request)<br>    {<br>        $user = Auth::user();<br>        $user-&gt;update($request-&gt;all());<br>        return redirect()-&gt;route(&#39;profile.show&#39;);<br>    }<br>}</pre><pre>// AuthenticationController.php<br><br>namespace App\Http\Controllers;<br><br>use Illuminate\Http\Request;<br>use Auth;<br><br>class AuthenticationController extends Controller<br>{<br>    public function login(Request $request)<br>    {<br>        // Your login logic<br>    }<br><br>    public function logout()<br>    {<br>        Auth::logout();<br>        return redirect()-&gt;route(&#39;home&#39;);<br>    }<br>}</pre><p><em>Explanation</em></p><p>In the “before modularization” version:</p><ul><li>The UserController handles various user management tasks, including listing, showing, and updating user profiles.</li><li>This results in a bloated and less maintainable controller, violating the Single Responsibility Principle (SRP).</li></ul><p>In the “after modularization” version:</p><ul><li>We’ve separated user management concerns into multiple controllers based on their responsibilities: UserController, ProfileController, and AuthenticationController.</li><li>UserController remains responsible for listing and showing users, while ProfileController handles profile-related actions such as viewing and updating profiles. AuthenticationController deals with authentication tasks like logging in and logging out.</li><li>Each controller is more focused and has a single responsibility, making the codebase cleaner, more organized, and easier to maintain.</li><li>This modular approach promotes code reusability, testability, and scalability, as each controller can be independently developed, tested, and modified without affecting other parts of the application.</li></ul><h4><strong>Dependency Injection and Inversion of Control</strong></h4><p>Refactor the codebase to embrace dependency injection and inversion of control principles. Instead of tightly coupling components to their dependencies, inject dependencies dynamically, allowing for greater flexibility and easier testing. This decoupling of components improves code modularity and simplifies the process of replacing or upgrading dependencies in the future.</p><h4><strong>Adopting a Microservices Architecture</strong></h4><p>Consider migrating from a monolithic architecture to a microservices architecture to further enhance scalability, resilience, and agility. Identify distinct business capabilities within the application and encapsulate them as independent microservices, each with its own data store and communication protocol. This distributed architecture allows for greater autonomy, fault isolation, and scalability, enabling teams to develop, deploy, and scale services independently.</p><p><em>Before Adopting Microservices</em></p><pre>// UserController.php<br><br>namespace App\Http\Controllers;<br><br>use Illuminate\Http\Request;<br>use App\User;<br><br>class UserController extends Controller<br>{<br>    public function store(Request $request)<br>    {<br>        $validatedData = $request-&gt;validate([<br>            &#39;name&#39; =&gt; &#39;required|string|max:255&#39;,<br>            &#39;email&#39; =&gt; &#39;required|string|email|max:255|unique:users&#39;,<br>            &#39;password&#39; =&gt; &#39;required|string|min:8&#39;,<br>        ]);<br><br>        // Create a new user with validated data<br>        $user = User::create($validatedData);<br><br>        return redirect()-&gt;route(&#39;users.show&#39;, $user-&gt;id);<br>    }<br><br>    // Other controller methods...<br>}</pre><p><em>After Adopting Microservices with Form Request</em></p><pre>// UserStoreRequest.php in app/Http/Requests directory<br><br>namespace App\Http\Requests;<br><br>use Illuminate\Foundation\Http\FormRequest;<br><br>class UserStoreRequest extends FormRequest<br>{<br>    public function authorize()<br>    {<br>        return true; // Authorization logic (if any)<br>    }<br><br>    public function rules()<br>    {<br>        return [<br>            &#39;name&#39; =&gt; &#39;required|string|max:255&#39;,<br>            &#39;email&#39; =&gt; &#39;required|string|email|max:255|unique:users&#39;,<br>            &#39;password&#39; =&gt; &#39;required|string|min:8&#39;,<br>        ];<br>    }<br>}</pre><pre>// UserController.php in the monolithic application<br><br>namespace App\Http\Controllers;<br><br>use Illuminate\Http\Request;<br>use App\Http\Requests\UserStoreRequest;<br>use App\User;<br><br>class UserController extends Controller<br>{<br>    public function store(UserStoreRequest $request)<br>    {<br>        // Form validation passed automatically due to UserStoreRequest<br><br>        // Create a new user with validated data<br>        $user = User::create($request-&gt;validated());<br><br>        return redirect()-&gt;route(&#39;users.show&#39;, $user-&gt;id);<br>    }<br><br>    // Other controller methods...<br>}</pre><p><em>Explanation</em></p><p>In the “before adopting microservices” version:</p><ul><li>Form validation logic is defined directly within the controller method using Laravel’s built-in validation features.</li><li>The controller method is responsible for validating form data and handling the business logic, resulting in a lack of separation of concerns.</li></ul><p>In the “after adopting microservices” version with Form Request:</p><ul><li>Form validation logic is encapsulated within a separate Form Request class (UserStoreRequest).</li><li>The Form Request class defines the validation rules for the request.</li><li>The UserController’s store method type-hints the UserStoreRequest, indicating that the request should be validated before the method is executed.</li><li>Laravel automatically handles the validation process. If validation fails, it redirects the user back with the validation errors. If validation passes, the controller method is executed with the validated data available via the $request-&gt;validated() method.</li><li>This separation of concerns makes the controller cleaner and more focused on its primary responsibility, which is handling HTTP requests and responses. The form validation logic is now reusable across multiple controller methods and can be easily maintained.</li></ul><h4><strong>Database Refactoring</strong></h4><p>Review the database schema and optimize it for performance, scalability, and maintainability. Normalize the database structure, eliminate redundant indexes, and optimize queries to improve overall database performance. Consider adopting a polyglot persistence approach, where different microservices use the most suitable database technology for their specific requirements, rather than relying on a single, monolithic database.</p><h4><strong>Continuous Integration and Deployment (CI/CD)</strong></h4><p>Implement a robust CI/CD pipeline to automate the process of building, testing, and deploying the application. This allows for faster delivery cycles, reduced deployment risks, and improved collaboration among development teams. Integrate automated tests, including unit tests, integration tests, and end-to-end tests, into the CI/CD pipeline to ensure the stability and reliability of the refactored application.</p><h4><strong>Monitoring and Performance Optimization</strong></h4><p>Implement comprehensive monitoring and logging solutions to track the performance and health of the refactored application in real-time. Monitor key metrics such as response times, error rates, and resource utilization to identify performance bottlenecks and optimize critical paths. Use profiling tools and performance benchmarks to fine-tune the application’s performance and ensure optimal scalability under varying workloads.</p><h4><strong>Documentation and Knowledge Sharing</strong></h4><p>Document the refactoring process, including the rationale behind design decisions, architectural patterns, and best practices adopted during the transition. Create developer documentation, README files, and wiki pages to onboard new team members and facilitate knowledge sharing within the organization. Encourage collaboration and feedback among team members to continuously improve the development process and maintain code quality over time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s2Aq6u7P4lXbYaXN0iSgJQ.jpeg" /><figcaption><em>Diagram illustrating the microservice architecture</em></figcaption></figure><p>Refactoring an old monolith project is a challenging but rewarding endeavor that requires careful planning, disciplined execution, and continuous improvement. By following a systematic approach and embracing modern software engineering principles such as modularity, microservices, and automation, you can revitalize your codebase and position your application for future scalability and maintainability. Don’t let the constraints of legacy hold you back — seize the opportunity to modernize your application and unlock its full potential in the ever-evolving landscape of software development.</p><p>If you are about to make a decision about your career, please take a look at <a href="https://medium.com/insiderengineering/optimizing-container-performance-90-857848b1d782">Optimizing Container Performance by %90</a> post by <a href="https://medium.com/@Xicy">Umut Akkaya</a>, Software Engineer at Insider.</p><p>Also, don’t forget to follow the <a href="https://medium.com/insiderengineering">Insider Engineering Blog</a> to see more articles ✍️</p><p>You can reach me on <a href="https://www.linkedin.com/in/alperenkeskekoglu/">LinkedIn</a> 📥</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c192d7612e8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/insiderengineering/refactoring-old-monolith-architecture-a-comprehensive-guide-7c192d7612e8">Refactoring Old Monolith Architecture: A Comprehensive Guide</a> was originally published in <a href="https://medium.com/insiderengineering">Insider One Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Upgrade Your Laravel Application to PHP 8]]></title>
            <link>https://medium.com/insiderengineering/how-to-upgrade-your-laravel-application-to-php-8-be4043bcaed9?source=rss-95ebd25638a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/be4043bcaed9</guid>
            <category><![CDATA[upgrade]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[php-update]]></category>
            <category><![CDATA[laravel]]></category>
            <dc:creator><![CDATA[Alperen Keşkekoğlu]]></dc:creator>
            <pubDate>Mon, 25 Dec 2023 08:02:58 GMT</pubDate>
            <atom:updated>2023-12-27T07:04:12.106Z</atom:updated>
            <content:encoded><![CDATA[<h3>Upgrading Laravel to PHP 8.0: A Comprehensive Guide for Seamless Transition</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zpdYMNTMri6G9y0dhoDdGA.jpeg" /></figure><p>In the ever-evolving landscape of web development, staying current with technology is key to unlocking new possibilities and ensuring the optimal performance of your projects. One significant stride in this journey is the upgrade from PHP 7.4 to PHP 8.0. This move brings forth a host of advantages, including performance boosts, new language features, and improved syntax. In this blog post, we’ll explore the compelling reasons to make the leap, examining the enhancements that PHP 8.0 offers and how they can positively impact your codebase and development workflow.</p><h3>Why?</h3><p>Updating your project from PHP 7.4 to PHP 8.0 can bring several benefits, including performance improvements, new features, and enhanced language capabilities. Here are some reasons why you might consider upgrading:</p><p><strong>Just-In-Time (JIT) Compilation<br></strong>PHP 8.0 introduces JIT compilation, which can further enhance performance by dynamically translating PHP bytecode into machine code. This feature can be particularly beneficial for CPU-bound applications.</p><p><strong>New Features and Syntax Enhancements<br></strong>PHP 8.0 introduces several new features and syntax enhancements, such as union types, named arguments, attributes, and more. These additions can improve code readability and maintainability.</p><p><strong>Nullsafe Operator<br></strong>PHP 8.0 introduces the nullsafe operator (?-&gt;), which provides a concise way to perform actions on nested objects without having to explicitly check for null at each level.</p><p><strong>Match Expression<br></strong>PHP 8.0 introduces the match expression, which is a more powerful and concise replacement for the switch statement. It allows for more expressive and readable code.</p><p><strong>Constructor Property Promotion<br></strong>PHP 8.0 introduces constructor property promotion, a feature that simplifies the process of declaring and initializing class properties in the constructor.</p><p><strong>Error Handling Improvements<br></strong>PHP 8.0 introduces improvements to error handling, including the new throw statement, which allows you to throw exceptions in a more concise and readable manner.</p><p><strong>Consistent Behavior<br></strong>Upgrading to PHP 8.0 ensures that your project benefits from the latest bug fixes and improvements, providing a more stable and reliable runtime environment.</p><p><strong>Security Updates<br></strong>Using the latest version of PHP is essential for security reasons. The PHP development community actively addresses security vulnerabilities in each release, so staying up-to-date helps keep your project secure.</p><p>Before updating, it’s crucial to thoroughly test your application with the new PHP version to ensure compatibility and address any potential issues. Additionally, check for deprecated features in PHP 7.4 that might have been removed in PHP 8.0 and update your code accordingly. Always refer to the official PHP documentation and release notes for a comprehensive understanding of the changes and improvements introduced in each version.</p><h3>How?</h3><p><strong>Step 1: Update Docker Compose Configuration</strong></p><p>In this step, you’ll update the Docker Compose configuration to use PHP 8.0. Open the docker-compose.yml file in the root directory of your Laravel project. Locate the php service within the file:</p><pre>services:<br>  php:<br>    image: php:7.4-fpm<br>    # ...</pre><p>Update the image field to use PHP 8.0:</p><pre>services:<br>  php:<br>    image: php:8.0-fpm<br>    # ...</pre><p>Additionally, you might want to check and update other services or configurations if they depend on specific PHP extensions or settings. For example, if you are using Nginx as a web server, make sure its configuration is compatible with PHP 8.0.</p><p>Save the changes to the docker-compose.yml file.</p><p>Then, run the following commands to update your project dependencies:</p><p>docker-compose run --rm php composer install</p><p><strong>Step 2: Update Laravel Framework</strong></p><p>Start by checking your Laravel project’s dependencies. Open a terminal in your project’s root directory and run:</p><p>composer show laravel/framework | grep versions</p><p>Ensure that the Laravel framework is compatible with PHP 8.0. If not, update the Laravel framework version in your composer.json file:</p><p>&quot;laravel/framework”:”8.0&quot;</p><p>Run the following commands to update your project dependencies:</p><p>docker-compose run --rm php composer update</p><p><strong>Step 3: Fix Issues</strong></p><p>Using <a href="https://github.com/rectorphp/rector">Rector</a> is an excellent approach to automate the process of fixing issues and making your codebase compatible with the newer PHP version. It is a powerful PHP code refactoring tool that can automatically apply various transformations to your code.</p><p>Rector can automate many changes, but there might be specific issues that require manual intervention. Review your codebase for any remaining issues and fix them accordingly.</p><p><strong>Step 4: Verify and Test Changes</strong></p><p>One invaluable tool for this task is <a href="https://phpstan.org/">PHPStan</a>, a powerful static analysis tool that helps identify potential issues and errors in your codebase. PHPStan offers a comprehensive approach to analyzing your code, providing insights that go beyond what traditional testing might uncover. It operates statically, meaning it doesn’t require the code to be executed, allowing for quick and efficient detection of bugs. <em>(Rector already incorporates PHPStan)</em></p><p>PHPUnit is a testing framework for PHP, and it’s commonly used in Laravel projects. Run your PHPUnit tests to ensure that your application’s functionality is not affected by the changes. Review the test results. If any tests fail, investigate and fix the issues. Running tests ensures that your application behaves as expected and helps catch regressions introduced during the upgrade process.</p><p><strong>Step 5: Deploy to Staging</strong></p><p>Deploy your updated Laravel application to a staging environment and conduct thorough testing to identify and resolve any issues that may have been missed in the local testing phase.</p><p><strong>Step 6: Deploy to Production</strong></p><p>Once testing is successful in the staging environment, deploy the updated Laravel application to your production server.</p><p><strong>Step 7: Monitor</strong></p><p>Monitor your application in the production environment, keep an eye on error logs, and address any issues promptly. Laravel’s robust error-handling tools can assist in debugging.</p><h3>Conclusion</h3><p>Upgrading your Laravel project to PHP 8.0 is more than a technical necessity; it’s an investment in the future of your application. By following these steps, embracing collaboration, and leveraging powerful tools, you position your Laravel project for continued success in the ever-evolving landscape of PHP development.</p><p>Happy coding!</p><p>If you are about to make a decision about your career, please take a look at <a href="https://medium.com/insiderengineering/optimize-your-laravel-applications-performance-effective-strategies-for-implementing-job-retries-384da22e3a50">Optimize Your Laravel Application’s Performance: Effective Strategies for Implementing Job Retries</a> post by <a href="https://medium.com/@dmitriy.kotikov">Dmitriy Kotikov</a>, Software Engineer at Insider.</p><p>Also, don’t forget to follow the <a href="https://medium.com/insiderengineering">Insider Engineering Blog</a> to see more articles ✍️</p><p>You can reach me on <a href="https://www.linkedin.com/in/alperenkeskekoglu/">LinkedIn</a> 📥</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be4043bcaed9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/insiderengineering/how-to-upgrade-your-laravel-application-to-php-8-be4043bcaed9">How to Upgrade Your Laravel Application to PHP 8</a> was originally published in <a href="https://medium.com/insiderengineering">Insider One Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How we saved 85% of costs by moving AWS Lambda from Node.js to Golang]]></title>
            <link>https://medium.com/insiderengineering/how-we-saved-85-of-costs-by-moving-aws-lambda-from-node-js-to-golang-b068498b6e97?source=rss-95ebd25638a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/b068498b6e97</guid>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[cost-savings]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[golang]]></category>
            <dc:creator><![CDATA[Alperen Keşkekoğlu]]></dc:creator>
            <pubDate>Mon, 19 Jun 2023 07:01:51 GMT</pubDate>
            <atom:updated>2023-06-19T07:01:51.193Z</atom:updated>
            <content:encoded><![CDATA[<p>Serverless computing has become an increasingly popular approach for building scalable and cost-effective applications. Amazon Web Services (AWS) Lambda is a serverless computing service that allows you to run code without provisioning or managing servers. When it comes to building serverless applications, choosing the right language can have a significant impact on performance, scalability, and cost. Two popular choices for serverless computing are Node.js and Golang (also known as Go). In this article, we’ll compare the performance, cost, and ease of use of Node.js and Golang on AWS Lambda.</p><p><strong>AWS Lambda Overview</strong></p><p>AWS Lambda is a compute service that lets you run your code in response to events and automatically manages the underlying compute resources for you. You can write your Lambda function code in several programming languages, including Node.js, Golang, Python, Java, and others. AWS Lambda supports a wide range of event sources such as Amazon S3, Amazon Kinesis, and Amazon DynamoDB, and can integrate with other AWS services to build serverless architectures.</p><p>When you create a Lambda function, you specify the code that will be executed, along with the runtime environment that will be used to execute the code. AWS Lambda automatically scales your application in response to the incoming traffic, and you pay only for the compute time that you consume. This makes it a cost-effective solution for building event-driven applications and microservices.</p><p>AWS Lambda supports multiple compute runtimes, including Node.js, Golang, Python, Java, and .NET Core. The Lambda execution environment is a container-based environment that provides isolation and security for your code. The environment provides a runtime, operating system, and pre-installed libraries and dependencies.</p><p><strong>Performance Comparison</strong></p><p>One of the main reasons why many developers are switching from Node.js to Golang for serverless computing is because of the significant performance improvements that Golang offers. Golang is a compiled language, which means that the code is translated into machine code before it’s executed. This results in faster execution times and lower memory usage compared to interpreted languages like Node.js.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/0*l1jsw46oRkS0D9Th" /><figcaption>Node.js Average</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/0*RQvFw1b2DwwIJckI" /><figcaption>Golang Average</figcaption></figure><p>To compare the performance of Node.js and Golang on AWS Lambda, we ran a series of tests using different workloads and measured the execution time and memory usage of each function. The results showed that Golang functions had significantly lower execution times and memory usage compared to Node.js functions.</p><p>For example, we ran a workload that involved parsing a large JSON file and returning the result. The Golang function completed the task in less than half the time of the Node.js function and used less than half the memory. Similarly, we ran a workload that involved performing several CPU-intensive computations, and the Golang function completed the task in less than a third of the time of the Node.js function.</p><p>Here’s a graph that shows the performance comparison of Node.js and Golang on AWS Lambda:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*c9citXUHMCaKR1YD" /><figcaption>Node.js Performance</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SuIjazVjtYs_zUlS" /><figcaption>Golang Performance</figcaption></figure><p>The graph shows that Golang functions have significantly lower execution times and memory usage compared to Node.js functions, across various workloads.</p><p><strong>Cost Comparison</strong></p><p>In addition to the performance benefits, switching from Node.js to Golang can also provide significant cost savings on AWS Lambda. This is because AWS Lambda pricing is based on the number of requests and the duration of the function execution.</p><p>Since Golang functions have significantly lower execution times compared to Node.js functions, this translates to lower compute costs on AWS Lambda. For example, if you have a function that is invoked 1 million times per month and has an execution time of 1 second, switching from Node.js to Golang can result in an 85% cost savings per month.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IdtjMADYaP79E1W6" /><figcaption>Node.js Cost</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6-rF5SWWowkC__8u" /><figcaption>Golang Cost</figcaption></figure><p><strong>Ease of Use</strong></p><p>When it comes to ease of use, Node.js has an advantage over Golang due to its simplicity and ease of development. Node.js has a large and active community, and there are many resources available for learning and troubleshooting. Additionally, Node.js has a vast ecosystem of libraries and frameworks that make it easy to develop complex applications quickly.</p><p>On the other hand, Golang has a steeper learning curve and requires more effort to set up and deploy. However, once you get familiar with the language, Golang can provide significant benefits in terms of performance and scalability.</p><p><strong>Conclusion</strong></p><p>In conclusion, if you are experiencing performance issues with your Node.js Lambda functions, or if you simply want to optimize your serverless application, we highly recommend considering a switch to Go. Not only did we experience significant cost savings, but we also noticed a significant improvement in our application’s performance and responsiveness. We hope that this article has provided you with valuable insights into the benefits of using Go for AWS Lambda functions.</p><p>If you are about to make a decision about your career, please take a look at <a href="https://medium.com/insiderengineering/how-we-saved-90-of-costs-by-moving-from-aws-lambda-to-aws-fargate-1921323e9429">How we saved 90% of costs by moving from AWS Lambda to AWS Fargate</a> post by <a href="https://medium.com/@3emrekaya">Emre Kaya</a>, Software Engineer at Insider.</p><p>Also, don’t forget to follow <a href="https://medium.com/insiderengineering">Insider Engineering Blog</a> to see more articles ✍️</p><p>You can reach me on <a href="https://www.linkedin.com/in/alperenkeskekoglu/">LinkedIn</a> 📥</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b068498b6e97" width="1" height="1" alt=""><hr><p><a href="https://medium.com/insiderengineering/how-we-saved-85-of-costs-by-moving-aws-lambda-from-node-js-to-golang-b068498b6e97">How we saved 85% of costs by moving AWS Lambda from Node.js to Golang</a> was originally published in <a href="https://medium.com/insiderengineering">Insider One Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>