Skip to content

Future Roadmap / Ideas #512

Open
Open

Description

@arthurschreiber

Since the development on tedious has slowed down quite a bit in recent times, I want us (the tedious community) to put down a more or less formal roadmap of areas in tedious that need attention and should be worked on. This will help us maintainers to focus on these topics, while giving new contributors an idea of what they could be working on.

These topics don't have to necessarily be focusing on a specific bug or issue, but can be more general as well.

I will put down things that come to my mind in this issue, please feel free to suggest more topics. Once we have a good sized list, we can prioritize these and map out a rough timeline.


General / Documentation

  • Better contributor guidelines: We should make it clear what we expect from contributions (tests, coding style, etc). We should also document why some test cases are still written in CoffeeScript.

  • Better README: The readme should better reflect the goals and history of tedious.

  • More Contributors: Everyone who contributes to ´tedious´ should get commit access.

  • More Releases: WE should be able to push more releases, more often. We've not had a release for a loooong time, and that's bad. We should be able to push a new release monthly.

Documentation

  • Better documentation: The documentation is currently stored in the gh-pages branch and maintained separately from everything else. We should move all documentation to be generated from the source code using documentation.js or a similar tool.

Performance

  • The parser is quite slow. This is mostly due to the fact that we use a lot of nested callbacks. I've done some experiments using a function trampoline instead, where each parsing function returns the next parsing function (or undefined if not enough data was received), with very promising performance benefits. Unfortunately, rewriting all of the token parsing functions is a lot of work.

  • Many other areas of the code follow coding style practices that keep them from being JIT compiled by V8.

Tests

  • Tests are still written in CoffeeScript, and should be converted everything to ES2017 compatible code instead.

  • nodeunit test cases are often really hard to debug and sometimes it's not quite clear where bugs happen or assertions fail. We probably should move over to ´mocha´ or ´jest´.

Code Style

  • Clean up messy leftover code from the CoffeeScript to JavaScript conversion.
  • Update to latest version of Babel and allow ES2017 features.

