Being an Optimist in a Pessimistic World
10. FileMaker Konferenz | Hamburg | 16.-19. Oktober 2019
www.filemaker-konferenz.com
Who am I?
Been developing solutions with FileMaker since FileMaker 2.1
- Certified in versions 7 - 18

- Talented and Diverse Team @ Beezwax 🐝

Things I love…
- Research and Development 

- Data Visualization ( Tableau, D3, etc… )

- Hiking

- Sharp Knives

- Architecture
Vincenzo Menanno
Dramatically reduce network traffic!
What If…
Less network traffic… translates into.
Less work for the server
Less network traffic on your network
Sending only changed values
Reduce number of locks server needs to manage
Savings if you are using AWS
Significantly improve performance.
And What If…
This enables things like …
The ability to audit changes
Store data transactionally
Faster rendering and responsiveness
Pessimistic vs Optimistic
Differences
The Journey
Tools
Techniques
Break the rules…
FileMaker pessimistic record locking
Record locked for duration of edit
Server keeps tracks of Locks
Edit happens locally
The whole record is always transported
Record modification count
O optimistic record locking
Record locked only for committing data
Server doesn’t have more work
Edits happen on server
Send only changes
Use hashes instead modification counts
Compare with Past, Present & Future
E
^
👻
Calculations unstored —> stored
Log Audits
Local editing (many benefits)
And no additional traffic on network
E
^
optimistic record lockingO
there is more…
⚠ WARNING 🚧 🚧🚧 🚧
Percent of Tasked Completed
Project Task
Year
# Projects each Year
Has to have transactional integrity
Last Update 06/16/2019 04:33 PM
Eventual integrity
⚠ WARNING 🚧 🚧 🚧 🚧
Implications (not for everyone)
Solution Complexity
Types of Updates
- Transactional Integrity
- Eventual Integrity
Transactions with FileMaker
Test & Measure 🛠
Test out new ideas
Establish a Baseline
Measure
Need built in native tools
- for measurements
- for errors
🛠 NetworkMonitor Tool 🛠
Native Editing
Globals ( popovers and cards )
Local File Editing
Local File Editing (Data API)
Commit Footprint
3 Hashes (past, present, future)
A twist on MVC (model, view, controller)
The Journey
What is it
Implementation
How is it helpful
The Commit Footprint
Convert Calculations From
Unstored —> Stored
Sum ( TASK::AMOUNT )
If ( UPDATE ; “” ) & Sum ( TASK::AMOUNT ) )
Commit Footprint | What
Set Variable [ $_outer_start; Value: UTCMilli ]
//Perform Script [ “. commit footprint”; P: "5463" ] [ Wait ]
Perform Script on Server [ “. commit footprint”; P: "5463" ] [ Wait ]
Set Variable [ $_inner_duration; Value:Get ( ScriptResult ) ]
Set Variable [ $_outer_end; Value: UTCMilli ]
Set Variable [ $_outer_duration; Value:$_outer_end - $_outer_start ]
UTCMilli = Get ( CurrentTimeUTCMilliseconds ) / 1000
Commit Footprint | What
Set Variable [ $_id; Value:Get ( ScriptParameter ) ]
Go to Layout [ “JOB” (JOB) ]
Perform Find [ Find Requests: Find Records: JOB::ID: “$_id” ]
Set Variable [ $_inner_start; Value: UTCMilli ]
Set Field [ JOB::UPDATE; Get ( CurrentHostTimestamp ) ]
Commit Records/Requests [ No dialog ]
Set Variable [ $_inner_end; Value: UTCMilli ]
Set Variable [ $_inner_duration; Value:$_inner_end - $_inner_start ]
Exit Script [ Result: "Inner: " & $_inner_duration ]
UTCMilli = Get ( CurrentTimeUTCMilliseconds ) / 1000
Commit Footprint | Benefits
measurement on local area network
Local Area Network PS PSoS Percent
outer 0.078 0.097 -24.3%
inner 0.038 0.012 99.3%
Commit Footprint | Benefits
measurement from Hayward about 25 miles away
Wide Area Network PS PSoS Percent
outer 1.134 0.145 87.2%
inner 0.982 0.009 99.1%
Commit Footprint | Benefits
measurement from Oakland about 50 miles away
Wide Area Network PS PSoS Percent
outer 1.554 0.265 82.9%
inner 1.268 0.009 99.3%
Commit Footprint | Benefits
measurement from London about 5359 miles away
Wide Area Network PS PSoS Percent
outer 3.03 0.279 90.8%
inner 2.073 0.009 99.6%
Case Study Changes
Items Before After % Change
Basetables 46 33 -28.3%
Tables 158 89 -43.7%
Fields 985 549 -44.3%
Scripts 271 147 -45.8%
Layouts 97 47 -51.5%
Unstored Cals 103 9 -91.3%
Total 152’728 54805 -64.1%
Case Study | Benefits
Performance Before After % Change
Open 33 5 84.8%
New Project 19 2 89.5%
Project List 10 2 80%
Admin View 15 1 93.3%
Get ( RecordModificationCount )
1
2 3
4
MD5 Hash Ghosts
👻 - Past (original data)
👻 - Present (server data)
👻 - Future (changed data)
GetContainerAttribute (
List (
EventLocal::Event_Name ;
EventLocal::Date_Start ;
EventLocal::Date_End ;
EventLocal::Event_Description
) ;
"MD5"
)
You can use GetContainerAttribute
with non container fields!
MVC - Model | View | Controller
Model
View
Controller
Layout
Local StorageScripts
Demos
Data Transferred
Globals ( popovers and cards )
Local File Editing
Local File Editing (Data API)
The Journey
Single Add or Edit
Data validated before creation
Drawback: Multiple Edits
Globals
Single Add or Edit
Data validated before creation
Support for multiple edits
Very verbose to put in place
Local File Editing
Single Add or Edit but can be multiple
Data validated before creation
Support for multiple edits
Less verbose but more complexity
Local File Editing (Data API)
Pessimistic vs Optimistic
Recap
xDifferences between
Techniques Commit footprint / Local file editing
Warnings Important things to consider
Different approaches Global | Local | Data API
MVC Clear separation & easy to implement
Generating Hashes 👻 of past, present, and future
Resources
Network Monitor Tool for FileMaker - search for Network Monitor
Transactions Todd Geist - https://www.youtube.com/watch?v=FQzXs9SXt-U
Native Imports on Server - https://blog.beezwax.net/2019/05/22/imports-without-
tariffs-natively-with-filemaker-server/
Greg Lane (Tuesday 2:45 PM) - Maximizing FileMaker Performance
Chris Irvine (concurrently) - Doing it Right: Fast Solutions Developed WAN First
Under the Hood: Exploring FileMaker Server 18’s Performance Features
My recorded DevCon Session https://www.youtube.com/watch?v=g00xNgjKzv0
👻
👻
👻
Credits and Images
Slide: Luciano peeking Through - Vince Menanno
Footprint: https://unsplash.com/photos/BqpdGGfezFw
Piano - https://unsplash.com/photos/QNghR29tHR0
Choices - https://unsplash.com/photos/PXB7yEM5LVs
Coffee Test - https://unsplash.com/photos/i22gbC3gFm4
Journey - https://unsplash.com/photos/5hvn-2WW6rY
Thank you

