Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Woovi - Safe Coding Practices

Woovi - Safe Coding Practices

Safe Coding Practices at Woovi

Avatar for Sibelius Seraphini

Sibelius Seraphini

September 18, 2025
Tweet

More Decks by Sibelius Seraphini

Other Decks in Technology

Transcript

  1. Overview - What is Safe Code? - Changing Production Code

    - Feature Flag - Online Migrations - Manual + Automated Tests - Performance - Monitoring - Going to Production
  2. What is Safe Code ? - It won't break production

    - It won't mess with data - Proper error handling - Edge case handling - It works with existing production code - It is not a breaking change - It is backward compatible - It has performance in mind - Automated tests - Avoid regression - Without vulnerability - Security
  3. What is hard about existing code in production? - You

    need to understand it - You don't know all the second order effects that your changes will cause it - You can't see underlying structure - You can make breaking changes
  4. Feature Flag - Enables you to test in production in

    a safe way - Enable you to test in production with one or more customers before releasing to everybody (rollout pattern) - Always test both branches of your feature flag.
  5. Breaking Changes - It happens when you break the contract

    - It happens when you break the existing behavior
  6. Manual + Automated Tests - Manual tests to learn about

    the product and business logic - You can only make automated tests after testing manually - Automated tests avoid regression and catch second order effects when changing codes in the future - Use test plan for pragmatic testing
  7. How to find automated tests to run ? - Tests

    could not be colocated with the existing code in the monorepo - Moving more Woovi code to microservices would simplify this. - Mostly integration tests (endpoints, mutations, queries, jobs)
  8. Performance - Check if your queries use Index - Optimize

    your aggregates - Reduce $lookup - Reduce number of requests to database - Add cache if needed
  9. Going to Production - Test yourself in production - Use

    metabase to validate your data - Monitor using Kibana - Sentry - Notify CS/Sales if everything is correct