Skip to content

Instantly share code, notes, and snippets.

@CharlyJazz
Last active July 24, 2023 19:03
Show Gist options
  • Save CharlyJazz/e9db412d888b5add26c81ef3ec598d56 to your computer and use it in GitHub Desktop.
Save CharlyJazz/e9db412d888b5add26c81ef3ec598d56 to your computer and use it in GitHub Desktop.

1.) How you keep the code clean and easy to read?

2.) How you know which database use in a particular case?

  • I define which distributed system capabilities the case needs using the CAP Theorem
  • Then I analize wheter needs structured or non-structured data, qualitative or quantitative data, whether we needs do aggregate calculations using the data or we does not.

3.) How you manage background job tasks?

  • I always define the background jobs like nodes in a graph in function of the time.
  • I use Directed Acyclic Graphs (DAGs) when I need design the orchestration of several backgroun jobs related to each other
  • Most cases I just need to use redis and a Background Job library like Sidekiq for Ruby or Celery for Python but I know there are cases when you should integrate the background jobs with queue messaging solutions like RabbitMQ or Kafka always depends on the problem to solve
  • Also I always try to use tools for tracking, monitoring and logging in each job in order to collect all the possibly information about the processes. Datadog, Logstash, Kibana as so on

4.) How would you build a secure login for SPA and Mobile apps?

  • Avoiding JWT Auth flow using OAuth 2.0 PKCE spec. There are open source projects like Ory-Hydra or cloud services like AWS Cognito that can help us with this.

5.) How Decouple Complex SQL queries

  • Using CTE "WITH" Sub Queries would be a great idea.
  • Create Store Procedure SQL Files to reuse repeated logic.
  • Left Outer Join is very slow when you have to much records , is better use several queries, and JOIN. Like one query to get the specific IDs to use in the second query with JOIN and WHERE Clause instead get all records using LEFT OUTER JOIN

5.) Software good practices:

KISS, YAGNI, DRY, Law of Demeter, Twelve Factor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment