Re-organizing Projects Folders

Hey guys,

I'm thinking about running some changes to our main project. The first thing I thought is to re-organize the views/models into new folders. For example, this is how it's organized today:

  • client 1
    - models folder
    - views folder

  • client 2
    - models folder
    - views folder

...

I'm thinking about do this:

  • models
    - client 1 models folder
    - client 2 models folder
    - ...

  • Views
    - client 1 views folder
    - client 2 views folder
    - ...

I am using this doc as reference: https://github.com/brooklyn-data/co/blob/main/looker_style_guide.md#pr-template

Also, I would love to chat with you guys about best practices and tips. 😄

Solved Solved
0 6 1,281
1 ACCEPTED SOLUTION

Ok, that makes sense. I would structure it this way.

prabhakaran_mai_1-1688570724991.png

Model Folder - Same as you suggested

`views_and_explore`
- explores - I would like to have explores created in separate files, instead of creating all in Model files directly.
Read this article on setting up separate explores.

views
- base_views_folder - This will have common views that you would be using across all clients
- client_specific_folder - This will have additional views that are specific to the client, also it can have a customized version of the base tables (Think extension or refinements).

Also, read this article on Hub and Spoke model and see if this would make sense for your case.
https://www.googlecloudcommunity.com/gc/Technical-Tips-Tricks/Advanced-LookML-Hub-and-Spoke-modeling... 

Regards,
Prabha Arivalagan

View solution in original post

6 REPLIES 6

@sergioBR Honestly, I like your current folder structure, Assuming each commit (unit of change) is within the client folder. I like all the code for a Client in a Single folder.

Is there a reason you want to reorg the folders to a new structure?

Hey @prabhakaran_mai thanks for your comment. 

The reason I'm thinking this is because the tables are basically the same. And there are 12 clients, so it'll be something around 36 folders. 

And sometimes, more than one table cross with another.

Ok, that makes sense. I would structure it this way.

prabhakaran_mai_1-1688570724991.png

Model Folder - Same as you suggested

`views_and_explore`
- explores - I would like to have explores created in separate files, instead of creating all in Model files directly.
Read this article on setting up separate explores.

views
- base_views_folder - This will have common views that you would be using across all clients
- client_specific_folder - This will have additional views that are specific to the client, also it can have a customized version of the base tables (Think extension or refinements).

Also, read this article on Hub and Spoke model and see if this would make sense for your case.
https://www.googlecloudcommunity.com/gc/Technical-Tips-Tricks/Advanced-LookML-Hub-and-Spoke-modeling... 

Regards,
Prabha Arivalagan

Do you think it will affect the dashboards that use the models? Just by change the location of it?

Changing the location of the view/explores does not affect the dashboards.

You need to update the path in the included statements in the explore or mode file. You should be good to go

Thanks, Just needed to be sure of it!