FMK2019 being an optimist in a pessimistic world by vincenzo menanno

  • 1.
    Being an Optimistin a Pessimistic World 10. FileMaker Konferenz | Hamburg | 16.-19. Oktober 2019 www.filemaker-konferenz.com
  • 2.
    Who am I? Beendeveloping solutions with FileMaker since FileMaker 2.1 - Certified in versions 7 - 18 - Talented and Diverse Team @ Beezwax 🐝 Things I love… - Research and Development - Data Visualization ( Tableau, D3, etc… ) - Hiking - Sharp Knives - Architecture Vincenzo Menanno
  • 4.
    Dramatically reduce networktraffic! What If…
  • 5.
    Less network traffic…translates into. Less work for the server Less network traffic on your network Sending only changed values Reduce number of locks server needs to manage Savings if you are using AWS
  • 6.
  • 7.
    This enables thingslike … The ability to audit changes Store data transactionally Faster rendering and responsiveness
  • 8.
  • 9.
  • 10.
    FileMaker pessimistic recordlocking Record locked for duration of edit Server keeps tracks of Locks Edit happens locally The whole record is always transported Record modification count
  • 11.
    O optimistic recordlocking Record locked only for committing data Server doesn’t have more work Edits happen on server Send only changes Use hashes instead modification counts Compare with Past, Present & Future E ^ 👻
  • 12.
    Calculations unstored —>stored Log Audits Local editing (many benefits) And no additional traffic on network E ^ optimistic record lockingO there is more…
  • 13.
    ⚠ WARNING 🚧🚧🚧 🚧 Percent of Tasked Completed Project Task Year # Projects each Year Has to have transactional integrity Last Update 06/16/2019 04:33 PM Eventual integrity
  • 14.
    ⚠ WARNING 🚧🚧 🚧 🚧 Implications (not for everyone) Solution Complexity Types of Updates - Transactional Integrity - Eventual Integrity Transactions with FileMaker
  • 15.
    Test & Measure🛠 Test out new ideas Establish a Baseline Measure Need built in native tools - for measurements - for errors
  • 16.
  • 17.
    Native Editing Globals (popovers and cards ) Local File Editing Local File Editing (Data API) Commit Footprint 3 Hashes (past, present, future) A twist on MVC (model, view, controller) The Journey
  • 18.
    What is it Implementation Howis it helpful The Commit Footprint
  • 19.
    Convert Calculations From Unstored—> Stored Sum ( TASK::AMOUNT ) If ( UPDATE ; “” ) & Sum ( TASK::AMOUNT ) )
  • 20.
    Commit Footprint |What Set Variable [ $_outer_start; Value: UTCMilli ] //Perform Script [ “. commit footprint”; P: "5463" ] [ Wait ] Perform Script on Server [ “. commit footprint”; P: "5463" ] [ Wait ] Set Variable [ $_inner_duration; Value:Get ( ScriptResult ) ] Set Variable [ $_outer_end; Value: UTCMilli ] Set Variable [ $_outer_duration; Value:$_outer_end - $_outer_start ] UTCMilli = Get ( CurrentTimeUTCMilliseconds ) / 1000
  • 21.
    Commit Footprint |What Set Variable [ $_id; Value:Get ( ScriptParameter ) ] Go to Layout [ “JOB” (JOB) ] Perform Find [ Find Requests: Find Records: JOB::ID: “$_id” ] Set Variable [ $_inner_start; Value: UTCMilli ] Set Field [ JOB::UPDATE; Get ( CurrentHostTimestamp ) ] Commit Records/Requests [ No dialog ] Set Variable [ $_inner_end; Value: UTCMilli ] Set Variable [ $_inner_duration; Value:$_inner_end - $_inner_start ] Exit Script [ Result: "Inner: " & $_inner_duration ] UTCMilli = Get ( CurrentTimeUTCMilliseconds ) / 1000
  • 22.
    Commit Footprint |Benefits measurement on local area network Local Area Network PS PSoS Percent outer 0.078 0.097 -24.3% inner 0.038 0.012 99.3%
  • 23.
    Commit Footprint |Benefits measurement from Hayward about 25 miles away Wide Area Network PS PSoS Percent outer 1.134 0.145 87.2% inner 0.982 0.009 99.1%
  • 24.
    Commit Footprint |Benefits measurement from Oakland about 50 miles away Wide Area Network PS PSoS Percent outer 1.554 0.265 82.9% inner 1.268 0.009 99.3%
  • 25.
    Commit Footprint |Benefits measurement from London about 5359 miles away Wide Area Network PS PSoS Percent outer 3.03 0.279 90.8% inner 2.073 0.009 99.6%
  • 26.
    Case Study Changes ItemsBefore After % Change Basetables 46 33 -28.3% Tables 158 89 -43.7% Fields 985 549 -44.3% Scripts 271 147 -45.8% Layouts 97 47 -51.5% Unstored Cals 103 9 -91.3% Total 152’728 54805 -64.1%
  • 27.
    Case Study |Benefits Performance Before After % Change Open 33 5 84.8% New Project 19 2 89.5% Project List 10 2 80% Admin View 15 1 93.3%
  • 28.
  • 29.
    MD5 Hash Ghosts 👻- Past (original data) 👻 - Present (server data) 👻 - Future (changed data)
  • 30.
    GetContainerAttribute ( List ( EventLocal::Event_Name; EventLocal::Date_Start ; EventLocal::Date_End ; EventLocal::Event_Description ) ; "MD5" ) You can use GetContainerAttribute with non container fields!
  • 31.
    MVC - Model| View | Controller Model View Controller Layout Local StorageScripts
  • 32.
  • 33.
  • 34.
    Globals ( popoversand cards ) Local File Editing Local File Editing (Data API) The Journey
  • 35.
    Single Add orEdit Data validated before creation Drawback: Multiple Edits Globals
  • 36.
    Single Add orEdit Data validated before creation Support for multiple edits Very verbose to put in place Local File Editing
  • 37.
    Single Add orEdit but can be multiple Data validated before creation Support for multiple edits Less verbose but more complexity Local File Editing (Data API)
  • 38.
  • 39.
    xDifferences between Techniques Commitfootprint / Local file editing Warnings Important things to consider Different approaches Global | Local | Data API MVC Clear separation & easy to implement Generating Hashes 👻 of past, present, and future
  • 40.
    Resources Network Monitor Toolfor FileMaker - search for Network Monitor Transactions Todd Geist - https://www.youtube.com/watch?v=FQzXs9SXt-U Native Imports on Server - https://blog.beezwax.net/2019/05/22/imports-without- tariffs-natively-with-filemaker-server/ Greg Lane (Tuesday 2:45 PM) - Maximizing FileMaker Performance Chris Irvine (concurrently) - Doing it Right: Fast Solutions Developed WAN First Under the Hood: Exploring FileMaker Server 18’s Performance Features My recorded DevCon Session https://www.youtube.com/watch?v=g00xNgjKzv0 👻 👻 👻
  • 41.
    Credits and Images Slide:Luciano peeking Through - Vince Menanno Footprint: https://unsplash.com/photos/BqpdGGfezFw Piano - https://unsplash.com/photos/QNghR29tHR0 Choices - https://unsplash.com/photos/PXB7yEM5LVs Coffee Test - https://unsplash.com/photos/i22gbC3gFm4 Journey - https://unsplash.com/photos/5hvn-2WW6rY
  • 42.