Is it good practice to create tasks inside Custom Operator in Apache Airflow

Is it good practice to create tasks inside Custom Operator as well as Execute BashOperator commands.

So my idea is to just call Custom Operator in dag and that Operator takes care of all the tasks and as well as possible other Operators that do some action.

Because it seems that creating 50-60 tasks inside Dag is a bit silly ?

What is best practice option to acessing External User Database for Our Internal Microservice

I have microservices for our apps, we have our own users database that used for all services, and some of our clients want to use our services but doesn’t want to expose their users database for our system, so we have to integrating our service without keep their users data in our database, is it possible ? if possible, what is best practice approach to do this.

enter image description here

user behavior – PDF Payment statement Best Practice

I’ve just inherited a web project for an accommodation provider, wherein a user can login and view rent payments; both approved, pending and overdue from their dashboard. These payments are held in accordions so can be viewed as top level transactions or expanded to show booking reference and card number (link of two states provided below).

There is a requirement to provide a ‘download’ button for users wherein this data will be pulled into a PDF statement. My question and conflict is whether it’s better experience and better meets expectation to pull all the granular detail into this statement, or provide the top level summary as a statement. There’s no time or budget to test or ratify this little feature unfortunately:

https://www.dropbox.com/s/wc4kpjjh546a1o7/trymydesign.jpg?dl=0

Is using a low F-number (wide aperture) for landscape photography a good practice?

I recently asked a question (How to increase the quality of photos taken through a DSLR?) on how to increase the sharpness of my images.

One of the answers proposed that even though it is known that for landscapes, in order to have a clear picture, it is recommended to use an aperture like f/10 or f/12, I can use f/2.8 or f/5.6 depending on my lenses.

Is this true? If yes, why does this happen and at what situations can it be applied?

I know that we can use the f/2.8 in landscape astrophotography, in order to gather as much light as possible.

The answers I am referring to is this one by xiota:

Your first image was shot at F10. The high F-number (smaller aperture)
produces deeper depth of field at the expense of more visible
diffraction. The DOF makes more of the image look in focus, but the
diffraction sacrifices fine detail. For crop sensor, F5.6 is a good
place to start. Adjust up or down as desired.

and this one by Jonas:

It is often said that the lower the zoom range of a lens, the sharper
it is. Maybe try to get a "cheap" (compared to other camera lenses)
prime lens (which means that the lens does not zoom; its focal length
is fixed) such as a 35mm f/1.8. Then stop down this lens to, let’s say
f/2.8, and your images will be very sharp.

encryption – is this a good practice for storing private keys?

I’m working on a centralized exchange for cryptocurrencies. the approach that I’m taking for some reasons is to create an account(private key) per user. now my problem is how to safely store private keys in server. since I’m using a VPS so it’s not possible to use HSM or any other hardware solutions.
now the approach I’m taking is this. for each user when he creates his account, I’m gonna generate a private key and encrypt that private key using his password. now if some user wants to transfer cryptocurrency from his inside platform account to his external account, in addition to his external account address, he also have to provide his password and I’m gonna use his password to decrypt his private key and sign the transaction using it.
now even if my database compromises, the attacker cant use private keys since they are encrypted and he cant use password to decrypt them since passwords are hashed.
now I wanna know that is there any problem with this approach that I dont see?
thanks in advance.

Is using a low aperture for landscape photography a good practice?

I recently asked a question on how to increase the sharpness of my images.

One of the answers proposed that even though it is known that for landscapes, in order to have a clear picture, it is recommended to use an aperture like f/10 or f/12, I can use f/1.8 or f/4 depending on my lenses.

Is this true? If yes, why does this happen and at what situations can it be applied

I know that we can use the f/1.8 in landscape astrophotography, in order to gather as much light as possible.

amazon web services – Best Practice: Ansys FEA Output Data Storage

I’m trying to make this as least subjective as possible by providing finite inputs and parameters. I truly want to know what is the most resource affective, given the constraints. Given my available options listed below, what is the best use of resources to store ANSYS FEA Output Data. Recent jobs need quick access, historic can be slower but retrievable within a reasonable amount of time (30min – 45min).

  1. Existing 16TB NAS, copy job to Amazon S3 bucket
  2. New NAS (48-64 TB), retire existing NAS
  3. Expand VMware SAN, new share, use VEEAM to manage backup to existing AWS S3 Bucket
  4. Expand user’s workstation from 2x 12TB HDDs to 4x 18TB HDDs RAID 10.

Points:

  • we are a lean enterprise and need to keep output data as opposed to smaller FEA input data due to resource and time constraints or rerunning jobs.
  • Could swing for either $10kUSD, 5 year investment or as much as $1kUSD per month if services like S3 buckets are required.

design – Is it bad practice to mutate your HttpClient objects?

Im in the process of creating a base class for typed HttpClient services (yes, I’m utilizing IHttpClientFactory). I wrote the process in such a way that for each CRUD method invoked from the service, the first thing said service does is check for and assign an access token to attach to the HttpClient header. Example:

public abstract class BaseNetworkService : IBaseNetworkService {
   protected HttpClient _httpClient { get; }

   public BaseNetworkService(HttpClient client, ...) {
      _httpClient = client;
   }
   
   public async Task<T> GetAsync<T>(string extendedUrl, ICacheContext cacheContext = null) {
      ... check Redis Cache, return result if there ...
      
      Http client = GetcurrentAccessToken(_httpClient);
      var response = await client.GetAsync(extendedUrl);
      ...
   }
}

I’ll admit upfront that I am not entirely sure why I have always made my HttpClients readonly and upon Googling for answers, it’s probably because every document and guide on HttpClient with dependency injection makes the client readonly. I didn’t find any material explaining the reason for that.

With that in mind, should your HttpClientremain readonly? Should any customization, such as attaching an access token, be done in the classes constructor?

frontend – Is it bad to use ObjectManager in list.phtml like in Code Below?? What’s the best Practice?

Is it bad practice to use ObjectManager in file app/design/frontend/Smartwave/porto/Magento_Catalog/templates/product/list.phtml

like this below.

        <?php 
        $objectManager = MagentoFrameworkAppObjectManager::getInstance();
        $category = $objectManager->get('MagentoFrameworkRegistry')->registry('current_category');
        if($category->getDescription())
        {
            echo '<div style="padding: 13px;margin-top: 15px;">'.$category->getDescription().'</div>';
        }

Would there be a better way to write this???

Any help would be greatly appreciated. Thank you!