Features

  • "Native" JSON support?
  • Integrated Authentication.
  • Retries on Transient Failures. (Retries on transient failures #456)
  • All the flavors of Active Directory Authentication.
  • Unsupported Types: INTN, NTEXT, BITN, DECIMALN, NUMERICN, FLTN, MONEYN, DATETIMN, XML, UDTTYPE, SSVARIANTTYPE
  • Always Encrypted
  • Query Notifications
  • Support for SQL Server Express LocalDB via named pipes

Activity

  1. lloydcotten commented on Feb 23, 2017

    @lloydcotten

    For test framework / runner... might I suggest a couple of more possibilities:

    This is just coming from my own experience of using mocha and finding that my tests tend to run faster and are cleaner with a TAP-style test framework (and supports concurrent test running). I've personally used node-tap and ava and I like them both. node-tap is more of framework that includes test coverage using nyc, etc.

    Any of them (including mocha or jest) is better than nodeunit IMO. I would be willing to contribute to this effort once clear guidelines and direction is chosen.

  2. spanditcaa commented on Feb 23, 2017

    @spanditcaa
    Member

    An alternative approach to the parser performance issue could come from FOR JSON support, as discussed in #317.

  3. arthurschreiber commented on Feb 23, 2017

    @arthurschreiber
    CollaboratorAuthor

    An alternative approach to the parser performance issue could come from FOR JSON support, as discussed in #317.

    I don't think "native" JSON support in tedious will help here at all. The JSON support from SQL Server works by sending back one result row containing a single column containing all the JSON data. We'd have to parse this using JSON.parse, which is a blocking operation. So the parser is still used, and focus should be on making it fast even with native JSON support. 😄

  4. tvrprasad commented on Feb 23, 2017

    @tvrprasad
    Contributor

    Thanks for putting this together @arthurschreiber !

    More Contributors: Everyone who contributes to ´tedious´ should get commit access.

    Can you please clarify what exactly this would mean in practice?

    Features missing that I can think of:

    • Integrated Authentication.
    • Retries on Transient Failures.
      o More hardening than a feature but valuable I believe - Retries on transient failures #456
    • All the flavors of Active Directory Authentication.
    • Unsupported Types: INTN, NTEXT, BITN, DECIMALN, NUMERICN, FLTN, MONEYN, DATETIMN, XML, UDTTYPE, SSVARIANTTYPE
    • Always Encrypted
    • Query Notifications

    Tests are still written in CoffeeScript, and should be converted everything to ES2017 compatible code instead.

    I can take the lead on this if you can give some pointers on what's left to be done.

  5. arthurschreiber commented on Feb 23, 2017

    @arthurschreiber
    CollaboratorAuthor

    Can you please clarify what exactly this would mean in practice?

    I want to grant every person that contributes a PR (and has that PR accepted) with commit access to the repo. We can enable required code review to ensure people don't push random things to the master branch, but I've worked on other open source projects that followed a similar policy and we never had any issues.

  6. tvrprasad commented on Feb 23, 2017

    @tvrprasad
    Contributor

    Would there be a smaller code reviewers group that can approve changes? WebKit follows that model and seems to work well for them - https://webkit.org/commit-and-review-policy/.

    but I've worked on other open source projects that followed a similar policy and we never had any issues.

    I'd be curious to know what those projects are. Intuitively a single PR seems a bit lax for giving commit access but you certainly have lot more experience than me with open source :-)

  7. arthurschreiber commented on Feb 23, 2017

    @arthurschreiber
    CollaboratorAuthor
  8. tvrprasad commented on Feb 23, 2017

    @tvrprasad
    Contributor

    Thanks @arthurschreiber - interesting reading. Especially the pull-request-hack experience is fascinating.

    There are a few checks mentioned though beyond an accepted PR. Specifically these are listed in http://felixge.de/2013/03/11/the-pull-request-hack.html:

    • Github profile: Does this user stand to lose a reputation by doing something stupid?
    • Skill: Based on the patch, do I think the user could be a good developer?
    • Usefulness: Is this patch solving a valid problem?

    Do you plan on having these and/or other checks beyond an accepted PR?

    Also what different roles should we have? I see words like committer, collaborator, reviewer flying around :) Listing out roles (whether it's 1 or 5) and responsibilities, and how you move from one role to other (even if it's just @arthurschreiber decides :-)) might be useful.

  9. chdh commented on Feb 28, 2017

    @chdh
    Collaborator

    Features:

    • Data flow control for query result rows for export of very large tables, see Pause Query Results #181.
      (I will send a pull request shortly).
    • Streaming bulk insert for very large tables, with data flow control, see Streaming BulkLoad for large table imports #523.
    • Suport for MARS/SMUX (Multiple Active Result Sets / Session Multiplex Protocol) to enable multiple active requests on a single connection.
  10. chdh commented on Mar 2, 2017

    @chdh
    Collaborator

    After having spent some time extending Tedious (implementing pause/resume), I think that the internal architecture of the TDS protocol driver should be reworked. The current Connection class module is 1,368 lines long and contains a web of events and callbacks. There should be a clear data flow architecture for the incoming and outgoing data streams, and the protocol state machine should be better encapsulated.

    The incoming data flow pipeline has the following structure:

    [socket] -> bytes -> [packet stream transform] -> packets -> message chunks -> [token stream parser transform] -> tokens -> rows

    The structure of the source code should clearly represent this data flow architecture. The TDS protocol state machine should be encapsulated in a separate module and isolated from the rest and from the two data flow pipelines.

    Each class should have a short description. It should be visible which class/module members (methods/functions and properties/variables) are part of the (public) interface of the class/module and which are internal (private). I suggest to use TypeScript to improve code quality.

  11. arthurschreiber commented on Mar 8, 2017

    @arthurschreiber
    CollaboratorAuthor

    Suport for MARS/SMUX (Multiple Active Result Sets / Session Multiplex Protocol) to enable multiple active requests on a single connection.

    I don't think we will ever support this. From all what I know about this feature, there is 0 advantage of using MARS over just using a connectionpool and opening multiple connections.

    If we wanted to support this, we'd have to implement MC-SMP, but not as part of tedious but as a separate library that we could then use in tedious.

    @tvrprasad What do you think?

  12. tvrprasad commented on Mar 8, 2017

    @tvrprasad
    Contributor

    I'll ask around here to get some insight on value add from MARS and get back. If you have any references that make an argument for why there is no value, please send them my way.

  13. chdh commented on Mar 9, 2017

    @chdh
    Collaborator

    From all what I know about this feature, there is 0 advantage of using MARS over just using a connectionpool and opening multiple connections.

    It depends on the use case. For a normal web application or web service, you are right. But if you have a complex client side application with multiple large data-bound components that communicates with a Node backend via a (multiplexed) WebSocket, the situation is different. And when multiple SQL Server logins are used, you have to use a connection pool per login.

  14. tvrprasad commented on Mar 10, 2017

    @tvrprasad
    Contributor

    From what I gather the only advantage is saving some connections which gives two advantages:

    1. Resource savings from fewer connections.
    2. Performance gains from saving connection setup time.
      o This is only for the case where you don't already have a warm connection in the pool.

    But MARS also comes with performance overhead due to managing interleaved query execution. That seems to be the experience with other drivers that implement this.

    Doesn't seem like much of a win. My take would be that we consider this only if we have specific use cases that show concrete gains.

    But if you have a complex client side application with multiple large data-bound components that communicates with a Node backend via a (multiplexed) WebSocket, the situation is different.

    Not sure why MARS would be advantageous here over creating multiple connections. How the App communicates with the Node backend seems orthogonal to how Node backend communicates with SQL Server (multiple SQL connections vs MARS)

    And when multiple SQL Server logins are used, you have to use a connection pool per login.

    You will need multiple Connections here with MARS also.

    If we wanted to support this, we'd have to implement MC-SMP, but not as part of tedious but as a separate library that we could then use in tedious.

    That makes sense, if we wanted to support this.

  15. Hadis-Fard commented on Oct 26, 2017

    @Hadis-Fard

    Query Notifications

    @arthurschreiber @tvrprasad We're planning to start stabbing this list, could you shed some light on this feature?

  16. tvrprasad commented on Oct 26, 2017

    @tvrprasad
    Contributor
  17. arthurschreiber commented on Oct 27, 2017

    @arthurschreiber
    CollaboratorAuthor

    @Hadis-Fard @tvrprasad

    For query notifications, I think what's still missing is the Query Notifications Header as specified in 2.2.5.3.1.

    I've no concrete idea how the API for exposing the query notification header options might look like - maybe something like this?

    const request = new Request('SELECT ShipperID, CompanyName, Phone FROM dbo.Shippers', {
      notification: {
        options: "service=mySSBService;local database=mydb", // see SQL_SOPT_SS_QUERYNOTIFICATION_OPTIONS
        message: "Some notification message", // see SQL_SOPT_SS_QUERYNOTIFICATION_MSGTEXT
        timeout: 3600 // see SQL_SOPT_SS_QUERYNOTIFICATION_TIMEOUT
      }
    }, function(error) {
      if (error) {
        // Query notification setup failed
      } else {
        // Query notification setup was successful
      }
    });
    
    connection.execSql(request);

    This could then cause the correct data to be sent via the query notifications header.

    Listening to query notification events could then be handled via the "regular" T-SQL statements like WAITFOR (RECEIVE * FROM MyQueue); or RECEIVE * FROM MyQueue;. What do you think? Would you like to take a stab at implementing this? 😄

  18. Hadis-Fard commented on Oct 27, 2017

    @Hadis-Fard

    looks good to me on setting the options, it also should have getter similar to SQLGetStmtAttr in here
    which i think it can be done by adding the notification into callback

    The SQL Server Native Client ODBC driver supports query notifications through the addition of three new attributes to the SQLGetStmtAttr and SQLSetStmtAttr functions

    Would love to stab this, I am currently working on AzureAD auth, will put this in my list

  19. added
    Follow up
    on Dec 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Follow up

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions