page27
7
Refactor or Redesign
Refactoring is the process by which you simplify an existing code base while retaining
the original functionality. You might choose to refactor code to take advantage of new
performance enhancements, implementing both common design patterns and code
structures while improving the overall implementation. Regardless of the rationale
for refactoring, the aim is to preserve the original functionality; there should be no
discernable behavior differences from the original. Thus, retesting should be as simple
as re-running the original test cases utilizing the same inputs.
Refactoring is not intended to address software flaws. It is perfectly valid (and
desirable) when refactoring code to improve performance and scalability while
preserving the original functionality.
In contrast, redesign may not preserve the original functionality and often modifies,
extends, or otherwise improves the functional utility of the component in accordance
with the design specification.
Redesign is intended to address software flaws. It is perfectly valid (and desirable)
while redesigning code to improve performance and scalability.
Within this book I will use the previous definitions; however, as you will see later,
sometimes the boundaries are blurred.
Application Migration to Snowflake
Migration from legacy RDBMS to Snowflake is a common driver to unleash huge
performance benefits while moving to CSP infrastructure. I do not discuss in detail
“how” to migrate applications to Snowflake nor leverage CSP infrastructure within this
chapter, but note these steps are typically performed:
•
Planning: Developing a project plan incorporating scope, funding,
resources, and timeline.
•
Code conversion: Writing SQL statements, Data Definition Language
(DDL), user-defined functions, stored procedures syntax, language
conversion.
•
Entitlements: Refactoring the legacy application security model to
use a Snowflake role-based access model (RBAC) model.
ChaptEr 1
tuning thE SnowFlakE Data ClouD