Book a Demo

Author Topic: Best language for bulk updates?  (Read 4286 times)

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Best language for bulk updates?
« on: November 29, 2019, 02:12:21 am »
Hi,

I'm not sure there is a proper response for the following question...
Consider having to create and update multiple elements in your EA project by processing an external XML file (generated from a third party tool), including in depth synchronization.
I was wondering if there is any script language running in or outside EA that would be the most suitable and make a difference in terms of performance.

Options:
JScript in EA
Javascript in EA
Powershell (outside EA)
other??

Or will they all more or less perform more or less the same?
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Best language for bulk updates?
« Reply #1 on: November 29, 2019, 04:06:02 am »
They are all scripting languages and would not make much difference in performance. If the latter counts (for whatever reason) you need to turn to a compiled language (like any Cxx or what might be preferred). Personally I use Python and never had real performance issues. Only when you need to run regular jobs on a large DB compiled code might be the better choice.

q.
« Last Edit: November 29, 2019, 04:08:09 am by qwerty »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Best language for bulk updates?
« Reply #2 on: November 29, 2019, 08:32:26 am »
No scripting (or even compiled) language is going to make much of a difference unless you're doing some serious crunching in your code. The big time costs are associated with the DB access itself.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Best language for bulk updates?
« Reply #3 on: November 29, 2019, 09:25:29 am »
Depends on how you access the DB: API or native. There's a huge difference. For bulk changes I prefer the latter. But I (almost) know what I'm doing. And I do a lot of testing prior to let it work on production. Plus I assure that backups are ready.

q.

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1353
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Best language for bulk updates?
« Reply #4 on: November 29, 2019, 09:57:57 am »
Consider having to create and update multiple elements in your EA project by processing an external XML file (generated from a third party tool), including in depth synchronization.
What third party tool? The reason I ask is there are some plug-ins for Sparx EA that can hook up with other tools and import the data. You could avoid the generation and processessing of the XML file altogether.
You could always write a plug-in or get someone to write one.
For example I've got an intern over the summer to write a Sparx EA Plug-in to import conceptual, logical and physical data models from Power Designer. Got most of it working just ironing out the bugs after a couple of weeks effort.
Happy to help
:)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Best language for bulk updates?
« Reply #5 on: November 29, 2019, 03:31:08 pm »
If you are talking about big and complex xml files, and performance is an issue, than I would go with C#.

You can use XDocument class from System.Xml.Linq https://docs.microsoft.com/en-us/dotnet/api/system.xml.linq.xdocument?view=netframework-4.8 which is a lot faster in processing xml files that the older XmlDocument.

When it comes to creating things in EA, I always use the API.
For updates I sometimes SQL update statements, but only if I really can't avoid it because either the property is not available in the API, or the performance is a big problem.

Geert

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: Best language for bulk updates?
« Reply #6 on: November 29, 2019, 06:51:34 pm »
Thank you all for your replies.

Sunshine: the XML comes from a custom tool so I have to address it via a specific solution (otherwise I indeed have a look first for existing 3rd party tools, although for other projects the license cost was much higher than the cost to develop a custom solution... but that's a different subject)

My script already uses whenever it is possible DB updates via the Repository.Execute method as it's improved the execution time (compared with the API).
From what I've gathered, C# seems to be a good candidate to address the XML processing.

If I get to build a similar solution with C#, I'll update this thread with the resulting performance.
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com