(Migrated) Database

(This message has been automatically imported from the retired mailing list)

hello All,

I am working on a project at my university which deals with linking a
database to zato and displaying that SQL content on a webpage. I have
followed Zato’s documentation to get it running on a virtualbox. My project
deals with using a mySQL database to display that content on a webpage. The
rationale behind using Zato is to have a loosely coupled system.

I have read through most of the documentation available for SQL
notifications and outgoing channels but I am not able to understand how the
whole process would work. Based on my understanding, the process would be
as follows:

  1. Have a outgoing SQL Connection in Zato which has data from a SQL Query
    as given by the Zato Documentation.

  2. Call the Service running in Zato using Javascript and display this on
    the web page.

I am very new to the paradigm and any sort of help/pointers to how to
approach the problem would be immensely helpful.

Thanks.

Regards,
Stanwar

hello, I would like to see your project and be able to help. Working with
django, but I want to see how you work.

Thank you

Rog=C3=A9rio

2015-03-19 18:13 GMT-03:00 Sharad Tanwar stanwa2@uic.edu:

hello All,

I am working on a project at my university which deals with linking a
database to zato and displaying that SQL content on a webpage. I have
followed Zato’s documentation to get it running on a virtualbox. My proje=
ct
deals with using a mySQL database to display that content on a webpage. T=
he
rationale behind using Zato is to have a loosely coupled system.

I have read through most of the documentation available for SQL
notifications and outgoing channels but I am not able to understand how t=
he
whole process would work. Based on my understanding, the process would be
as follows:

  1. Have a outgoing SQL Connection in Zato which has data from a SQL Query
    as given by the Zato Documentation.

  2. Call the Service running in Zato using Javascript and display this on
    the web page.

I am very new to the paradigm and any sort of help/pointers to how to
approach the problem would be immensely helpful.

Thanks.

Regards,
Stanwar

On 19/03/15 22:13, Sharad Tanwar wrote:

  1. Have a outgoing SQL Connection in Zato which has data from a SQL
    Query as given by the Zato Documentation.

  2. Call the Service running in Zato using Javascript and display this on
    the web page.

Hi Sharad,

this sounds correct. The overall steps, assuming you already have
identified the set of use-cases for the project, would be:

  1. Design the DB
  2. Design queries in MySQL Workbench or a similar tool
  3. Author services
  4. Author frontend JS

#1, #3 and #4 could be done in parallel as long as you settle on the API
between JS and Zato - I’m not sure if you develop everything yourself,
including JS, or Zato and SQL only.

As for issuing queries - you either issue raw SQL prepared above or use
SQLAlchemy’s models and its query API to obtain data from an SQL database.

Here are usage examples:

https://zato.io/docs/progguide/examples/sql.html
https://zato.io/docs/progguide/outconn/sql.html#usage-examples

A couple of points to note:

  • Design and tune the queries upfront outside of Zato so as to focus on
    that one part in 100%

  • Raw SQL can be embedded in the body of services. It will be most
    convenient initially because services can be hot-deployed so each time
    you deploy a new version of the service with a new version of the query,
    they will just work immediately.

  • Later on, once you work out the queries and are sure they won’t change
    within the project, move them to INI files

https://zato.io/docs/progguide/service-local-config.html#ini-files

  • SQLAlchemy models let you not use SQL directly but they cannot be
    hot-deployed. Zato servers need to be restarted after each time you
    change a model. I’m sure it will be lifted in one of the upcoming
    releases but right now - restarts are needed.

Am 20.03.2015 um 08:07 schrieb Dariusz Suchojad:

  • SQLAlchemy models let you not use SQL directly but they cannot be
    hot-deployed. Zato servers need to be restarted after each time you
    change a model. I’m sure it will be lifted in one of the upcoming
    releases but right now - restarts are needed.

A reasonable middle ground between using raw SQL and the SQLAlchemy ORM
models would be to just use the SQLAlchemy core, i.e. build the queries
using SQLAlchemy’s SQL expressions.

Thank you All for the amazing response.

Dariusz,

Thanks again for the explanation. I am working on the complete end-to-end
implementation from SQL to JS.
Some of the questions I had about implementation are

  1. I have a service which uses an outgoing SQL connection to establish and
    gets that data. The information is logged to the server logs in the example
    posted in Zato Docs . Do we have some response header methods to process
    this out to the website which will be used to show this?

  2. You mention an API for Zato to JavaScript?? can you please elaborate on
    that? After having the information in Zato using the SQL connection, how do
    I send this data across to Javascript and process the same?

I deeply appreciate the time. Thanks a ton.

Regards,
Sharad Tanwar

On Fri, Mar 20, 2015 at 2:56 AM, Christoph Zwerschke cito@online.de wrote:

Am 20.03.2015 um 08:07 schrieb Dariusz Suchojad:

  • SQLAlchemy models let you not use SQL directly but they cannot be
    hot-deployed. Zato servers need to be restarted after each time you
    change a model. I’m sure it will be lifted in one of the upcoming
    releases but right now - restarts are needed.

A reasonable middle ground between using raw SQL and the SQLAlchemy ORM
models would be to just use the SQLAlchemy core, i.e. build the queries
using SQLAlchemy’s SQL expressions.

Hello Dariusz,

I was able to successfully show content on a webpage from a SQL Query.
I understood the paradigm once you pointed out the tutorial1 again.

I’ll start doing more stuff and exploring Zato even further.

Thanks.

Regards,
Sharad

On Sat, Mar 21, 2015 at 1:26 AM, Dariusz Suchojad dsuch@zato.io wrote:

On 20/03/15 23:16, Sharad Tanwar wrote:

  1. I have a service which uses an outgoing SQL connection to establish
    and gets that data. The information is logged to the server logs in the
    example posted in Zato Docs . Do we have some response header methods to
    process this out to the website which will be used to show this?

  2. You mention an API for Zato to JavaScript?? can you please elaborate
    on that? After having the information in Zato using the SQL connection,
    how do I send this data across to Javascript and process the same?

Hi Sharad,

responses are always assigned to self.response.payload.

Just have a look at the tutorial again + go through the usage examples.

https://zato.io/docs/tutorial/01.html
https://zato.io/docs/progguide/examples/index.html

Please let me know if you have any difficulties with any of these and in
that case, post your code along with any questions.

thanks,


Dariusz Suchojad

https://zato.io
ESB, SOA, REST, APIs and Cloud Integrations in Python